跳到主要内容

命令行工具

Curve 命令行工具代码仓库地址:https://github.com/opencurve/curve/blob/master/tools-v2/README.md

工具目前还在继续开发完善之中,欢迎提交issue或pr。

How to use curve tool

Install

install curve tool

wget https://curve-tool.nos-eastchina1.126.net/release/curve-latest
chmod +x curve-latest
mv curve-latest /usr/bin/curve

set configure file

wget https://raw.githubusercontent.com/opencurve/curve/master/tools-v2/pkg/config/curve.yaml

or

wget https://curve-tool.nos-eastchina1.126.net/config/curve.yaml

Please modify the mdsAddr, mdsDummyAddr, etcdAddr under curvefs/bs in the template.yaml file as required

mv curve.yaml ~/.curve/curve.yaml

or

mv curve.yaml /etc/curve/curve.yaml

Introduction

Here's how to use the tool

curve COMMAND [options]

When you are not sure how to use a command, --help can give you an example of use:

curve COMMAND --help

For example:

curve fs status mds --help
Usage: curve fs status mds [flags]

get the inode usage of curvefs

Flags:
-c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
-f, --format string Output format (json|plain) (default "plain")
-h, --help Print usage
--httptimeout duration http timeout (default 500ms)
--mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
--mdsdummyaddr string mds dummy address, should be like 127.0.0.1:7700,127.0.0.1:7701,127.0.0.1:7702
--showerror display all errors in command

Examples:
$ curve fs status mds

In addition, this tool reads the configuration from $HOME/.curve/curve.yaml or /etc/curve/curve.yaml by default, and can be specified by --conf or -c.

Command

version

show the version of curve tool

Usage:

curve --version

Output:

curve v1.2

completion

generate curve bash/zsh/fish completion script

Take bash as an example:

curve completion bash > /etc/bash_completion.d/curve

If you perform completion you get the following error:

curve [tab]bash: _get_comp_words_by_ref: command not found

You need to install bash-completion:

sudo apt install bash-completion
source /usr/share/bash-completion/bash_completion

upgrade

Upgrade curve to latest version

Usage:

curve upgrade

If you want to upgrade to the specified version(ee500438):

CURVE_VERSION=ee500438 curve upgrade

If you are in an offline environment, you can also set up a temporary http server to provide upgrade services for other machines:

# 192.168.1.1
echo "123456" > __version
cp curve curve-123456
python3 -m http.server 1234

In this way, it can be upgraded on other machines

CURVE_BASE_URL=http://192.168.1.1:1234/ curve upgrade

fs

check

check copyset

check copysets health in curvefs

Usage:

curve fs check copyset --copysetid 1 --poolid 1

Output:

+------------+-----------+--------+--------+---------+
| COPYSETKEY | COPYSETID | POOLID | STATUS | EXPLAIN |
+------------+-----------+--------+--------+---------+
| 4294967297 | 1 | 1 | ok | |
+------------+-----------+--------+--------+---------+

create

create fs

create a fs in curvefs

Usage:

curve fs create fs --fsname test3

Output:

+--------+-------------------------------------------+
| FSNAME | RESULT |
+--------+-------------------------------------------+
| test3 | fs exist, but s3 info is not inconsistent |
+--------+-------------------------------------------+
create topology

create curvefs topology

Usage:

curve fs create topology --clustermap topology.json

Output:

+-------------------+--------+-----------+--------+
| NAME | TYPE | OPERATION | PARENT |
+-------------------+--------+-----------+--------+
| pool2 | pool | del | |
+-------------------+--------+ +--------+
| zone4 | zone | | pool2 |
+-------------------+--------+ +--------+
| **.***.***.**_3_0 | server | | zone4 |
+-------------------+--------+-----------+--------+

delete

delete fs

delete a fs from curvefs

Usage:

curve fs delete fs --fsname test1
WARNING:Are you sure to delete fs test1?
please input [test1] to confirm: test1

Output:

+--------+-------------------------------------+
| FSNAME | RESULT |
+--------+-------------------------------------+
| test1 | delete fs failed!, error is FS_BUSY |
+--------+-------------------------------------+

list

list copyset

list all copyset info of the curvefs

Usage:

curve fs list copyset

Output:

+------------+-----------+--------+-------+--------------------------------+------------+
| KEY | COPYSETID | POOLID | EPOCH | LEADERPEER | PEERNUMBER |
+------------+-----------+--------+-------+--------------------------------+------------+
| 4294967302 | 6 | 1 | 2 | id:1 | 3 |
| | | | | address:"**.***.***.**:6801:0" | |
+------------+-----------+ +-------+ +------------+
| 4294967303 | 7 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+ +------------+
| 4294967304 | 8 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+ +------------+
| 4294967307 | 11 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+--------------------------------+------------+
| 4294967297 | 1 | | 1 | id:2 | 3 |
| | | | | address:"**.***.***.**:6802:0" | |
+------------+-----------+ +-------+ +------------+
| 4294967301 | 5 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+ +------------+
| 4294967308 | 12 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+--------------------------------+------------+
| 4294967298 | 2 | | 1 | id:3 | 3 |
| | | | | address:"**.***.***.**:6800:0" | |
+------------+-----------+ +-------+ +------------+
| 4294967299 | 3 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+ +------------+
| 4294967300 | 4 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+ +------------+
| 4294967305 | 9 | | 1 | | 3 |
| | | | | | |
+------------+-----------+ +-------+ +------------+
| 4294967306 | 10 | | 1 | | 3 |
| | | | | | |
+------------+-----------+--------+-------+--------------------------------+------------+
list fs

