未验证 提交 bb5b22d2 编写于 作者: C Changjian Gao 提交者: GitHub

Docs: add how to use Redis and TiKV as data storage (#656)

* Docs: add how to use Redis and TiKV as data storage

* Update
上级 cde960a2
......@@ -2,7 +2,7 @@
By reading [JuiceFS Technical Architecture](architecture.md) and [How JuiceFS Store Files](how_juicefs_store_files.md), you will understand that JuiceFS is designed to store data and metadata independently. Generally , the data is stored in the cloud storage based on object storage, and the metadata corresponding to the data is stored in an independent database.
## Storage setting options
## Storage setting options
When creating a JuiceFS file system, setting up data storage generally involves the following options:
......@@ -68,6 +68,7 @@ The following table lists the object storage services supported by JuiceFS. Clic
| [WebDAV](#webdav) | `webdav` |
| [HDFS](#hdfs) | `hdfs` |
| [Redis](#redis) | `redis` |
| [TiKV](#tikv) | `tikv` |
| [Local disk](#local) | `file` |
## S3 <span id='aws-s3'></span>
......@@ -614,13 +615,39 @@ JuiceFS will try to load configurations for HDFS client based on `$HADOOP_CONF_D
For HA cluster, the addresses of NameNodes can be specified together like this: `--bucket=namenode1:port,namenode2:port`.
## Redis <span id='redis'></span>
## Redis
Writing ...
[Redis](https://redis.io) is an open source, in-memory data structure store, used as a database, cache, and message broker. In addition to using Redis as the metadata engine of JuiceFS, Redis can also be used as data storage. It is recommended to use Redis to store data with a small amount of data, such as application configuration.
The `--bucket` option format is `redis://<host>:<port>/<db>`. The value of `--access-key` option is username. The value of `--secret-key` option is password. For example:
```bash
$ ./juicefs format \
--storage redis \
--bucket redis://<host>:<port>/<db> \
--access-key <username> \
--secret-key <password> \
... \
localhost test
```
## TiKV
[TiKV](https://tikv.org) is a highly scalable, low latency, and easy to use key-value database. It provides both raw and ACID-compliant transactional key-value API.
The `--bucket` option format is like `<host>:<port>,<host>:<port>,<host>:<port>`, the `<host>` is the address of Placement Driver (PD). The `--access-key` and `--secret-key` options have no effect and can be omitted. For example:
```bash
$ ./juicefs format \
--storage tikv \
--bucket "<host>:<port>,<host>:<port>,<host>:<port>" \
... \
localhost test
```
## Local disk <span id='local'></span>
When creating JuiceFS storage, if no storage type is specified, the local disk will be used to store data by default. The default storage path for root user is `/var/jfs`, and `~/.juicefs/local` is for ordinary users.
When creating JuiceFS storage, if no storage type is specified, the local disk will be used to store data by default. The default storage path for root user is `/var/jfs`, and `~/.juicefs/local` is for ordinary users.
For example, using the local Redis database and local disk to create a JuiceFS storage named `test`:
......@@ -628,7 +655,7 @@ For example, using the local Redis database and local disk to create a JuiceFS s
$ ./juicefs format redis://localhost:6379/1 test
```
Local storage is only used to understand and experience the basic functions of JuiceFS. The created JuiceFS storage cannot be mounted by other clients in the network and can only be used on a stand-alone machine.
Local storage is only used to understand and experience the basic functions of JuiceFS. The created JuiceFS storage cannot be mounted by other clients in the network and can only be used on a stand-alone machine.
If you need to evaluate JuiceFS, it is recommended to use object storage services.
......
......@@ -14,7 +14,7 @@ JuiceFS provides the [CSI Driver](https://github.com/juicedata/juicefs-csi-drive
To install Helm, refer to the [Helm install guide](https://github.com/helm/helm#install), Helm 3 is required.
1. Prepare a file `values.yaml` with access information about Redis and object storage (take Amazon S3 `us-east-1` as an example):
1. Prepare a file `values.yaml` with access information about metadata engine (e.g. Redis) and object storage (take Amazon S3 `us-east-1` as an example):
```yaml
storageClasses:
......
......@@ -46,7 +46,7 @@ $ juicefs format --storage s3 \
| [DigitalOcean Spaces](#do-space) | `space` |
| [Wasabi](#wasabi) | `wasabi` |
| [Storj DCS](#storj-dcs) | `s3` |
| [Vultr 对象存储](#vultr) | `s3` |
| [Vultr 对象存储](#vultr) | `s3` |
| [阿里云 OSS](#aliyun-oss) | `oss` |
| [腾讯云 COS](#qcloud-cos) | `cos` |
| [华为云 OBS](#huawei-obs) | `obs` |
......@@ -68,6 +68,7 @@ $ juicefs format --storage s3 \
| [WebDAV](#webdav) | `webdav` |
| [HDFS](#hdfs) | `hdfs` |
| [Redis](#redis) | `redis` |
| [TiKV](#tikv) | `tikv` |
| [本地磁盘](#local) | `file` |
## Amazon S3 <span id='aws-s3'></span>
......@@ -631,9 +632,35 @@ JuiceFS 会尝试基于 `$HADOOP_CONF_DIR` 或 `$HADOOP_HOME` 为 HDFS 客户端
对于 HA 群集,可以像下面这样一起指定 NameNodes 的地址:`--bucket=namenode1:port,namenode2:port`
## Redis <span id='redis'></span>
## Redis
待编写......
[Redis](https://redis.io) 是一个开源全内存数据存储,广泛用于数据库、缓存以及消息队列场景。除了将 Redis 作为 JuiceFS 的元数据引擎以外,Redis 还可以作为数据存储。推荐使用 Redis 存储数据量较小的数据,如应用配置。
`--bucket` 选项格式为 `redis://<host>:<port>/<db>``--access-key` 选项的值是用户名,`--secret-key` 选项的值是密码。例如:
```bash
$ ./juicefs format \
--storage redis \
--bucket redis://<host>:<port>/<db> \
--access-key <username> \
--secret-key <password> \
... \
localhost test
```
## TiKV
[TiKV](https://tikv.org) 是一个高度可扩展、低延迟且易于使用的键值数据库。它提供原始和符合 ACID 的事务键值 API。
`--bucket` 选项格式类似 `<host>:<port>,<host>:<port>,<host>:<port>`,其中 `<host>` 是 Placement Driver(PD)的地址。`--access-key``--secret-key` 选项没有作用,可以省略。例如:
```bash
$ ./juicefs format \
--storage tikv \
--bucket "<host>:<port>,<host>:<port>,<host>:<port>" \
... \
localhost test
```
## 本地磁盘 <span id='local'></span>
......
......@@ -14,7 +14,7 @@ JuiceFS 为 Kubernetes 环境提供了 [CSI Driver](https://github.com/juicedata
首先参考[「Helm 安装指南」](https://github.com/helm/helm#install)安装 Helm,需要 Helm 3 及以上版本。
1. 准备一个叫做 `values.yaml` 的文件,其中包含 Redis 和对象存储的访问信息(这里以 Amazon S3 的 `us-east-1` 区域为例):
1. 准备一个叫做 `values.yaml` 的文件,其中包含元数据引擎(如 Redis)和对象存储的访问信息(这里以 Amazon S3 的 `us-east-1` 区域为例):
```yaml
storageClasses:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册