Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[curve tool]: implement do-snapshot commnad #2023

Closed
ilixiaocui opened this issue Nov 3, 2022 · 20 comments
Closed

[curve tool]: implement do-snapshot commnad #2023

ilixiaocui opened this issue Nov 3, 2022 · 20 comments
Assignees
Labels
good first issue Good for newcomers pending

Comments

@ilixiaocui
Copy link
Contributor

ilixiaocui commented Nov 3, 2022

Describe the feature you'd like:

we'd like to support do-snapshot command in curve tool

do-snapshot is one of the commands to do Trigger the replication group to take a snapshot.

  • The implementation of the old tool is here:
    int CurveCli::DoSnapshot(uint32_t lgPoolId, uint32_t copysetId,
  • The old command input and out put:
    do-snapshot : do snapshot of the peer of the copyset
    
    curve_ops_tool do-snapshot --example
    Example
    curve_ops_tool do-snapshot -logicalPoolId=1 -copysetId=10001 -peer=127.0.0.1:8080:0 -max_retry=3 -timeout_ms=100
    
    output:
    do snapshot ok
    

Teachability, Documentation, Adoption, Migration Strategy:

Refer to tool develop guide to get start, and paste the result of the command in pr.

Build compilation environment:https://github.com/opencurve/curve/blob/master/docs/cn/build_and_run.md

@zhanghuidinah
Copy link
Member

/assign @Nageshbansal

@ilixiaocui
Copy link
Contributor Author

Please note that the code submission deadline for this developer activity is December 3rd :)
@Nageshbansal

@wuhongsong
Copy link
Contributor

you are welcome to continue the work if you are free @Nageshbansal

@ilixiaocui
Copy link
Contributor Author

cc @Nageshbansal Since you haven't responded for a long time, this issue is reopened to others who is interested.

@Cyber-SiKu
Copy link
Contributor

@iiiuwioajdks

@zhanghuidinah
Copy link
Member

@iiiuwioajdks
Copy link

When I execute: “ curveadm playground run --kind curvebs --container_image harbor.cloud.netease.com/curve/curvebs:playground”
the following error occurs :
image

is there any relevant document to solve it?
cc @ilixiaocui @Cyber-SiKu

@iiiuwioajdks
Copy link

Then I also want to ask if there is a way to develop tools-v2 in docker

@Cyber-SiKu
Copy link
Contributor

When I execute: “ curveadm playground run --kind curvebs --container_image harbor.cloud.netease.com/curve/curvebs:playground” the following error occurs : image

is there any relevant document to solve it? cc @ilixiaocui @Cyber-SiKu

Looks like curveadm can't execute, are you x86 OS?

@Cyber-SiKu
Copy link
Contributor

Then I also want to ask if there is a way to develop tools-v2 in docker

The following image is fine, but you need to manually configure the configuration file.
opencurvedocker/curve-base:build-debian9

@iiiuwioajdks
Copy link

Hello, I entered the command " curveadm playground run --kind curvebs --container_image harbor.cloud.netease.com/curve/curvebs:playground" and checked the docker log and found the following error:
E 2023-04-15T13:37:30.979012+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 72
E 2023-04-15T13:37:30.980208+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 29
E 2023-04-15T13:37:30.980371+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 45
E 2023-04-15T13:37:30.980399+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 83
E 2023-04-15T13:37:30.980420+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 41
E 2023-04-15T13:37:30.980453+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 66
E 2023-04-15T13:37:30.980492+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 39
E 2023-04-15T13:37:30.980615+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 18
E 2023-04-15T13:37:30.980993+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 8
E 2023-04-15T13:37:30.981340+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 30
E 2023-04-15T13:37:30.981436+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 35
E 2023-04-15T13:37:30.981765+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 36
E 2023-04-15T13:37:30.982208+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 3
E 2023-04-15T13:37:30.982918+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 17
E 2023-04-15T13:37:30.983433+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 97
E 2023-04-15T13:37:30.983518+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 22
E 2023-04-15T13:37:30.983551+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 21
E 2023-04-15T13:37:30.983884+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 48
E 2023-04-15T13:37:30.983963+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 67
E 2023-04-15T13:37:30.984014+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 96
E 2023-04-15T13:37:30.984038+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 49
E 2023-04-15T13:37:30.984555+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 60
E 2023-04-15T13:37:30.985397+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 69
E 2023-04-15T13:37:30.986232+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 71
E 2023-04-15T13:37:30.986816+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 12
E 2023-04-15T13:37:30.986896+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 76
E 2023-04-15T13:37:30.986948+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 9
E 2023-04-15T13:37:30.987047+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 89
E 2023-04-15T13:37:30.987080+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 90
E 2023-04-15T13:37:30.987100+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 93
2023-04-15 13:37:49 402 nbd/src/util.cpp:435] curve-nbd: ignoring kernel module parameter options: nbd module already loaded. nbds_max: 16, set_max_part: 0

@iiiuwioajdks
Copy link

I've changed servers and still get this error, is there something wrong with the docker startup in tools-v2?

@iiiuwioajdks
Copy link

image

@Cyber-SiKu
Copy link
Contributor