list all fs info in the curvefs

Usage:

curve fs list fs

Output:

+----+-------+--------+--------------+-----------+---------+----------+-----------+----------+
| ID | NAME | STATUS | CAPACITY | BLOCKSIZE | FSTYPE | SUMINDIR | OWNER | MOUNTNUM |
+----+-------+--------+--------------+-----------+---------+----------+-----------+----------+
| 2 | test1 | INITED | 107374182400 | 1048576 | TYPE_S3 | false | anonymous | 1 |
+----+-------+--------+--------------+-----------+ +----------+ +----------+
| 3 | test3 | INITED | 107374182400 | 1048576 | | false | | 0 |
+----+-------+--------+--------------+-----------+---------+----------+-----------+----------+
list mountpoint

list all mountpoint of the curvefs

Usage:

curve fs list mountpoint

Output:

+------+--------+-------------------------------------------------------------------+
| FSID | FSNAME | MOUNTPOINT |
+------+--------+-------------------------------------------------------------------+
| 2 | test1 | siku-QiTianM420-N000:9002:/curvefs/client/mnt/home/siku/temp/mnt1 |
+ + +-------------------------------------------------------------------+
| | | siku-QiTianM420-N000:9003:/curvefs/client/mnt/home/siku/temp/mnt2 |
+------+--------+-------------------------------------------------------------------+
list partition

list partition in curvefs by fsid

Usage:

curve fs list partition

Output:

+-------------+------+--------+-----------+----------+----------+-----------+
| PARTITIONID | FSID | POOLID | COPYSETID | START | END | STATUS |
+-------------+------+--------+-----------+----------+----------+-----------+
| 14 | 2 | 1 | 10 | 1048676 | 2097351 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 20 | | | | 7340732 | 8389407 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 13 | | | 11 | 0 | 1048675 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 16 | | | | 3146028 | 4194703 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 22 | | | | 9438084 | 10486759 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 21 | | | 5 | 8389408 | 9438083 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 23 | | | 7 | 10486760 | 11535435 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 24 | | | | 11535436 | 12584111 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 15 | | | 8 | 2097352 | 3146027 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 18 | | | | 5243380 | 6292055 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 17 | | | 9 | 4194704 | 5243379 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 19 | | | | 6292056 | 7340731 | READWRITE |
+-------------+------+ +-----------+----------+----------+-----------+
| 26 | 3 | | 2 | 1048676 | 2097351 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 30 | | | | 5243380 | 6292055 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 34 | | | 3 | 9438084 | 10486759 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 29 | | | 4 | 4194704 | 5243379 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 32 | | | | 7340732 | 8389407 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 35 | | | 5 | 10486760 | 11535435 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 27 | | | | 2097352 | 3146027 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 33 | | | | 8389408 | 9438083 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 25 | | | 6 | 0 | 1048675 | READWRITE |
+-------------+ + + +----------+----------+-----------+
| 36 | | | | 11535436 | 12584111 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 28 | | | 8 | 3146028 | 4194703 | READWRITE |
+-------------+ + +-----------+----------+----------+-----------+
| 31 | | | 9 | 6292056 | 7340731 | READWRITE |
+-------------+------+--------+-----------+----------+----------+-----------+
list topology

list the topology of the curvefs

Usage:

curve fs list topology

Output:

+----+------------+--------------------+------------+-----------------------+
| ID | TYPE | NAME | CHILDTYPE | CHILDLIST |
+----+------------+--------------------+------------+-----------------------+
| 1 | pool | pool1 | zone | zone3 zone2 zone1 |
+----+------------+--------------------+------------+-----------------------+
| 3 | zone | zone3 | server | **.***.***.**_2_0 |
+----+ +--------------------+ +-----------------------+
| 2 | | zone2 | | **.***.***.**_1_0 |
+----+ +--------------------+ +-----------------------+
| 1 | | zone1 | | **.***.***.**_0_0 |
+----+------------+--------------------+------------+-----------------------+
| 3 | server | **.***.***.**_2_0 | metaserver | curvefs-metaserver.2 |
+----+ +--------------------+ +-----------------------+
| 2 | | **.***.***.**_1_0 | | curvefs-metaserver.1 |
+----+ +--------------------+ +-----------------------+
| 1 | | **.***.***.**_0_0 | | curvefs-metaserver.3 |
+----+------------+--------------------+------------+-----------------------+
| 3 | metaserver | curvefs-metaserver | | |
+----+ +--------------------+------------+-----------------------+
| 2 | | curvefs-metaserver | | |
+----+ +--------------------+------------+-----------------------+
| 1 | | curvefs-metaserver | | |
+----+------------+--------------------+------------+-----------------------+

query

query copyset

query copysets in curvefs

Usage:

curve fs query copyset --copysetid 1 --poolid 1

Output:

+------------+-----------+--------+--------------------------------------+-------+
| copysetKey | copysetId | poolId | leaderPeer | epoch |
+------------+-----------+--------+--------------------------------------+-------+
| 4294967297 | 1 | 1 | id:2 address:"**.***.***.**:6802:0" | 1 |
+------------+-----------+--------+--------------------------------------+-------+
query fs

query fs in curvefs by fsname or fsid

Usage:

curve fs query fs --fsname test1

Output:

+----+-------+--------+--------------+-----------+---------+----------+-----------+----------+
| id | name | status | capacity | blocksize | fsType | sumInDir | owner | mountNum |
+----+-------+--------+--------------+-----------+---------+----------+-----------+----------+
| 2 | test1 | INITED | 107374182400 | 1048576 | TYPE_S3 | false | anonymous | 2 |
+----+-------+--------+--------------+-----------+---------+----------+-----------+----------+
query inode

