Skip to content

Commit

Permalink
docs: update standalone.md (#5090)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaitinChen authored Aug 16, 2024
1 parent 7ff0524 commit f42972e
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions docs/en/getting-started/standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@ The JuiceFS file system is driven by both ["Object Storage"](../reference/how_to

## Install the client

For Linux distributions and macOS users, the JuiceFS client can be quickly installed using a one-click installation script:
For Linux distributions and macOS users, you can quickly install the JuiceFS client using a one-click installation script:

```shell
curl -sSL https://d.juicefs.com/install | sh -
```

For other operating systems and installation methods, please refer to [Installation](installation.md).
For other operating systems and installation methods, refer to [Installation](installation.md).

Once installed successfully, executing the `juicefs` command in the terminal will return a help message regardless of the operating system.

## Create a file system {#juicefs-format}

### Basic concept
### Basic concepts

The JuiceFS client provides a command [`format`](../reference/command_reference.mdx#format) to create a file system as follows:
The JuiceFS client provides the [`format`](../reference/command_reference.mdx#format) command to create a file system as follows:

```shell
juicefs format [command options] META-URL NAME
```

To format a file system, three types of information are required:

- **[command options]**: Sets up the storage medium for the file system; **local disk** will be used by default, and the default path is `"$HOME/.juicefs/local"`, `"/var/jfs"` or `"C:/jfs/local"`.
- **META-URL**: Sets up the metadata engine, typically a URL or the file path of a database.
- **[command options]**: Specifies the storage medium for the file system. By default, the **local disk** is used with the path set to `"$HOME/.juicefs/local"`, `"/var/jfs"`, or `"C:/jfs/local"`.
- **META-URL**: Defines the metadata engine, typically a URL or the file path of a database.
- **NAME**: The name of the file system.

:::tip
JuiceFS supports a wide range of storage media and metadata storage engines. See [JuiceFS supported storage media](../reference/how_to_set_up_object_storage.md) and [JuiceFS supported metadata storage engines](../reference/how_to_set_up_metadata_engine.md).
JuiceFS supports a wide range of storage media and metadata storage engines. For more details, see [JuiceFS supported storage media](../reference/how_to_set_up_object_storage.md) and [JuiceFS supported metadata storage engines](../reference/how_to_set_up_metadata_engine.md).
:::

### Hands-on practice

As an example on a Linux system, the following command creates a file system named `myjfs`:
For example, on a Linux system, you can create a file system named `myjfs` with the following command:

```shell
juicefs format sqlite3://myjfs.db myjfs
```

Upon completion, an output similar to the following will be returned:
After executing the command, you will receive an output similar to the following:

```shell {1,4}
2021/12/14 18:26:37.666618 juicefs[40362] <INFO>: Meta address: sqlite3://myjfs.db
Expand All @@ -58,30 +58,30 @@ Upon completion, an output similar to the following will be returned:
2021/12/14 18:26:37.689683 juicefs[40362] <INFO>: Volume is formatted as {Name:myjfs UUID:d5bdf7ea-472c-4640-98a6-6f56aea13982 Storage:file Bucket:/Users/herald/.juicefs/local/ AccessKey: SecretKey: BlockSize:4096 Compression:none Shards:0 Partitions:0 Capacity:0 Inodes:0 EncryptKey:}
```

As you can see from the output, the file system uses SQLite as the metadata storage engine. The database file is located in the current directory with the file name `myjfs.db`, which creates a table to store all the metadata of the file system `myjfs`.
This output shows that SQLite is being used as the metadata storage engine. The database file named `myjfs.db` is located in the current directory. It creates a table to store all the metadata for the `myjfs` file system.

![SQLite-info](../images/sqlite-info.png)

Since no storage-related options are specified in this example, the local disk is used as the storage medium by default. According to the output, the file system storage path is `file:///Users/herald/.juicefs/local/myjfs/`.
Since no storage-related options were specified, the file system uses the local disk by default, with the storage path set to `file:///Users/herald/.juicefs/local/myjfs/`.

## Mounting the file system
## Mount the file system

### Basic concept
### Basic concepts

The JuiceFS client provides a command [`mount`](../reference/command_reference.mdx#mount) to mount file systems in the following format:
The JuiceFS client provides the [`mount`](../reference/command_reference.mdx#mount) command to mount file systems in the following format:

```shell
juicefs mount [command options] META-URL MOUNTPOINT
```

Similar to the command of creating a file system, the following information is also required to mount a file system:

- `[command options]`: Specifies file system-related options. For example, `-d` enables background mounts.
- `META-URL`: Sets up the metadata storage, typically a URL or file path of a database.
- `[command options]`: Specifies file system-related options. For example, `-d` enables background mounting.
- `META-URL`: Defines the metadata storage, typically a URL or file path of a database.
- `MOUNTPOINT`: Specifies a mount point of the file system.

:::tip
The mount point (`MOUNTPOINT`) on Windows systems should use a disk letter that is not yet occupied, such as `Z:` or `Y:`.
The mount point (`MOUNTPOINT`) on Windows systems should be an unused drive letter, such as `Z:` or `Y:`.
:::

### Hands-on practice
Expand All @@ -90,7 +90,7 @@ The mount point (`MOUNTPOINT`) on Windows systems should use a disk letter that
As SQLite is a single-file database, please pay attention to the path of the database file when mounting it. JuiceFS supports both relative and absolute paths.
:::

The following command mounts the `myjfs` file system to the `~/jfs` folder:
To mount the `myjfs` file system to the `~/jfs` folder, use the following command:

```shell
juicefs mount sqlite3://myjfs.db ~/jfs
Expand All @@ -106,25 +106,25 @@ To keep the file system mounted in the background, specify the `-d` or `--backgr
juicefs mount sqlite3://myjfs.db ~/jfs -d
```

Next, any files stored in the mount point `~/jfs` will be split into specific blocks according to [How JuiceFS Stores Files](../introduction/architecture.md#how-juicefs-store-files) and stored in the `$HOME/.juicefs/local/myjfs` directory; the corresponding metadata will be stored in the `myjfs.db` database.
Next, any files stored in the `~/jfs` mount point will be split into specific blocks according to [How JuiceFS Stores Files](../introduction/architecture.md#how-juicefs-store-files) and stored in the `$HOME/.juicefs/local/myjfs` directory; the corresponding metadata will be stored in the `myjfs.db` database.

In the end, the mount point `~/jfs` can be unmounted by executing the following command:
To unmount `~/jfs`, execute the following command:

```shell
juicefs umount ~/jfs
```

## Further exploration

The above exercise only helps you to have a quick experience with JuiceFS locally and gives you a basic overview of how JuiceFS works. For a more practical example, consider using SQLite to store metadata as demonstrated, but replace the local storage with "object storage."
The example above offers a quick local experience with JuiceFS and a basic understanding of its operation. For a more practical use case, you can use SQLite for metadata storage while replacing local storage with "object storage."

### Object storage

Object Storage is a web storage service based on the HTTP protocol that offers simple APIs for access. It has a flat structure and is easy to scale and cost-effective, particularly suitable for storing large amounts of unstructured data. Almost all mainstream cloud computing platforms provide object storage services, such as Amazon S3, Alibaba Cloud OSS, and Backblaze B2.
Object storage is a web storage service based on the HTTP protocol that offers simple APIs for access. It has a flat structure and is easy to scale and cost-effective, particularly suitable for storing large amounts of unstructured data. Almost all mainstream cloud computing platforms provide object storage services, such as Amazon S3, Alibaba Cloud OSS, and Backblaze B2.

JuiceFS supports almost all object storage services, see [JuiceFS supported storage medias](../reference/how_to_set_up_object_storage.md).
JuiceFS supports almost all object storage services, see [JuiceFS supported storage media](../reference/how_to_set_up_object_storage.md).

In general, only two steps are required to create an object storage:
To set up object storage:

1. Create a **Bucket** and get the Endpoint address.
2. Create the **Access Key ID** and **Access Key Secret**, which serve as the access keys for the Object Storage API.
Expand All @@ -136,7 +136,7 @@ Taking AWS S3 as an example, the created resources would look like the following
- **Access Key Secret**: `ZYXwvutsrqpoNMLkJiHgfeDCBA`

:::note
The process of creating an object storage may vary slightly from platform to platform, so it is recommended to check the help manual of the corresponding cloud platform. In addition, some platforms may provide different Endpoint addresses for internal and external networks. Please choose the external network access for your application. This document illustrates accessing object storage from a local environment.
The process of creating object storage may vary slightly from platform to platform. It is recommended to check the help manual of the corresponding cloud platform. In addition, some platforms may provide different Endpoint addresses for internal and external networks. Please choose the external network access for your application. This document illustrates accessing object storage from a local environment.
:::

### Hands-on practice
Expand All @@ -158,7 +158,7 @@ juicefs format --storage s3 \

The command above creates a file system using the same database name and file system name with the object storage options provided.

- `--storage`: Specifies the storage type, such ase `oss` and `s3`.
- `--storage`: Specifies the storage type, such as `oss` or `s3`.
- `--bucket`: Specifies the Endpoint address of the object storage.
- `--access-key`: Specifies the Object Storage Access Key ID.
- `--secret-key`: Specifies the Object Storage Access Key Secret.
Expand All @@ -169,10 +169,10 @@ Once created, you can mount the file system:
juicefs mount sqlite3://myjfs.db ~/jfs
```

The mount command is exactly the same as using the local storage because JuiceFS has already written the metadata of the object storage to the `myjfs.db` database, so there is no need to provide it again when mounting.
The mount command is exactly the same as using the local storage because JuiceFS has already written the metadata of the object storage to the `myjfs.db` database. Therefore, you do not need to provide it again when mounting.

Compared with using local disks, the combination of SQLite and object storage is more practical. From an application perspective, this approach is equivalent to plugging an object storage with almost unlimited capacity into your local computer, allowing you to use cloud storage as a local disk.

Further, all the data of the file system is stored in the cloud-based object storage, so the `myjfs.db` database can be copied to other computers where JuiceFS clients are installed for mounting, reading, and writing. That is, any computer that can read the metadata database can mount and read/write the file system.
Further, all the data of the file system is stored in the cloud-based object storage. Therefore, the `myjfs.db` database can be copied to other computers where JuiceFS clients are installed for mounting, reading, and writing. That is, any computer that can read the metadata database can mount and read/write the file system.

Obviously, it is difficult for a single file database like SQLite to be accessed by multiple computers at the same time. If SQLite is replaced by databases like Redis, PostgreSQL, and MySQL, which can be accessed by multiple computers at the same time through the network, it is possible to achieve distributed reads and writes on the JuiceFS file system.

0 comments on commit f42972e

Please sign in to comment.