I've changed servers and still get this error, is there something wrong with the docker startup in tools-v2?

Is there a configuration file set up? You can refer to here.

@Cyber-SiKu
Copy link
Contributor

@Wine93 pls,take a look.

Hello, I entered the command " curveadm playground run --kind curvebs --container_image harbor.cloud.netease.com/curve/curvebs:playground" and checked the docker log and found the following error: E 2023-04-15T13:37:30.979012+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 72 E 2023-04-15T13:37:30.980208+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 29 E 2023-04-15T13:37:30.980371+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 45 E 2023-04-15T13:37:30.980399+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 83 E 2023-04-15T13:37:30.980420+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 41 E 2023-04-15T13:37:30.980453+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 66 E 2023-04-15T13:37:30.980492+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 39 E 2023-04-15T13:37:30.980615+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 18 E 2023-04-15T13:37:30.980993+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 8 E 2023-04-15T13:37:30.981340+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 30 E 2023-04-15T13:37:30.981436+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 35 E 2023-04-15T13:37:30.981765+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 36 E 2023-04-15T13:37:30.982208+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 3 E 2023-04-15T13:37:30.982918+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 17 E 2023-04-15T13:37:30.983433+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 97 E 2023-04-15T13:37:30.983518+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 22 E 2023-04-15T13:37:30.983551+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 21 E 2023-04-15T13:37:30.983884+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 48 E 2023-04-15T13:37:30.983963+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 67 E 2023-04-15T13:37:30.984014+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 96 E 2023-04-15T13:37:30.984038+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 49 E 2023-04-15T13:37:30.984555+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 60 E 2023-04-15T13:37:30.985397+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 69 E 2023-04-15T13:37:30.986232+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 71 E 2023-04-15T13:37:30.986816+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 12 E 2023-04-15T13:37:30.986896+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 76 E 2023-04-15T13:37:30.986948+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 9 E 2023-04-15T13:37:30.987047+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 89 E 2023-04-15T13:37:30.987080+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 90 E 2023-04-15T13:37:30.987100+0800 64 heartbeat_manager.cpp:339] leader not found, logicalpoolid: 1, copysetid: 93 2023-04-15 13:37:49 402 nbd/src/util.cpp:435] curve-nbd: ignoring kernel module parameter options: nbd module already loaded. nbds_max: 16, set_max_part: 0

@Wine93
Copy link
Contributor

Wine93 commented Apr 19, 2023

@iiiuwioajdks Which version of CurveAdm you used, maybe you can try the latest version:

CURVEADM_VERSION=v0.2.0 curveadm -u

@iiiuwioajdks
Copy link

I've changed servers and still get this error, is there something wrong with the docker startup in tools-v2?

Is there a configuration file set up? You can refer to here.

Thank you! Your method is effective, but I still have a problem with curveadm, I still can't connect to the leader after starting docker to check the logs, and the 6700, 6701 and 6702 of my host are not started, have you encountered this situation?
image

@Cyber-SiKu
Copy link
Contributor

目前snapshot 相关的命令不能使用 curveadm palygroud 部署的集群(没有s3,所以没有snapshot).
需要先部署一个minio.
然后按照部署文档部署一个单机集群.可以跳过格式化磁盘,然后在填写topology.yaml的配置项:

kind: curvebs
global:
... ...
  s3.nos_address: <> // ip:9000 为minio部署的ip和端口号
  s3.snapshot_bucket_name: <> // 创建的桶名
  s3.ak: <> // ak  minioadmin
  s3.sk: <> //sk minioadmin
... ...

chunkserver_services:
  config:
... ...
    copysets: 100
     chunkfilepool.enable_get_chunk_from_pool: false
  deploy:
    - host: ${target}
    - host: ${target}
    - host: ${target}
... ...

@Cyber-SiKu
Copy link
Contributor

Cyber-SiKu commented Apr 25, 2023

Currently snapshot-related commands cannot use the cluster deployed by curveadm palygroud (there is no s3, so there is no snapshot).
Need to deploy a minio.
Then follow the deployment document to deploy a stand-alone cluster. You can skip formatting the disk, and then fill in the configuration items of topology.yaml:

kind: curvebs
global:
...
   s3.nos_address: <> // ip:9000 is the ip and port number deployed by minio
   s3.snapshot_bucket_name: <> // created bucket name
   s3.ak: <> // ak minioadmin
   s3.sk: <> //sk minioadmin
...

chunkserver_services:
   config:
...
     copiesets: 100
      chunkfilepool.enable_get_chunk_from_pool: false
   deploy:
     - host: ${target}
     - host: ${target}
     - host: ${target}
...

@Cyber-SiKu
Copy link
Contributor

I've changed servers and still get this error, is there something wrong with the docker startup in tools-v2?

Is there a configuration file set up? You can refer to here.

Thank you! Your method is effective, but I still have a problem with curveadm, I still can't connect to the leader after starting docker to check the logs, and the 6700, 6701 and 6702 of my host are not started, have you encountered this situation? image

this is bs pls use bs command,just like:

curve bs status mds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers pending
Projects
None yet
Development

No branches or pull requests

8 participants