query the inode of fs

Usage:

curve fs query inode --fsid 2 --inodeid 5243380

Output:

+-------+----------+-----------+---------+-------+--------+
| fs id | inode id | length | type | nlink | parent |
+-------+----------+-----------+---------+-------+--------+
| 2 | 5243380 | 352321536 | TYPE_S3 | 1 | [1] |
+-------+----------+-----------+---------+-------+--------+
query metaserver

query metaserver in curvefs by metaserverid or metaserveraddr

Usage:

curve fs query metaserver --metaserveraddr **.***.***.**:6801,**.***.***.**:6802

Output:

+----+--------------------+--------------------+--------------------+-------------+
| id | hostname | internalAddr | externalAddr | onlineState |
+----+--------------------+--------------------+--------------------+-------------+
| 1 | curvefs-metaserver | **.***.***.**:6801 | **.***.***.**:6801 | ONLINE |
| 2 | curvefs-metaserver | **.***.***.**:6802 | **.***.***.**:6802 | ONLINE |
+----+--------------------+--------------------+--------------------+-------------+
query partition

query the copyset of partition

Usage:

curve fs query partition --partitionid 14

Output:

+----+--------+-----------+--------+----------------------+
| id | poolId | copysetId | peerId | peerAddr |
+----+--------+-----------+--------+----------------------+
| 14 | 1 | 10 | 1 | **.***.***.**:6801:0 |
| 14 | 1 | 10 | 2 | **.***.***.**:6802:0 |
| 14 | 1 | 10 | 3 | **.***.***.**:6800:0 |
+----+--------+-----------+--------+----------------------+

status

status mds

get status of mds

Usage:

curve fs status mds

Output:

+--------------------+--------------------+----------------+----------+
| addr | dummyAddr | version | status |
+--------------------+--------------------+----------------+----------+
| **.***.***.**:6700 | **.***.***.**:7700 | 8fc48476+debug | follower |
| **.***.***.**:6701 | **.***.***.**:7701 | 8fc48476+debug | follower |
| **.***.***.**:6702 | **.***.***.**:7702 | 8fc48476+debug | leader |
+--------------------+--------------------+----------------+----------+
status metaserver

get status of metaserver

Usage:

curve fs status metaserver

Output:

+--------------------+--------------------+----------------+--------+
| externalAddr | internalAddr | version | status |
+--------------------+--------------------+----------------+--------+
| **.***.***.**:6800 | **.***.***.**:6800 | 8fc48476+debug | online |
| **.***.***.**:6802 | **.***.***.**:6802 | 8fc48476+debug | online |
| **.***.***.**:6801 | **.***.***.**:6801 | 8fc48476+debug | online |
+--------------------+--------------------+----------------+--------+
status etcd

get status of etcd

Usage:

curve fs status etcd

Output:

+---------------------+---------+----------+
| addr | version | status |
+---------------------+---------+----------+
| **.***.***.**:23790 | 3.4.10 | follower |
| **.***.***.**:23791 | 3.4.10 | follower |
| **.***.***.**:23792 | 3.4.10 | leader |
+---------------------+---------+----------+
status copyset

get status of copyset

Usage:

curve fs status copyset

Output:

+------------+-----------+--------+--------+---------+
| copysetKey | copysetId | poolId | status | explain |
+------------+-----------+--------+--------+---------+
| 4294967297 | 1 | 1 | ok | |
| 4294967298 | 2 | 1 | ok | |
| 4294967299 | 3 | 1 | ok | |
| 4294967300 | 4 | 1 | ok | |
| 4294967301 | 5 | 1 | ok | |
| 4294967302 | 6 | 1 | ok | |
| 4294967303 | 7 | 1 | ok | |
| 4294967304 | 8 | 1 | ok | |
| 4294967305 | 9 | 1 | ok | |
| 4294967306 | 10 | 1 | ok | |
| 4294967307 | 11 | 1 | ok | |
| 4294967308 | 12 | 1 | ok | |
+------------+-----------+--------+--------+---------+
status cluster

get status of cluster

Usage:

curve fs status cluster

Output:

etcd:
+---------------------+---------+----------+
| addr | version | status |
+---------------------+---------+----------+
| **.***.***.**:23790 | 3.4.10 | follower |
| **.***.***.**:23791 | 3.4.10 | follower |
| **.***.***.**:23792 | 3.4.10 | leader |
+---------------------+---------+----------+

mds:
+--------------------+--------------------+----------------+----------+
| addr | dummyAddr | version | status |
+--------------------+--------------------+----------------+----------+
| **.***.***.**:6700 | **.***.***.**:7700 | 8fc48476+debug | follower |
| **.***.***.**:6701 | **.***.***.**:7701 | 8fc48476+debug | follower |
| **.***.***.**:6702 | **.***.***.**:7702 | 8fc48476+debug | leader |
+--------------------+--------------------+----------------+----------+

meataserver:
+--------------------+--------------------+----------------+--------+
| externalAddr | internalAddr | version | status |
+--------------------+--------------------+----------------+--------+
| **.***.***.**:6800 | **.***.***.**:6800 | 8fc48476+debug | online |
| **.***.***.**:6802 | **.***.***.**:6802 | 8fc48476+debug | online |
| **.***.***.**:6801 | **.***.***.**:6801 | 8fc48476+debug | online |
+--------------------+--------------------+----------------+--------+

