localsnapshotclone tools api

本地快照和克隆采用tools-v2工具命令行方式,使用方法如下:

创建快照:

描述

创建一个快照。

使用方法
  1. Usage: curve bs create snapshot [flags]
  2. create snapshot for file in curvebs cluster
  3. Flags:
  4. -f, --format string output format (json|plain) (default "plain")
  5. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  6. --password string user password (default "root_password")
  7. --rpcretrytimes int32 rpc retry times (default 1)
  8. --rpctimeout duration rpc timeout (default 10s)
  9. --snappath string snap file path, like: {file-path}@{snap-name}[required]
  10. --user string user name[required]
  11. Global Flags:
  12. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  13. -h, --help print help
  14. --showerror display all errors in command
  15. --verbose show some log
  16. Examples:
  17. $ curve bs create snapshot --snappath /test0@snap0 --user curve

删除快照

描述

删除一个快照。

使用方法
  1. Usage: curve bs delete snapshot [flags]
  2. delete snapshot for file in curvebs cluster
  3. Flags:
  4. -f, --format string output format (json|plain) (default "plain")
  5. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  6. --password string user password (default "root_password")
  7. --rpcretrytimes int32 rpc retry times (default 1)
  8. --rpctimeout duration rpc timeout (default 10s)
  9. --snappath string snap file path, like: {file-path}@{snap-name}[required]
  10. --user string user name[required]
  11. Global Flags:
  12. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  13. -h, --help print help
  14. --showerror display all errors in command
  15. --verbose show some log
  16. Examples:
  17. $ curve bs delete snapshot --snappath /test0@snap0 --user curve

列出快照

描述

列出所有快照。

使用方法
  1. Usage: curve bs list snapshot [flags]
  2. list snapshot information for volume in curvebs
  3. Flags:
  4. -f, --format string output format (json|plain) (default "plain")
  5. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  6. --password string user password (default "root_password")
  7. --path string file path[required]
  8. --rpcretrytimes int32 rpc retry times (default 1)
  9. --rpctimeout duration rpc timeout (default 10s)
  10. --user string user name[required]
  11. Global Flags:
  12. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  13. -h, --help print help
  14. --showerror display all errors in command
  15. --verbose show some log
  16. Examples:
  17. $ curve bs list snapshot --path /test0 --user curve

保护快照

描述

保护一个快照, 用于克隆

使用方法

  1. Usage: curve bs protect [flags]
  2. protect snapshot in curvebs cluster
  3. Flags:
  4. -f, --format string output format (json|plain) (default "plain")
  5. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  6. --password string user password (default "root_password")
  7. --rpcretrytimes int32 rpc retry times (default 1)
  8. --rpctimeout duration rpc timeout (default 10s)
  9. --snappath string snap file path, like: {file-path}@{snap-name}[required]
  10. --user string user name[required]
  11. Global Flags:
  12. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  13. -h, --help print help
  14. --showerror display all errors in command
  15. --verbose show some log
  16. Examples:
  17. $ curve bs protect --snappath /test0@snap0 --user curve

取消保护快照

描述

取消保护一个快照

使用方法

  1. Usage: curve bs unprotect [flags]
  2. unprotect snapshot in curvebs cluster
  3. Flags:
  4. -f, --format string output format (json|plain) (default "plain")
  5. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  6. --password string user password (default "root_password")
  7. --rpcretrytimes int32 rpc retry times (default 1)
  8. --rpctimeout duration rpc timeout (default 10s)
  9. --snappath string snap file path, like: {file-path}@{snap-name}[required]
  10. --user string user name[required]
  11. Global Flags:
  12. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  13. -h, --help print help
  14. --showerror display all errors in command
  15. --verbose show some log
  16. Examples:
  17. $ curve bs unprotect --snappath /test0@snap0 --user curve

children

描述

列出卷或者快照的所有子卷

使用方法

  1. Usage: curve bs children [flags]
  2. list children of snapshot/volume in curvebs cluster
  3. Flags:
  4. -f, --format string output format (json|plain) (default "plain")
  5. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  6. --password string user password (default "root_password")
  7. --path string file or directory path (default "/test")
  8. --rpcretrytimes int32 rpc retry times (default 1)
  9. --rpctimeout duration rpc timeout (default 10s)
  10. --snappath string snapshot file path
  11. --user string user name[required]
  12. Global Flags:
  13. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  14. -h, --help print help
  15. --showerror display all errors in command
  16. --verbose show some log
  17. Examples:
  18. $ curve bs children --path /test0 --user curve
  19. $ curve bs children --snappath /test0@snap0 --user curve

克隆:

描述

从快照克隆一个子卷

使用方法

  1. Usage: curve bs clone [flags]
  2. clone file in curvebs cluster
  3. Flags:
  4. --dstpath string destiation file path[required]
  5. -f, --format string output format (json|plain) (default "plain")
  6. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  7. --password string user password (default "root_password")
  8. --rpcretrytimes int32 rpc retry times (default 1)
  9. --rpctimeout duration rpc timeout (default 10s)
  10. --snappath string snap file path, like: {file-path}@{snap-name}[required]
  11. --user string user name[required]
  12. Global Flags:
  13. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  14. -h, --help print help
  15. --showerror display all errors in command
  16. --verbose show some log
  17. Examples:
  18. $ curve bs clone --snappath /test0@snap0 --dstpath /test2 --user curve

Flatten

描述

补足子卷的数据,使其与父卷和快照解耦

使用方法

  1. Usage: curve bs flatten [flags]
  2. flatten clone file in curvebs cluster
  3. Flags:
  4. -f, --format string output format (json|plain) (default "plain")
  5. --mdsaddr string mds address, should be like 127.0.0.1:6700,127.0.0.1:6701,127.0.0.1:6702
  6. --password string user password (default "root_password")
  7. --path string file path[required]
  8. --rpcretrytimes int32 rpc retry times (default 1)
  9. --rpctimeout duration rpc timeout (default 10s)
  10. --user string user name[required]
  11. Global Flags:
  12. -c, --conf string config file (default is $HOME/.curve/curve.yaml or /etc/curve/curve.yaml)
  13. -h, --help print help
  14. --showerror display all errors in command
  15. --verbose show some log
  16. Examples:
  17. $ curve bs flatten --path /test2 --user curve