---
sidebar_label: Quick Start (Standalone Mode)
sidebar_position: 2
slug: /quick_start_guide
pagination_next: getting-started/for_distributed
---
# Quick Start Guide for Standalone Mode
The JuiceFS file system is driven by both ["Object Storage"](../guide/how_to_set_up_object_storage.md) and ["Database"](../guide/how_to_set_up_metadata_engine.md). In addition to object storage, it also supports to use local disk, WebDAV and HDFS, etc., as underlying storage. Therefore, you can create a standalone file system using local disks and SQLite database to get a quick overview of how JuiceFS works.
## Install Client
For Linux distributions and macOS users, the JuiceFS client can be quickly installed using a one-click installation script:
```shell
curl -sSL https://d.juicefs.com/install | sh -
```
Other operating systems and installation methods, please refer to ["Installation"](installation.md).
A help message will return after executing `juicefs` in terminal once the JuiceFS client is successfully installed regardless of operating system.
## Creating a File System {#juicefs-format}
### Basic Concept
JuiceFS client provides a command [`format`](../reference/command_reference.md#format) to create a file system as follows.
```shell
juicefs format [command options] META-URL NAME
```
As you can see, 3 types of information are required to format a file system.
1. **[command options]**: used to set up the storage medium for the file system; **local disk** will be used by default, and default path is `"$HOME/.juicefs/local"`, `"/var/jfs"` or `"C:/jfs/local"`.
2. **META-URL**: used to set up the metadata engine, usually a URL or the file path of a database.
3. **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](../guide/how_to_set_up_object_storage.md) and [JuiceFS supported metadata storage engines](../guide/how_to_set_up_metadata_engine.md).
:::
### Hands-on Practice
As an example of on a Linux system, the following command creates a file system named `myjfs`.
```shell
juicefs format sqlite3://myjfs.db myjfs
```
An output similar to the following will return if the file system creation is completed.
```shell {1,4}
2021/12/14 18:26:37.666618 juicefs[40362] <INFO>: Meta address: sqlite3://myjfs.db
[xorm] [info] 2021/12/14 18:26:37.667504 PING DATABASE sqlite3
2021/12/14 18:26:37.674147 juicefs[40362] <WARNING>: The latency to database is too high: 7.257333ms
2021/12/14 18:26:37.675713 juicefs[40362] <INFO>: Data use file:///Users/herald/.juicefs/local/myjfs/
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`.
![](../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/`.
## Mounting the File System
### Basic Concept
JuiceFS client provides a command [`mount`](../reference/command_reference.md#mount) 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.
1. `[command options]`: used to specify file system-related options, e.g. `-d` enables background mounts.
2. `META-URL`: used to set up the metadata storage, usually a URL or file path of a database.
3. `MOUNTPOINT`: used to specific 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, e.g. `Z:`, `Y:`.
:::
### Hands-on Practice
:::note
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:
```shell
juicefs mount sqlite3://myjfs.db ~/jfs
```
![](../images/sqlite-mount-local.png)
The client mounts the file system in the foreground by default. As you can see in the above image, the program keeps running in the current terminal. To unmount the file system, press <kbd>Ctrl</kbd> + <kbd>C</kbd> or close the terminal window.
In order to keep the file system mounted in the background, you can specify the `-d` or `--background` option when mounting, i.e. to mount the file system in the daemon:
```shell
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 `$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.
```shell
juicefs umount ~/jfs
```
## Go Further
The above exercise only helps you to have a quick experience with JuiceFS locally and gives you a basic overview of how JuiceFS works. To make the example more practical, we can take a step further by using SQLite to store metadata as above but replacing the 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 relatively inexpensive, 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](../guide/how_to_set_up_object_storage.md).
In general, only 2 steps are required to create an object storage:
1. Create a **Bucket** and get the Endpoint address.
2. Create the **Access Key ID** and **Access Key Secret**, i.e., the access keys for the Object Storage API.
Taking AWS S3 as an example, a resource that has been created would be like below.
- **Bucket Endpoint**: `https://myjfs.s3.us-west-1.amazonaws.com`
- **Access Key ID**: `ABCDEFGHIJKLMNopqXYZ`
- **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, and this document is to access the object storage from local as an example.
:::
### Hands-on Practice
Next, create a JuiceFS file system using SQLite and Amazon S3 object storage.
:::note
If the `myjfs.db` file already exists, delete it first and then execute the following command.
:::
```shell
# Replace relevant options with the actual object storage being used
juicefs format --storage s3 \
--bucket https://myjfs.s3.us-west-1.amazonaws.com \
--access-key ABCDEFGHIJKLMNopqXYZ \
--secret-key ZYXwvutsrqpoNMLkJiHgfeDCBA \
sqlite3://myjfs.db myjfs
```
The command above creates a file system using the same database name and file system name with the object storage options provided.
- `--storage`: Used to set the storage type, e.g. `oss`, `s3`, etc.
- `--bucket`: Used to set the Endpoint address of the object storage.
- `--access-key`: Use
没有合适的资源?快使用搜索试试~ 我知道了~
JuiceFS 是一款高性能 POSIX 文件系统,针对云原生环境特别优化设计
共764个文件
go:239个
png:175个
md:148个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 2 浏览量
2023-04-22
16:35:27
上传
评论
收藏 31.41MB ZIP 举报
温馨提示
JuiceFS 是一款高性能 POSIX 文件系统,针对云原生环境特别优化设计,在 Apache 2.0 开源协议下发布。使用 JuiceFS 存储数据,数据本身会被持久化在对象存储(例如 Amazon S3),而数据所对应的元数据可以根据场景需求被持久化在 Redis、MySQL、TiKV 等多种数据库引擎中。JuiceFS 可以简单便捷的将海量云存储直接接入已投入生产环境的大数据、机器学习、人工智能以及各种应用平台,无需修改代码即可像使用本地存储一样高效使用海量云端存储。
资源推荐
资源详情
资源评论
收起资源包目录
JuiceFS 是一款高性能 POSIX 文件系统,针对云原生环境特别优化设计 (764个子文件)
.autocorrectrc 826B
bash_autocomplete 524B
callback.c 1015B
vdbench_small_file.conf 556B
load-balancer.conf 438B
vdbench_big_file.conf 414B
redis.conf 102B
redis.conf 102B
redis.conf 102B
juicefs-csi-driver.Dockerfile 875B
Dockerfile 403B
juicefs.Dockerfile 223B
sdk.Dockerfile 143B
dockerfile-sftp 429B
org.apache.flink.core.fs.FileSystemFactory 622B
juicefs-profiling.gif 2.36MB
juicefs-profiling.gif 2.36MB
.gitattributes 24B
.gitignore 297B
.gitignore 85B
redis.go 112KB
sql.go 97KB
tkv.go 83KB
base_test.go 79KB
base.go 60KB
fs.go 30KB
objbench.go 30KB
main.go 29KB
gateway.go 28KB
vfs_test.go 26KB
vfs.go 25KB
cached_store.go 25KB
object_storage_test.go 25KB
sync.go 24KB
disk_cache.go 24KB
reader.go 19KB
mount.go 17KB
sync_test.go 17KB
interface.go 17KB
debug.go 16KB
benchmarks_test.go 16KB
fuse.go 15KB
format.go 14KB
s3.go 14KB
winfs.go 14KB
sftp.go 14KB
internal.go 13KB
bench.go 13KB
utils.go 13KB
bridge_test.go 13KB
dump.go 12KB
oss.go 12KB
writer.go 11KB
stats.go 11KB
obs.go 11KB
sync.go 11KB
object.go 11KB
gc.go 10KB
profile.go 10KB
file.go 9KB
ks3.go 9KB
fs_test.go 9KB
cached_store_test.go 8KB
load_dump_test.go 8KB
ufile.go 8KB
vfs_unix.go 8KB
cluster.go 8KB
cos.go 8KB
main.go 8KB
qingstor.go 8KB
info.go 8KB
hdfs.go 8KB
disk_cache_test.go 8KB
config.go 8KB
tkv_etcd.go 8KB
bridge.go 7KB
tos.go 7KB
ibmcos.go 7KB
bos.go 7KB
fuse_test.go 7KB
encrypt.go 7KB
qiniu.go 7KB
mdtest.go 7KB
webdav.go 6KB
tkv_test.go 6KB
encrypt_test.go 6KB
http.go 6KB
sql_lock.go 6KB
restful.go 6KB
flags.go 6KB
info_test.go 6KB
redis.go 6KB
config.go 6KB
gateway.go 6KB
mount_test.go 6KB
warmup.go 6KB
azure.go 6KB
fsck.go 6KB
tkv_tikv.go 6KB
redis_lock.go 6KB
共 764 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6732
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功