copyset:
+------------+-----------+--------+--------+---------+
| copysetKey | copysetId | poolId | status | explain |
+------------+-----------+--------+--------+---------+
| 4294967297 | 1 | 1 | ok | |
| 4294967298 | 2 | 1 | ok | |
| 4294967299 | 3 | 1 | ok | |
| 4294967300 | 4 | 1 | ok | |
| 4294967301 | 5 | 1 | ok | |
| 4294967302 | 6 | 1 | ok | |
| 4294967303 | 7 | 1 | ok | |
| 4294967304 | 8 | 1 | ok | |
| 4294967305 | 9 | 1 | ok | |
| 4294967306 | 10 | 1 | ok | |
| 4294967307 | 11 | 1 | ok | |
| 4294967308 | 12 | 1 | ok | |
+------------+-----------+--------+--------+---------+

Cluster health is: ok

umount

umount fs

umount fs from the curvefs cluster

Usage:

curve fs umount fs --fsname test1 --mountpoint siku-QiTianM420-N000:9002:/curvefs/client/mnt/home/siku/temp/mnt1

Output:

+--------+-------------------------------------------------------------------+---------+
| fsName | mountpoint | result |
+--------+-------------------------------------------------------------------+---------+
| test1 | siku-QiTianM420-N000:9003:/curvefs/client/mnt/home/siku/temp/mnt2 | success |
+--------+-------------------------------------------------------------------+---------+

usage

usage inode

get the inode usage of curvefs

Usage:

curve fs usage inode

Output:

+------+----------------+-----+
| fsId | fsType | num |
+------+----------------+-----+
| 2 | inode_num | 3 |
| 2 | type_directory | 1 |
| 2 | type_file | 0 |
| 2 | type_s3 | 2 |
| 2 | type_sym_link | 0 |
| 3 | inode_num | 1 |
| 3 | type_directory | 1 |
| 3 | type_file | 0 |
| 3 | type_s3 | 0 |
| 3 | type_sym_link | 0 |
+------+----------------+-----+
usage metadata

get the usage of metadata in curvefs

Usage:

curve fs usage metadata

Output:

+--------------------+---------+---------+---------+
| metaserverAddr | total | used | left |
+--------------------+---------+---------+---------+
| **.***.***.**:6800 | 2.0 TiB | 182 GiB | 1.8 TiB |
| **.***.***.**:6802 | 2.0 TiB | 182 GiB | 1.8 TiB |
| **.***.***.**:6801 | 2.0 TiB | 182 GiB | 1.8 TiB |
+--------------------+---------+---------+---------+

warmup

warmup add

warmup a file(directory), or given a list file contains a list of files(directories) that you want to warmup.

Usage:

curve fs warmup add /mnt/curvefs/warmup
curve fs warmup add --filelist /mnt/curvefs/warmup.list

curve fs warmup add /mnt/curvefs/warmup will warmup a file(directory). /mnt/curvefs/warmup.list

bs

list

list logical-pool

list all logical pool information

Usage:

curve bs list logical-pool

Output:

+----+-------+-----------+----------+-------+------+--------+------+--------+---------+
| ID | NAME | PHYPOOLID | TYPE | ALLOC | SCAN | TOTAL | USED | LEFT | RECYCLE |
+----+-------+-----------+----------+-------+------+--------+------+--------+---------+
| 1 | pool1 | 1 | PAGEFILE | ALLOW | true | 44 GiB | 0 B | 44 GiB | 0 B |
+----+-------+-----------+----------+-------+------+--------+------+--------+---------+
list server

list all server information in curvebs

Usage:

curve bs list server

Output:

+----+---------------------+------+---------+-------------------+-------------------+
| ID | HOSTNAME | ZONE | PHYPOOL | INTERNALADDR | EXTERNALADDR |
+----+---------------------+------+---------+-------------------+-------------------+
| 1 | ***************_0_0 | 1 | 1 | **.***.**.**:**** | **.***.**.**:**** |
+----+---------------------+------+ +-------------------+-------------------+
| 2 | ***************_1_0 | 2 | | **.***.**.**:**** | **.***.**.**:**** |
+----+---------------------+------+ +-------------------+-------------------+
| 3 | ***************_2_0 | 3 | | **.***.**.**:**** | **.***.**.**:**** |
+----+---------------------+------+---------+-------------------+-------------------+
list client

list all client information in curvebs

curve bs list client

Output:

+------------+------+
| IP | PORT |
+------------+------+
| 172.17.0.2 | 9000 |
+------------+------+
list dir

list dir information in curvebs

curve bs list dir --path /

Output:

+------+-------------+----------+-----------------+------------+---------------------+---------------+-------------+
| ID | FILENAME | PARENTID | FILETYPE | OWNER | CTIME | ALLOCATEDSIZE | FILESIZE |
+------+-------------+----------+-----------------+------------+---------------------+---------------+-------------+
| 1 | /RecycleBin | 0 | INODE_DIRECTORY | root | 2022-11-12 16:38:25 | 0 B | 0 B |
+------+-------------+----------+-----------------+------------+---------------------+---------------+-------------+
list space

show curvebs all disk type space, include total space and used space

curve bs list space

Output:

+----------+---------+---------+---------+------------+---------+
| TYPE | TOTAL | USED | LEFT | RECYCLABLE | CREATED |
+----------+---------+---------+---------+------------+---------+
| physical | *** GiB | *** GiB | *** GiB | - | - |
+----------+---------+---------+---------+------------+---------+
| logical | *** GiB | *** GiB | *** GiB | *** GiB | *** GiB |
+----------+---------+---------+---------+------------+---------+
list chunkserver

list chunkserver information in curvebs

