mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
docs(docs): Modify the details of the documentation in the dev-guide section
Signed-off-by: Reliey <616318745@qq.com>
This commit is contained in:
parent
db8c58074a
commit
a28ac40474
@ -2,7 +2,7 @@
|
||||
|
||||
## 概述
|
||||
|
||||
调用资源管理节点提供的 API 进行集群管理。curl 命令中的 IP 和端口地址分别为资源管理节点配置文件中的 ip 和 listen 选项。
|
||||
调用资源管理节点 Master 提供的 API 进行集群管理。curl 命令中的 IP 和端口地址分别为资源管理节点配置文件中的 ip 和 listen 配置。
|
||||
|
||||
``` bash
|
||||
curl -v "http://10.196.59.198:17010/admin/getCluster" | python -m json.tool
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
启用故障域需要增加 cluster 级别的配置,否则无法区分,新增 zone 是故障域 zone 还是归属于原有 cross_zone
|
||||
|
||||
```bash
|
||||
FaultDomain bool // 默认false
|
||||
FaultDomain bool # 默认false
|
||||
```
|
||||
|
||||
### Volume级别配置
|
||||
@ -15,7 +15,7 @@ FaultDomain bool // 默认false
|
||||
保留:
|
||||
|
||||
```bash
|
||||
crossZone bool # 跨zone
|
||||
crossZone bool # 跨zone
|
||||
```
|
||||
|
||||
新增:
|
||||
@ -26,9 +26,9 @@ default_priority bool # true优先选择原有的zone,而不是从故障域
|
||||
|
||||
### 配置小结
|
||||
|
||||
1. 现有的 cluster,无论是自建的,还是社区的,无论是单个 zone,还是跨 zone,如果需要故障域启用,需要 cluster 支持,master 重启,配置更新,同时管控更新现有 volume 的策略。否则继续沿用原有策略。
|
||||
2. 如果 cluster 支持,volume 不选择使用,则继续原有 volume 策略,需要在原有 zone 中按原有策略分配。原有资源耗尽再使用新的 zone 资源,
|
||||
3. 如果 cluster 不支持,volume 无法自己启用的故障域策略
|
||||
1. 对于现有的 cluster,无论是自建的还是社区的,无论是单个 zone 还是跨 zone,如果需要故障域启用,需要 cluster 支持故障域,master 需要重启,配置需要更新,同时管控现有 volume 更新的策略。否则,请继续沿用原有策略。
|
||||
2. 如果 cluster 支持,但 volume 不选择使用,则继续原有 volume 策略,并根据原有策略在原有 zone 中分配资源。原有资源耗尽再使用新的 zone 资源,
|
||||
3. 如果 cluster 不支持,volume 无法启用自己的故障域策略
|
||||
|
||||
| Cluster:faultDomain | Vol:crossZone | Vol:normalZonesFirst | Rules for volume to use domain |
|
||||
|---------------------|---------------|----------------------|-------------------------------------------------------------------------------|
|
||||
@ -39,13 +39,13 @@ default_priority bool # true优先选择原有的zone,而不是从故障域
|
||||
|
||||
## 注意事项
|
||||
|
||||
故障域解决多 zone 场景下 copysets 分布没有规划影响了数据的耐久性的问题,但原有数据不能自动迁移
|
||||
故障域解决了多 zone 场景下 copysets 分布没有规划的问题,保证了数据的耐久性,但原有数据不能自动迁移。
|
||||
|
||||
1.启用故障域后,新区域中的所有设备都将加入故障域
|
||||
1. 启用故障域后,新区域中的所有设备都将加入故障域
|
||||
|
||||
2.创建的 volume 会优先选择原 zone 的资源
|
||||
2. 创建的 volume 会优先选择原 zone 的资源
|
||||
|
||||
3.新建卷时需要根据上表添加配置项使用域资源。默认情况下,如果可用,则首先使用原始 zone 资源
|
||||
3. 新建卷时需要根据上表添加配置项使用域资源。默认情况下,如果可用,则首先使用原始 zone 资源
|
||||
|
||||
## 管理命令
|
||||
|
||||
|
||||
@ -9,10 +9,10 @@ curl -H "Content-Type:application/json" -X POST --data '{"id":"testuser","pwd":"
|
||||
在集群中创建用户,用于访问对象存储功能。
|
||||
|
||||
::: tip 提示
|
||||
在集群启动时,会自动创建 root 用户(type 值为`0x1`)。
|
||||
在集群启动时,会自动创建 root 用户(type 值为`0x1`)
|
||||
:::
|
||||
|
||||
CubeFS 将卷的 **Owner** 字段看作一个用户 ID。例如,创建卷时 Owner 取值为 *testuser* 的话,则该卷自动归为用户 *testuser* 的名下。
|
||||
CubeFS 将卷的 `Owner` 字段看作一个用户 ID。例如,创建卷时 Owner 取值为 `testuser` 的话,则该卷自动归为用户 `testuser` 的名下。
|
||||
|
||||
如果创建卷时不存在与 Owner 取值相同的用户 ID,则创建卷时会自动创建用户 ID 取值为 Owner 的用户。
|
||||
|
||||
@ -21,10 +21,10 @@ CubeFS 将卷的 **Owner** 字段看作一个用户 ID。例如,创建卷时 O
|
||||
| 参数 | 类型 | 描述 | 取值范围 | 必需 | 默认值 |
|
||||
|------|--------|---------------------|-----------------------|-----|--------------|
|
||||
| id | string | 用户 ID | 由字母、数字及下划线组成,不超过21个字符 | 是 | 无 |
|
||||
| pwd | string | 用户密码 | 无限制 | 否 | `CubeFSUser` |
|
||||
| pwd | string | 用户密码 | 无限制 | 否 | CubeFSUser |
|
||||
| ak | string | 用于对象存储功能的 Access Key | 由16位字母及数字组成 | 否 | 系统随机生成 |
|
||||
| sk | string | 用于对象存储功能的 Secret Key | 由32位字母及数字组成 | 否 | 系统随机生成 |
|
||||
| type | int | 用户类型 | 2(管理员)/3(普通用户) | 是 | 无 |
|
||||
| type | int | 用户类型 | 2(管理员)/ 3(普通用户) | 是 | 无 |
|
||||
|
||||
## 删除用户
|
||||
|
||||
@ -44,8 +44,8 @@ curl -v "http://10.196.59.198:17010/user/delete?user=testuser"
|
||||
|
||||
展示的用户基本信息,包括用户 `ID`、`Access Key`、`Secret Key`、名下的卷列表、其他用户授予的权限列表、用户类型、创建时间等。
|
||||
|
||||
用户信息中 **policy** 字段表示该用户拥有权限的卷,其中 **own_vols**
|
||||
表示所有者是该用户的卷, **authorized_vols**
|
||||
用户信息中 `policy` 字段表示该用户拥有权限的卷,其中 `own_vols`
|
||||
表示所有者是该用户的卷, `authorized_vols`
|
||||
表示其他用户授权给该用户的卷,及所拥有的权限限制。
|
||||
|
||||
有以下两种方式获取:
|
||||
@ -136,8 +136,8 @@ curl -H "Content-Type:application/json" -X POST --data '{"user_id":"testuser","v
|
||||
更新指定用户对于某个卷的访问权限。 **policy** 的取值有三类:
|
||||
|
||||
- 授予只读或读写权限,取值为 `perm:builtin:ReadOnly` 或 `perm:builtin:Writable`
|
||||
- 授予指定操作的权限,格式为 `action:oss:XXX` ,以 *GetObject*操作为例,policy取值为 **action:oss:GetObject**
|
||||
- 授予自定义权限,格式为 `perm:custom:XXX` ,其中 *XXX* 由用户自定义
|
||||
- 授予指定操作的权限,格式为 `action:oss:XXX` ,以 `GetObject` 操作为例,policy 取值为 `action:oss:GetObject`
|
||||
- 授予自定义权限,格式为 `perm:custom:XXX` ,其中 XXX 由用户自定义
|
||||
|
||||
指定权限后,用户在使用对象存储功能时,仅能在指定权限范围内对卷进行访问。
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ curl -v "http://10.196.59.198:17010/admin/createVol?name=test&capacity=100&owner
|
||||
在创建新卷时,默认分配10个数据分片和3个元数据分片。
|
||||
|
||||
CubeFS以 **Owner** 参数作为用户ID。
|
||||
- 在创建卷时,如果集群中没有与该卷的 Owner 同名的用户时,会自动创建一个用户ID为 Owner 的用户
|
||||
- 在创建卷时,如果集群中没有与该卷的 Owner 同名的用户,会自动创建一个用户 ID 为 Owner 的用户
|
||||
- 如果集群中已存在用户 ID 为 Owner 的用户,则会自动将该卷的所有权归属于该用户。
|
||||
|
||||
详情参阅:[用戶说明](./user.md)
|
||||
@ -20,13 +20,13 @@ CubeFS以 **Owner** 参数作为用户ID。
|
||||
| 参数 | 类型 | 描述 | 必需 | 默认值 |
|
||||
|------------------|--------|---------------------------------------------------------------------------|-----|------------------------------------------------|
|
||||
| name | string | 卷名称 | 是 | 无 |
|
||||
| volType | int | 卷类型:0:副本卷,1:纠删码卷 | 否 | 0 |
|
||||
| capacity | int | 卷的配额,单位是GB | 是 | 无 |
|
||||
| volType | int | 卷类型:0-副本卷,1-纠删码卷 | 否 | 0 |
|
||||
| capacity | int | 卷的配额,单位是GB | 是 | 无 |
|
||||
| owner | string | 卷的所有者,同时也是用户 ID | 是 | 无 |
|
||||
| mpCount | int | 初始化元数据分片个数 | 否 | 3 |
|
||||
| dpCount | int | 初始化数据分片个数 | 否 | 默认10, 最大值200 |
|
||||
| replicaNum | int | 副本数 | 否 | 副本卷默认3(支持1,3),纠删码卷默认1(支持1-16个) |
|
||||
| dpSize | int | 数据分片大小上限,单位GB | 否 | 120 |
|
||||
| dpSize | int | 数据分片大小上限,单位 GB | 否 | 120 |
|
||||
| enablePosixAcl | bool | 是否配置 posix 权限限制 | 否 | false |
|
||||
| followerRead | bool | 允许从 follower 读取数据,纠删码卷默认 true | 否 | false |
|
||||
| crossZone | bool | 是否跨区域,如设为 true,则不能设置 zoneName 参数 | 否 | false |
|
||||
@ -34,13 +34,13 @@ CubeFS以 **Owner** 参数作为用户ID。
|
||||
| zoneName | string | 指定区域 | 否 | 如果 crossZone 设为 false,则默认值为 default |
|
||||
| cacheRuleKey | string | 纠删码卷使用 | 否 | 非空时,匹配该字段的才会写入 cache,空 |
|
||||
| ebsBlkSize | int | 每个块的大小,单位 byte | 否 | 默认8M |
|
||||
| cacheCap | int | 纠删码卷 cache 容量的大小,单位GB | 否 | 纠删码卷开启缓存必填 |
|
||||
| cacheCap | int | 纠删码卷 cache 容量的大小,单位 GB | 否 | 纠删码卷开启缓存必填 |
|
||||
| cacheAction | int | 纠删码卷写 cache 的场景,0-不写 cache, 1-读数据回写 cache, 2-读写数据都写到 cache | 否 | 0 |
|
||||
| cacheThreshold | int | 纠删码卷小于该值时,才写入到 cache 中,单位 byte | 否 | 默认10M |
|
||||
| cacheTTL | int | 纠删码卷 cache 淘汰时间,单位天 | 否 | 默认30 |
|
||||
| cacheThreshold | int | 纠删码卷小于该值时,才写入到 cache 中,单位 byte | 否 | 默认10M |
|
||||
| cacheTTL | int | 纠删码卷 cache 淘汰时间,单位 天 | 否 | 默认30 |
|
||||
| cacheHighWater | int | 纠删码卷 cache 淘汰的阈值,dp 内容量淘汰上水位,达到该值时,触发淘汰 | 否 | 默认80,即120G*80/100=96G时,dp开始淘汰数据 |
|
||||
| cacheLowWater | int | dp 上容量淘汰下水位,达到该值时,不再淘汰, | 否 | 默认60,即120G*60/100=72G,dp不再淘汰数据 |
|
||||
| cacheLRUInterval | int | 低容量淘汰检测周期,单位分钟 | 否 | 默认5分钟 |
|
||||
| cacheLowWater | int | dp 上容量淘汰下水位,达到该值时,不再淘汰 | 否 | 默认60,即120G*60/100=72G,dp不再淘汰数据 |
|
||||
| cacheLRUInterval | int | 低容量淘汰检测周期,单位 分钟 | 否 | 默认5分钟 |
|
||||
|
||||
## 删除
|
||||
|
||||
@ -48,7 +48,7 @@ CubeFS以 **Owner** 参数作为用户ID。
|
||||
curl -v "http://10.196.59.198:17010/vol/delete?name=test&authKey=md5(owner)"
|
||||
```
|
||||
|
||||
首先把卷标记为逻辑删除(status 设为1),然后通过周期性任务删除所有数据分片和元数据分片,最终从持久化存储中删除。
|
||||
首先把卷标记为逻辑删除(status 设为1),然后通过周期性任务删除所有数据分片和元数据分片,最终从持久化存储中删除。
|
||||
|
||||
::: warning 注意
|
||||
1. 纠删码卷使用大小为0时才能删除;
|
||||
@ -62,7 +62,7 @@ curl -v "http://10.196.59.198:17010/vol/delete?name=test&authKey=md5(owner)"
|
||||
| 参数 | 类型 | 描述 |
|
||||
|---------|--------|------------------------------------------|
|
||||
| name | string | 卷名称 |
|
||||
| authKey | string | 计算 vol 的所有者字段的32位MD5值作为认证信息 |
|
||||
| authKey | string | 计算 vol 的所有者字段的32位 MD5 值作为认证信息 |
|
||||
|
||||
|
||||
## 查询卷详细信息
|
||||
@ -202,7 +202,7 @@ curl -v http://10.196.59.198:17010/client/volStat?name=test
|
||||
| 参数 | 类型 | 描述 |
|
||||
|---------|--------|------------------------------------------------------|
|
||||
| name | string | 卷名称 |
|
||||
| version | int | 卷版本,0:副本卷, 1:ec-卷,默认0-副本卷,访问纠删码卷必填 |
|
||||
| version | int | 卷版本:0-副本卷,1-ec-卷。默认0-副本卷,访问纠删码卷必填 |
|
||||
|
||||
响应示例
|
||||
|
||||
@ -240,10 +240,10 @@ curl -v "http://10.196.59.198:17010/vol/update?name=test&capacity=100&authKey=md
|
||||
| followerRead | bool | 允许从 follower 读取数据,若设置为 true,客户端也需配置该字段为 true | 否 |
|
||||
| enablePosixAcl | bool | 是否配置 posix 权限限制 | 否 |
|
||||
| emptyCacheRule | string | 是否置空 cacheRule | 否 |
|
||||
| cacheRuleKey | string | 缓存规则,纠删码卷使用,满足对应规则的才缓存 | 否 |
|
||||
| cacheRuleKey | string | 缓存规则,纠删码卷使用,满足对应规则的才缓存 | 否 |
|
||||
| ebsBlkSize | int | 纠删码卷的每个块的大小 | 否 |
|
||||
| cacheCap | int | 纠删码卷使用二级 cache 时,cache 的容量大小 | 否 |
|
||||
| cacheAction | int | 纠删码卷使用,0:不写 cache, 1-读数据写 cache, 2-读写数据都写到 cache | 否 |
|
||||
| cacheAction | int | 纠删码卷使用,0-不写 cache, 1-读数据写 cache, 2-读写数据都写到 cache | 否 |
|
||||
| cacheThreshold | int | 缓存文件大小限制,纠删码卷小于该值时,才会写到 cache 当中 | 否 |
|
||||
| cacheTTL | int | 缓存过期时间,单位天 | 否 |
|
||||
| cacheHighWater | int | 淘汰高水位 | 否 |
|
||||
@ -348,17 +348,17 @@ curl -v "http://127.0.0.1:17010/vol/setTrashInterval?name=test&authKey=trashInte
|
||||
| 参数 | 类型 | 描述 | 必需 |
|
||||
|----------|--------|---------------------------|-----|
|
||||
| name | string | 卷名称 | 是 |
|
||||
| authKey | string | 计算vol的所有者字段的32位MD5值作为认证信息 | 是 |
|
||||
| authKey | string | 计算vol的所有者字段的32位 MD5 值作为认证信息 | 是 |
|
||||
| trashInterval | int | 回收站清理过期数据的时间间隔,单位分钟。0关闭回收站,其他正值开启回收站 | 是
|
||||
|
||||
## 两副本
|
||||
|
||||
### 主要事项
|
||||
|
||||
两个副本可以正常支持修改和写入(使用其他dp及其范围)
|
||||
两个副本可以正常支持修改和写入(使用其他 dp 及其范围)
|
||||
|
||||
1. 支持已创建的3副本卷设置2副本,并在创建新dp生效,但不包括老的dp。
|
||||
2. 两副本卷有一个副本崩溃然后没有 leader 的情况下,使用 raftForceDel 参数删除异常副本。
|
||||
1. 支持已创建的3副本卷设置2副本,并在创建新 dp 生效,但不包括老的 dp。
|
||||
2. 两副本卷有一个副本崩溃然后没有 leader 的情况下,使用 `raftForceDel` 参数删除异常副本。
|
||||
|
||||
### 异常场景处理
|
||||
|
||||
@ -366,18 +366,12 @@ curl -v "http://127.0.0.1:17010/vol/setTrashInterval?name=test&authKey=trashInte
|
||||
|
||||
**两副本迁移的异常场景**
|
||||
|
||||
迁移目标是C,我们实现的过程是先添加副本C,然后删除源A,迁移过程B crash
|
||||
|
||||
**解决方式**:
|
||||
|
||||
迁移目标是C,我们实现的过程是先添加副本C,然后删除源A,迁移过程B crash。**解决方式**:
|
||||
如果 B crash了,raft 不可用,先删除B,等待迁移完成,删除A,再添加一个副本
|
||||
|
||||
**正常运营过程某一个副本crash,例如B**
|
||||
|
||||
没有 leader,根据 raft 规则两副本不能删除B的,因为需要先 commit,然后 apply,但 commit 的条件是大多数存活。
|
||||
|
||||
**解决方式**:
|
||||
|
||||
没有 leader,根据 raft 规则两副本不能删除B的,因为需要先 commit,然后 apply,但 commit 的条件是大多数存活。**解决方式**:
|
||||
强制删除B
|
||||
|
||||
::: danger 警告
|
||||
@ -406,7 +400,7 @@ curl "http://127.0.0.1:17010/dataReplica/delete?raftForceDel=true&addr=127.0.0.1
|
||||
- 存量的数据只读(建议批量脚本执行)
|
||||
|
||||
``` bash
|
||||
curl -v "http://192.168.0.13:17010/admin/setDpRdOnly?id=**&rdOnly=true
|
||||
curl -v "http://192.168.0.13:17010/admin/setDpRdOnly?id=**&rdOnly=true"
|
||||
```
|
||||
|
||||
- 更新卷副本数量,更新后3副本分区会异步降低为2副本
|
||||
@ -440,9 +434,8 @@ curl "10.86.180.77:17010/dataReplica/delete?raftForceDel=true&addr=10.33.64.33:1
|
||||
- 创建卷时启用QOS:
|
||||
|
||||
``` bash
|
||||
curl -v "http://192.168.0.11:17010/admin/createVol?name=volName&capacity=100&owner=cfs&qosEnable=true&flowWKey=10000"
|
||||
|
||||
# 启用qos,写流量设置为10000MB
|
||||
curl -v "http://192.168.0.11:17010/admin/createVol?name=volName&capacity=100&owner=cfs&qosEnable=true&flowWKey=10000"
|
||||
```
|
||||
|
||||
- 获取卷的流量情况:
|
||||
@ -464,8 +457,8 @@ curl "http://192.168.0.11:17010/qos/update?name=ltptest&qosEnable=true&flowWKey
|
||||
```
|
||||
|
||||
涉及字段包括:
|
||||
- `FlowWKey = "flowWKey"` //写(卷)
|
||||
- `FlowRKey = "flowRKey"` //读(卷)
|
||||
- `FlowWKey = "flowWKey"` 写(卷)
|
||||
- `FlowRKey = "flowRKey"` 读(卷)
|
||||
|
||||
### 一些系统参数说明
|
||||
|
||||
@ -473,7 +466,7 @@ curl "http://192.168.0.11:17010/qos/update?name=ltptest&qosEnable=true&flowWKey
|
||||
|
||||
无论是 client 端还是 datanode 端,目前流量都是 MB 为单位
|
||||
|
||||
2. 最低参数流量和io,作用于 datanode 和 volume 的设置,如果设置值,则需要保证一下要求,否则报错
|
||||
2. 最低参数流量和 io,作用于 datanode 和 volume 的设置,如果设置值,则需要保证一下要求,否则报错
|
||||
- `MinFlowLimit = 100 * util.MB`
|
||||
- `MinIoLimit = 100`
|
||||
|
||||
@ -485,9 +478,9 @@ curl "http://192.168.0.11:17010/qos/update?name=ltptest&qosEnable=true&flowWKey
|
||||
|
||||
### Client 和 Master通信
|
||||
|
||||
1. Client 长时间收不到Master的流量控制,日志会 warn 出来
|
||||
1. Client 长时间收不到 Master 的流量控制,日志会 warn 出来
|
||||
2. Client 和 Master 无法不通讯,会维持原有流量限制,也会 warn 出来
|
||||
3. 流量长时间为0则不会主动请求 Master 流量,不上报给 Master,减少通信请求。Master 会清理长时间不上报客户端信息。
|
||||
3. 流量长时间为 0 则不会主动请求 Master 流量,不上报给 Master,减少通信请求。Master 会清理长时间不上报客户端信息。
|
||||
|
||||
### 冷卷
|
||||
|
||||
|
||||
@ -3,33 +3,33 @@
|
||||
## 获取 Dentry 信息
|
||||
|
||||
``` bash
|
||||
curl -v 'http://10.196.59.202:17220/getDentry?pid=100&name="aa.txt"&parentIno=1024'
|
||||
curl -v "http://10.196.59.202:17220/getDentry?pid=100&name="aa.txt"&parentIno=1024"
|
||||
```
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|---------|---------------------------|
|
||||
| pid | integer | meta partition id |
|
||||
| name | string | directory or file name |
|
||||
| parentIno | integer | parent directory inode id |
|
||||
| pid | int | 元数据分片 ID |
|
||||
| name | string | 目录或文件名 |
|
||||
| parentIno | int | 父目录 inode id |
|
||||
|
||||
## 获取指定目录下全部文件
|
||||
|
||||
``` bash
|
||||
curl -v 'http://10.196.59.202:17220/getDirectory?pid=100&parentIno=1024'
|
||||
curl -v "http://10.196.59.202:17220/getDirectory?pid=100&parentIno=1024"
|
||||
```
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|---------|--------------|
|
||||
| pid | integer | partition id |
|
||||
| ino | integer | inode id |
|
||||
| pid | int | 元数据分片 ID |
|
||||
| ino | int | inode ID |
|
||||
|
||||
|
||||
## 获取指定分片的全部目录信息
|
||||
|
||||
``` bash
|
||||
curl -v 'http://10.196.59.202:17220/getAllDentry?pid=100'
|
||||
curl -v "http://10.196.59.202:17220/getAllDentry?pid=100"
|
||||
```
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|---------|--------------|
|
||||
| pid | integer | partition id |
|
||||
| pid | integer | 元数据分片 ID |
|
||||
|
||||
@ -3,50 +3,50 @@
|
||||
## 获取指定 Inode 基本信息
|
||||
|
||||
``` bash
|
||||
curl -v http://192.168.0.22:17220/getInode?pid=100&ino=1024
|
||||
curl -v "http://192.168.0.22:17220/getInode?pid=1&ino=1024"
|
||||
```
|
||||
|
||||
请求参数:
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|-----|-----|----------|
|
||||
| pid | 整型 | 分片 id |
|
||||
| ino | 整型 | inode id |
|
||||
| pid | int | 分片 id |
|
||||
| ino | int | inode id |
|
||||
|
||||
## 获取指定 Inode 的数据存储信息
|
||||
|
||||
``` bash
|
||||
curl -v http://192.168.0.22:17220/getExtentsByInode?pid=100&ino=1024
|
||||
curl -v "http://192.168.0.22:17220/getExtentsByInode?pid=1&ino=1024"
|
||||
```
|
||||
|
||||
请求参数:
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|-----|-----|----------|
|
||||
| pid | 整型 | 分片 id |
|
||||
| ino | 整型 | inode id |
|
||||
| pid | int | 分片 id |
|
||||
| ino | int | inode id |
|
||||
|
||||
## 获取指定元数据分片的全部 inode 信息
|
||||
|
||||
``` bash
|
||||
curl -v http://192.168.0.22:17220/getAllInodes?pid=100
|
||||
curl -v "http://192.168.0.22:17220/getAllInodes?pid=1"
|
||||
```
|
||||
|
||||
请求参数:
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|-----|-----|-------|
|
||||
| pid | 整型 | 分片 id |
|
||||
| pid | int | 分片 id |
|
||||
|
||||
## 获取inode上的ebs分片信息
|
||||
|
||||
``` bash
|
||||
curl -v '192.168.0.22:17220/getEbsExtentsByInode?pid=282&ino=16797167'
|
||||
curl -v "192.168.0.22:17220/getEbsExtentsByInode?pid=282&ino=16797167"
|
||||
```
|
||||
|
||||
请求参数:
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|-----|-----|----------|
|
||||
| pid | 整型 | 分片 id |
|
||||
| ino | 整型 | inode id |
|
||||
| pid | int | 分片 id |
|
||||
| ino | int | inode id |
|
||||
@ -3,13 +3,13 @@
|
||||
## 获取当前设备上所有分片信息
|
||||
|
||||
``` bash
|
||||
curl -v http://10.196.59.202:17210/getPartitions
|
||||
curl -v "http://10.196.59.202:17220/getPartitions"
|
||||
```
|
||||
|
||||
## 获取指定分片 ID 的当前状态信息
|
||||
|
||||
``` bash
|
||||
curl -v http://10.196.59.202:17210/getPartitionById?pid=100
|
||||
curl -v "http://10.196.59.202:17220/getPartitionById?pid=100"
|
||||
```
|
||||
|
||||
获取指定分片 id 的当前状态信息,包含当前分片组的 raft
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
Enabling fault domains requires adding cluster-level configuration, otherwise it cannot be distinguished. Adding a new zone is a fault domain zone or belongs to the original cross_zone.
|
||||
|
||||
```bash
|
||||
FaultDomain bool // Default is false
|
||||
FaultDomain bool # Default is false
|
||||
```
|
||||
|
||||
### Volume-level Configuration
|
||||
@ -15,7 +15,7 @@ FaultDomain bool // Default is false
|
||||
Reserved:
|
||||
|
||||
```bash
|
||||
crossZone bool # Cross-zone
|
||||
crossZone bool # Cross-zone
|
||||
```
|
||||
|
||||
New:
|
||||
|
||||
@ -12,7 +12,7 @@ Creates a user in the cluster for accessing object storage.
|
||||
When the cluster starts, the root user (type value is `0x1`) is automatically created.
|
||||
:::
|
||||
|
||||
CubeFS regards the **Owner** field of a volume as a user ID. For example, if the Owner value is *testuser* when creating a volume, the volume is automatically assigned to the user *testuser*.
|
||||
CubeFS regards the `Owner` field of a volume as a user ID. For example, if the Owner value is `testuser` when creating a volume, the volume is automatically assigned to the user `testuser`.
|
||||
|
||||
If there is no user ID with the same value as Owner when creating a volume, a user ID with the value of Owner is automatically created when creating the volume.
|
||||
|
||||
@ -21,7 +21,7 @@ Parameter List
|
||||
| Parameter | Type | Description | Value Range | Required | Default Value |
|
||||
|-----------|--------|-------------------------------|----------------------------------------------------------------------------------|----------|------------------|
|
||||
| id | string | User ID | Consists of letters, numbers, and underscores, and does not exceed 21 characters | Yes | None |
|
||||
| pwd | string | User password | No restrictions | No | `CubeFSUser` |
|
||||
| pwd | string | User password | No restrictions | No | CubeFSUser |
|
||||
| ak | string | Access Key for object storage | Consists of 16 letters and numbers | No | System-generated |
|
||||
| sk | string | Secret Key for object storage | Consists of 32 letters and numbers | No | System-generated |
|
||||
| type | int | User type | 2 (administrator)/3 (ordinary user) | Yes | None |
|
||||
@ -44,7 +44,7 @@ Parameter List
|
||||
|
||||
Displays basic user information, including user `ID`, `Access Key`, `Secret Key`, list of volumes owned by the user, list of permissions granted by other users, user type, creation time, etc.
|
||||
|
||||
The **policy** field in the user information indicates the volumes for which the user has permissions. The **own_vols** field indicates the volumes whose owner is the user, and the **authorized_vols** field indicates the volumes authorized by other users and the permission restrictions they have.
|
||||
The `policy` field in the user information indicates the volumes for which the user has permissions. The `own_vols` field indicates the volumes whose owner is the user, and the `authorized_vols` field indicates the volumes authorized by other users and the permission restrictions they have.
|
||||
|
||||
There are two ways to obtain user information:
|
||||
|
||||
@ -133,8 +133,8 @@ curl -H "Content-Type:application/json" -X POST --data '{"user_id":"testuser","v
|
||||
Updates the access permissions of a specified user for a certain volume. The value of **policy** can be one of the following:
|
||||
|
||||
- Read-only or read-write permission, with a value of `perm:builtin:ReadOnly` or `perm:builtin:Writable`
|
||||
- Permission for a specified operation, in the format of `action:oss:XXX`. For example, for the *GetObject* operation, the policy value is **action:oss:GetObject**
|
||||
- Custom permission, in the format of `perm:custom:XXX`, where *XXX* is defined by the user.
|
||||
- Permission for a specified operation, in the format of `action:oss:XXX`. For example, for the `GetObject` operation, the policy value is `action:oss:GetObject`
|
||||
- Custom permission, in the format of `perm:custom:XXX`, where XXX is defined by the user.
|
||||
|
||||
After specifying the permissions, the user can only access the volume within the specified permission range when using the object storage function.
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
# Volume Management
|
||||
|
||||
## Create
|
||||
|
||||
|
||||
``` bash
|
||||
curl -v "http://10.196.59.198:17010/admin/createVol?name=test&capacity=100&owner=cfs&mpCount=3"
|
||||
```
|
||||
|
||||
Create a volume for the user and allocate a set of data shards and metadata shards. By default, when creating a new volume, 10 data shards and 3 metadata shards are allocated.
|
||||
Create a volume for the user and allocate a set of data shards and metadata shards.By default, when creating a new volume, 10 data shards and 3 metadata shards are allocated.
|
||||
|
||||
CubeFS uses the **Owner** parameter as the user ID.
|
||||
- When creating a volume, if there is no user with the same name as the Owner of the volume in the cluster, a user with the ID Owner will be created automatically.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
## Obtaining Dentry Information
|
||||
|
||||
``` bash
|
||||
curl -v 'http://10.196.59.202:17210/getDentry?pid=100&name="aa.txt"&parentIno=1024'
|
||||
curl -v "http://10.196.59.202:17210/getDentry?pid=100&name="aa.txt"&parentIno=1024"
|
||||
```
|
||||
|
||||
| Parameter | Type | Description |
|
||||
@ -15,7 +15,7 @@ curl -v 'http://10.196.59.202:17210/getDentry?pid=100&name="aa.txt"&parentIno=10
|
||||
## Obtaining All Files in a Specified Directory
|
||||
|
||||
``` bash
|
||||
curl -v 'http://10.196.59.202:17210/getDirectory?pid=100&parentIno=1024'
|
||||
curl -v "http://10.196.59.202:17210/getDirectory?pid=100&parentIno=1024"
|
||||
```
|
||||
|
||||
| Parameter | Type | Description |
|
||||
@ -27,7 +27,7 @@ curl -v 'http://10.196.59.202:17210/getDirectory?pid=100&parentIno=1024'
|
||||
## Obtaining All Directory Information for a Specified Shard
|
||||
|
||||
``` bash
|
||||
curl -v 'http://10.196.59.202:17210/getAllDentry?pid=100'
|
||||
curl -v "http://10.196.59.202:17210/getAllDentry?pid=100"
|
||||
```
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
## Obtaining Basic Information for a Specified Inode
|
||||
|
||||
``` bash
|
||||
curl -v http://192.168.0.22:17220/getInode?pid=100&ino=1024
|
||||
curl -v "http://192.168.0.22:17220/getInode?pid=1&ino=1024"
|
||||
```
|
||||
|
||||
Request Parameters:
|
||||
@ -16,7 +16,7 @@ Request Parameters:
|
||||
## Obtaining Data Storage Information for a Specified Inode
|
||||
|
||||
``` bash
|
||||
curl -v http://192.168.0.22:17220/getExtentsByInode?pid=100&ino=1024
|
||||
curl -v "http://192.168.0.22:17220/getExtentsByInode?pid=1&ino=1024"
|
||||
```
|
||||
|
||||
Request Parameters:
|
||||
@ -29,7 +29,7 @@ Request Parameters:
|
||||
## Obtaining All Inode Information for a Specified Metadata Shard
|
||||
|
||||
``` bash
|
||||
curl -v http://192.168.0.22:17220/getAllInodes?pid=100
|
||||
curl -v "http://192.168.0.22:17220/getAllInodes?pid=1"
|
||||
```
|
||||
|
||||
Request Parameters:
|
||||
@ -41,7 +41,7 @@ Request Parameters:
|
||||
## Obtaining EBS Shard Information for an Inode
|
||||
|
||||
``` bash
|
||||
curl -v '192.168.0.22:17220/getEbsExtentsByInode?pid=282&ino=16797167'
|
||||
curl -v "192.168.0.22:17220/getEbsExtentsByInode?pid=282&ino=16797167"
|
||||
```
|
||||
|
||||
Request Parameters:
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
## Obtaining Information for All Shards on the Current Device
|
||||
|
||||
``` bash
|
||||
curl -v http://10.196.59.202:17210/getPartitions
|
||||
curl -v "http://10.196.59.202:17220/getPartitions"
|
||||
```
|
||||
|
||||
## Obtaining Current Status Information for a Specified Shard ID
|
||||
|
||||
``` bash
|
||||
curl -v http://10.196.59.202:17210/getPartitionById?pid=100
|
||||
curl -v "http://10.196.59.202:17220/getPartitionById?pid=100"
|
||||
```
|
||||
|
||||
Obtains current status information for a specified shard ID, including the raft leader address for the current shard group, the raft group members, and the inode allocation cursor.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user