curve bs list chunkserver

Output:

+----+------+-----------+------+-----------+------------+------------+-----------------------------------------------+--------------+-------------+------------------+-----------+
| ID | TYPE | IP | PORT | RWSTATUS | DISKSTATE | COPYSETNUM | MOUNTPOINT | DISKCAPACITY | DISKUSED | UNHEALTHYCOPYSET | EXTADDR |
+----+------+-----------+------+-----------+------------+------------+-----------------------------------------------+--------------+-------------+------------------+-----------+
| 1 | nvme | 127.0.0.1 | 8201 | READWRITE | DISKNORMAL | 100 | local:///curvebs/playground/chunkserver1/data | 39 GiB | 42140479488 | 0 % | 127.0.0.1 |
+----+ + +------+ + +------------+-----------------------------------------------+--------------+-------------+------------------+ +
| 2 | | | 8202 | | | 100 | local:///curvebs/playground/chunkserver2/data | 39 GiB | 42140479488 | 0 % | |
+----+ + +------+ + +------------+-----------------------------------------------+--------------+-------------+------------------+ +
| 3 | | | 8200 | | | 100 | local:///curvebs/playground/chunkserver0/data | 39 GiB | 42140479488 | 0 % | |
+----+------+-----------+------+-----------+------------+------------+-----------------------------------------------+--------------+-------------+------------------+-----------+
list scan-status

list curvebs all copyset that scanning is false

curve bs list scan-status

Output:

+-------------+-----------+
| LOGICALPOOL | COPYSETID |
+-------------+-----------+
| 1 | 1 |
+-------------+-----------+
| 1 | 10 |
+-------------+-----------+
| 1 | 100 |
+-------------+-----------+
| 1 | 11 |
+-------------+-----------+
| 1 | 12 |
+-------------+-----------+
| 1 | 13 |
+-------------+-----------+
| 1 | 14 |
+-------------+-----------+
| 1 | 15 |
+-------------+-----------+
| 1 | 16 |
+-------------+-----------+
| 1 | 17 |
+-------------+-----------+
| 1 | 18 |
+-------------+-----------+
| 1 | 19 |
+-------------+-----------+
| 1 | 2 |
+-------------+-----------+
| 1 | 20 |
+-------------+-----------+
| 1 | 21 |
+-------------+-----------+
| 1 | 22 |
+-------------+-----------+
| 1 | 23 |
+-------------+-----------+
| 1 | 24 |
+-------------+-----------+
| 1 | 25 |
+-------------+-----------+
| 1 | 26 |
+-------------+-----------+
| 1 | 27 |
+-------------+-----------+
| 1 | 28 |
+-------------+-----------+
| 1 | 29 |
+-------------+-----------+
| 1 | 3 |
+-------------+-----------+
| 1 | 30 |
+-------------+-----------+
| 1 | 31 |
+-------------+-----------+
| 1 | 32 |
+-------------+-----------+
| 1 | 33 |
+-------------+-----------+
| 1 | 34 |
+-------------+-----------+
| 1 | 35 |
+-------------+-----------+
| 1 | 36 |
+-------------+-----------+
| 1 | 37 |
+-------------+-----------+
| 1 | 38 |
+-------------+-----------+
| 1 | 39 |
+-------------+-----------+
| 1 | 4 |
+-------------+-----------+
| 1 | 40 |
+-------------+-----------+
| 1 | 41 |
+-------------+-----------+
| 1 | 42 |
+-------------+-----------+
| 1 | 43 |
+-------------+-----------+
| 1 | 44 |
+-------------+-----------+
| 1 | 45 |
+-------------+-----------+
| 1 | 46 |
+-------------+-----------+
| 1 | 47 |
+-------------+-----------+
| 1 | 48 |
+-------------+-----------+
| 1 | 49 |
+-------------+-----------+
| 1 | 5 |
+-------------+-----------+
| 1 | 50 |
+-------------+-----------+
| 1 | 51 |
+-------------+-----------+
| 1 | 52 |
+-------------+-----------+
| 1 | 53 |
+-------------+-----------+
| 1 | 54 |
+-------------+-----------+
| 1 | 55 |
+-------------+-----------+
| 1 | 56 |
+-------------+-----------+
| 1 | 57 |
+-------------+-----------+
| 1 | 58 |
+-------------+-----------+
| 1 | 59 |
+-------------+-----------+
| 1 | 6 |
+-------------+-----------+
| 1 | 60 |
+-------------+-----------+
| 1 | 61 |
+-------------+-----------+
| 1 | 62 |
+-------------+-----------+
| 1 | 63 |
+-------------+-----------+
| 1 | 64 |
+-------------+-----------+
| 1 | 65 |
+-------------+-----------+
| 1 | 66 |
+-------------+-----------+
| 1 | 67 |
+-------------+-----------+
| 1 | 68 |
+-------------+-----------+
| 1 | 69 |
+-------------+-----------+
| 1 | 7 |
+-------------+-----------+
| 1 | 70 |
+-------------+-----------+
| 1 | 71 |
+-------------+-----------+
| 1 | 72 |
+-------------+-----------+
| 1 | 73 |
+-------------+-----------+
| 1 | 74 |
+-------------+-----------+
| 1 | 75 |
+-------------+-----------+
| 1 | 76 |
+-------------+-----------+
| 1 | 77 |
+-------------+-----------+
| 1 | 78 |
+-------------+-----------+
| 1 | 79 |
+-------------+-----------+
| 1 | 8 |
+-------------+-----------+
| 1 | 80 |
+-------------+-----------+
| 1 | 81 |
+-------------+-----------+
| 1 | 82 |
+-------------+-----------+
| 1 | 83 |
+-------------+-----------+
| 1 | 84 |
+-------------+-----------+
| 1 | 85 |
+-------------+-----------+
| 1 | 86 |
+-------------+-----------+
| 1 | 87 |
+-------------+-----------+
| 1 | 88 |
+-------------+-----------+
| 1 | 89 |
+-------------+-----------+
| 1 | 9 |
+-------------+-----------+
| 1 | 90 |
+-------------+-----------+
| 1 | 91 |
+-------------+-----------+
| 1 | 92 |
+-------------+-----------+
| 1 | 93 |
+-------------+-----------+
| 1 | 94 |
+-------------+-----------+
| 1 | 95 |
+-------------+-----------+
| 1 | 96 |
+-------------+-----------+
| 1 | 97 |
+-------------+-----------+
| 1 | 98 |
+-------------+-----------+
| 1 | 99 |
+-------------+-----------+
list may-broken-vol

list may broken volumes

Usage:

curve bs list may-broken-vol

Output:

+----------+
| FILENAME |
+----------+
| test |
+----------+

clean-recycle

clean the recycle bin

Usage:

curve bs clean-recycle --recycleprefix=/test --expiredtime=1h

Output:

+---------+
| RESULT |
+---------+
| success |
+---------+

query

query file

query the file info and actual space

Usage:

curve bs query file --path=/test

Output:

+------+------+----------------+-------+--------+---------+--------+-----+---------------------+--------------+---------+-----------------+----------+
| ID | NAME | TYPE | OWNER | CHUNK | SEGMENT | LENGTH | SEQ | CTIME | STATUS | STRIPE | THROTTLE | ALLOC |
+------+------+----------------+-------+--------+---------+--------+-----+---------------------+--------------+---------+-----------------+----------+
| 1003 | test | INODE_PAGEFILE | test | 16 MiB | 1.0 GiB | 10 GiB | 1 | 2022-08-29 17:00:55 | kFileCreated | count:0 | type:IOPS_TOTAL | size:0 B |
| | | | | | | | | | | uint:0 | limit:2000 | |
| | | | | | | | | | | | type:BPS_TOTAL | |
| | | | | | | | | | | | limit:125829120 | |
+------+------+----------------+-------+--------+---------+--------+-----+---------------------+--------------+---------+-----------------+----------+
query chunk

query the location of the chunk corresponding to the offset

Usage:

curve bs query chunk --path /test1 --offset 1008600000 

Output:

+-------+-------------+---------+------------+----------------------+
| CHUNK | LOGICALPOOL | COPYSET | GROUP | LOCATION |
+-------+-------------+---------+------------+----------------------+
| 61 | 1 | 61 | 4294967357 | ***.***.***.***:**** |
| | | | | ***.***.***.***:**** |
| | | | | ***.***.***.***:**** |
+-------+-------------+---------+------------+----------------------+
query segment

query the segments info of the file

Usage:

curve bs query seginfo --path /test1 

Output:

+-------------+-------------+-----------+------------+---------+-------+
| LOGICALPOOL | SEGMENTSIZE | CHUNKSIZE | START | COPYSET | CHUNK |
+-------------+-------------+-----------+------------+---------+-------+
| 1 | 1073741824 | 16777216 | 0 | 1 | 1 |
+ + + + +---------+-------+
| ...... |
+ + + +------------+---------+-------+
| | | | 9663676416 | 1 | 101 |
+ + + + +---------+-------+
| ...... |
+ + + + +---------+-------+
| | | | | 99 | 99 |
+-------------+-------------+-----------+------------+---------+-------+
query scan-status

quey ScanStatus Info in bs

Usage:

curve bs query scan-satus --copysetid 1 --logicalpoolid 1

Output:

+-------------+-----------+-------+-------------+--------------------+
| LOGICALPOOL | COPYSETID | SCAN | LASTSCANSEC | LASTSCANCONSISTENT |
+-------------+-----------+-------+-------------+--------------------+
| 1 | 1 | false | 1684425801 | true |
+-------------+-----------+-------+-------------+--------------------+

status

status etcd

get the etcd status of curvebs

Usage:

curve bs status etcd

Output:

+---------------------+---------+----------+
| ADDR | VERSION | STATUS |
+---------------------+---------+----------+
| ***.***.*.***:***** | 3.4.10 | follower |
+---------------------+ + +
| ***.***.*.***:***** | | |
+---------------------+ +----------+
| ***.***.*.***:***** | | leader |
+---------------------+---------+----------+
status mds

get the mds status of curvebs

Usage:

curve bs status mds

Output:

+-------------------+-------------------+-------------------+----------+
| ADDR | DUMMYADDR | VERSION | STATUS |
+-------------------+-------------------+-------------------+----------+
| **.***.**.**:**** | **.***.**.**:**** | ci+562296c7+debug | follower |
+-------------------+-------------------+ + +
| **.***.**.**:**** | **.***.**.**:**** | | |
+-------------------+-------------------+ +----------+
| **.***.**.**:**** | **.***.**.**:**** | | leader |
+-------------------+-------------------+-------------------+----------+
status client

get the client status of curvebs

Usage:

curve bs status client

Output:

+-------------+----------------+---------------------+-----+
| TYPE | VERSION | ADDR | NUM |
+-------------+----------------+---------------------+-----+
| nebd-server | 9.9.9+2c4861ca | ***.***.**.***:**** | 2 |
+ + +---------------------+ +
| | | ***.***.**.***:**** | |
+-------------+----------------+---------------------+-----+
status snapshotserver

get the mds status of curvebs

Usage:

curve bs status snapshotserver

Output:

+---------------------+---------------------+-------------------+----------+
| ADDR | DUMMYADDR | VERSION | STATUS |
+---------------------+---------------------+-------------------+----------+
| ***.***.**.***:**** | ***.***.**.***:**** | ci+562296c7+debug | follower |
+---------------------+---------------------+ + +
| ***.***.**.***:**** | ***.***.**.***:**** | | |
+---------------------+---------------------+ +----------+
| ***.***.**.***:**** | ***.***.**.***:**** | | leader |
+---------------------+---------------------+-------------------+----------+
status chunkserver

get the chunkserver status of curvebs

Usage:

curve bs status chunkserver

Output:

+------------------+------------------+----------------+--------+------------+
| EXTERNALADDR | INTERNALADDR | VERSION | STATUS | RECOVERING |
+------------------+------------------+----------------+--------+------------+
| **************** | **************** | d9b6bb98+debug | online | false |
+------------------+------------------+ + + +
| **************** | **************** | | | |
+------------------+------------------+ + + +
| **************** | **************** | | | |
+------------------+------------------+----------------+--------+------------+
status copyset

get the copyset status of curvebs

Usage:

curve bs status copyset

Output:

+------------+-----------+--------+--------+--------+---------+
| COPYSETKEY | COPYSETID | POOLID | STATUS | LOGGAP | EXPLAIN |
+------------+-----------+--------+--------+--------+---------+
| 4294967297 | 1 | 1 | ok | 0 | |
+------------+-----------+ + +--------+---------+
| ...... | ...... | ...... | ...... | ...... | ...... |
+------------+-----------+ + +--------+---------+
| 4294967395 | 99 | | | 0 | |
+------------+-----------+--------+--------+--------+---------+

delete

delete peer

delete the peer from the copyset

Usage:

curve bs delete peer

Output:

+------------------+------------------+---------+---------+--------+
| LEADER | PEER | COPYSET | RESULT | REASON |
+------------------+------------------+---------+---------+--------+
| 127.0.0.1:8201:0 | 127.0.0.1:8202:0 | (1:29) | success | null |
+------------------+------------------+---------+---------+--------+
delete volume
delete volume clone

delete volume clone tasks in curvebs cluster

Usage:

curve bs delete volume clone

Output:

+------+--------------------------------------+--------------------------------------+-------+---------+            
| USER | SRC | TASK ID | FILE | RESULT |
+------+--------------------------------------+--------------------------------------+-------+---------+
| root | a19b5e5e-b306-488f-8e6d-d87282c869cb | d26e27a8-fcbd-4f7a-adf8-53795217cbb0 | /root | success |
+------+--------------------------------------+--------------------------------------+-------+---------+
delete volume recover

delete volume recover tasks in curvebs cluster

Usage:

curve bs delete volume recover

Output:

+------+--------------------------------------+--------------------------------------+-------+---------+             
| USER | SRC | TASK ID | FILE | RESULT |
+------+--------------------------------------+--------------------------------------+-------+---------+
| root | a19b5e5e-b306-488f-8e6d-d87282c869cb | 9dfa8699-a275-4891-8ec2-e447a0ccc77c | /root | success |
+------+--------------------------------------+--------------------------------------+-------+---------+

update

update peer

reset peer

Usage:

curve bs update peer 127.0.0.0:8200:0 --logicalpoolid=1 --copysetid=1

Output:

+----------------------+---------+---------+--------+
| PEER | COPYSET | RESULT | REASON |
+----------------------+---------+---------+--------+
| 127.0.0.0:8200:0 | (1:1) | success | null |
+----------------------+---------+---------+--------+
update leader

transfer leader

Usage:

curve bs update leader 127.0.0.1:8202:0 --logicalpoolid=1 --copysetid=1 --peers=127.0.0.1:8200:0,127.0.0.1:8201:0,127.0.0.1:8202:0

Output:

+-----------------------+-----------------------+---------+---------+
| LEADER | OLDLEADER | COPYSET | RESULT |
+-----------------------+-----------------------+---------+---------+
| ***.***.**.***:****:* | ***.***.**.***:****:* | (1:1) | success |
+-----------------------+-----------------------+---------+---------+
update file

expand pagefile

Usage:

curve bs update file --path /test2/test1 --size 10

Output:

+---------+
| RESULT |
+---------+
| success |
+---------+
update throttle

update file throttle params

Usage:

curve bs update throttle --path /test1 --type=bps_total --limit 20000

Output:

+---------+
| RESULT |
+---------+
| success |
+---------+
update scan-state

enable/disable scan for logical pool

Usage:

curve bs update scan-state --logicalpoolid 1 [--scan=true/false]

Output:

+----+------+---------+--------+
| ID | SCAN | RESULT | REASON |
+----+------+---------+--------+
| 1 | true | success | null |
+----+------+---------+--------+
update copyset availflag

update copyset availflag

Usage:

curve bs update copyset availflag --availflag=true [--dryrun=true/false]

Output:

+--------+-----------+---------------+--------+
| POOLID | COPYSETID | AVAILFLAG | DRYRUN |
+--------+-----------+---------------+--------+
| 1 | 1 | false => true | true |
+--------+-----------+---------------+--------+
update leader-schedule

"rapidly transfer leader

Usage:

curve bs update leader-schedule --logicalpoolid 1
curve bs update leader-schedule --all

Output:

+---------+--------+
| RESULT | REASON |
+---------+--------+
| success | null |
+---------+--------+

create

create file

create pagefile

Usage:

curve bs create file --path /test2/test4  --size 10

Output:

+---------+
| RESULT |
+---------+
| success |
+---------+
create dir

create directory

Usage:

curve bs create dir --path /test2/test5 

Output:

+---------+
| RESULT |
+---------+
| success |
+---------+

check

check copyset

check copysets health in curvebs

Usage:

curve bs check copyset --copysetid 1 --logicalpoolid 1

Output:

+------------+-----------+--------+--------+--------+---------+
| COPYSETKEY | COPYSETID | POOLID | STATUS | LOGGAP | EXPLAIN |
+------------+-----------+--------+--------+--------+---------+
| 4294967297 | 1 | 1 | ok | 0 | |
+------------+-----------+--------+--------+--------+---------+
check chunkserver

check chunkserver health in curvebs

Usage:

curve bs check chunkserver --chunkserverid 1

Output:

+------------+-----------+--------+--------+--------+---------+
| CHUNKSERVERID | HELATHYCOUNT | UNHEALTHYCOUNT | UNHEALTHYRATIO |
+------------+-----------+--------+--------+--------+---------+
| 1 | 100 | 0 | 0.00% |
+------------+-----------+--------+--------+--------+---------+
check server

check copysets health in server

Usage:

curve bs check server --serverid 1
curve bs check server --ip 127.0.0.1 --port 8200

Output:

+--------+-----------+-------+------------------+
| SERVER | IP | TOTAL | UNHEALTHYCOPYSET |
+--------+-----------+-------+------------------+
| 1 | 127.0.0.1 | 100 | 0(0%) |
+--------+-----------+-------+------------------+

snapshot

snapshot copyset

take snapshot for copyset

Usage:

curve bs snapshot copyset 127.0.0.0:8200:0 --logicalpoolid=1 --copysetid=1

Output:

+-----------------------+---------+---------+
| PEER | COPYSET | RESULT |
+-----------------------+---------+---------+
| ***.***.**.***:****:* | (**:**) | success |
+-----------------------+---------+---------+
curve bs snapshot copyset --all

Output:

+----------------+---------+
| CHUNKSERVER | RESULT |
+----------------+---------+
| **.*.*.**:8200 | failed |
+----------------+---------+
| **.*.*.**:8201 | success |
+----------------+ +
| **.*.*.**:8202 | |
+----------------+---------+

Comparison of old and new commands

curve fs

oldnew
curvefs_tool check-copysetcurve fs check copyset
curvefs_tool create-fscurve fs create fs
curvefs_tool create-topologycurve fs create topology
curvefs_tool delete-fscurve fs delete fs
curvefs_tool list-copysetcurve fs list copyset
curvefs_tool list-fscurve fs list fs
curvefs_tool list-fscurve fs list mountpoint
curvefs_tool list-partitioncurve fs list partition
curvefs_tool query-copysetcurve fs query copyset
curvefs_tool query-fscurve fs query fs
curvefs_tool query-inodecurve fs query inode
curvefs_tool query-metaservercurve fs query metaserver
curvefs_tool query-partitioncurve fs query partition
curvefs_tool status-mdscurve fs status mds
curvefs_tool status-metaservercurve fs status metaserver
curvefs_tool status-etcdcurve fs status etcd
curvefs_tool status-copysetcurve fs status copyset
curvefs_tool status-clustercurve fs status cluster
curvefs_tool umount-fscurve fs umount fs
curvefs_tool usage-inodecurve fs usage inode
curvefs_tool usage-metadatacurve fs usage metadata

curve bs

oldnew
curve_ops_tool logical-pool-listcurve bs list logical-pool
curve_ops_tool get -fileName=curve bs query file -path
curve_ops_tool etcd-statuscurve bs status etcd
curve_ops_tool mds-statuscurve bs status mds
curve_ops_tool server-listcurve bs list server
curve_ops_tool client-listcurve bs list client
curve_ops_tool deletecurve bs delete file
curve_ops_tool listcurve bs list dir
curve_ops_tool createcurve bs create file/dir
curve_ops_tool seginfocurve bs query seginfo
curve_ops_tool chunk-locationcurve bs query chunk
curve_ops_tool remove-peercurve bs delete peer
curve_ops_tool reset-peercurve bs update peer
curve_ops_tool spacecurve bs list space
curve_ops_tool update-throttlecurve bs update throttle
curve_ops_tool check-copysetcurve bs check copyset
curve_ops_tool client-statuscurve bs status client
curve_ops_tool check-operatorcurve bs check operator
curve_ops_tool snapshot-clone-statuscurve bs status snapshotserver
curve_ops_tool transfer-leadercurve bs update leader
curve_ops_tool do-snapshotcurve bs snapshot copyset
curve_ops_tool set-scan-statecurve bs update scan-state
curve_ops_tool chunkserver-statuscurve bs status chunkserver
curve_ops_tool chunkserver-listcurve bs list chunkserver
curve_ops_tool set-copyset-availflagcurve bs update copyset availflag
curve_ops_tool scan-statuscurve bs list/query scan-status
curve_ops_tool clean-recyclecurve bs clean-recycle
curve_ops_tool copysets-statuscurve bs status copyset
curve_ops_tool list-may-broken-volcurve bs list may-broken-vol
curve_ops_tool rapid-leader-schedulecurve bs update leader-schedule
curve_ops_tool do-snapshot-allcurve bs snapshot --all
curve_ops_tool check-chunkservercurbe bs check chunkserver
curve_ops_tool status
curve_ops_tool check-consistency
curve_ops_tool check-servercurve bs check server