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/toos-v2]: add do-snapshot-all #2352

Closed
Cyber-SiKu opened this issue Mar 30, 2023 · 9 comments
Closed

[curve/toos-v2]: add do-snapshot-all #2352

Cyber-SiKu opened this issue Mar 30, 2023 · 9 comments
Assignees
Labels

Comments

@Cyber-SiKu
Copy link
Contributor

Cyber-SiKu commented Mar 30, 2023

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)

we'd like to support bs snapshot command in curve tool

  • The implementation of the old tool is here:
    int CurveCli::DoSnapshotAll() {
    std::vector<ChunkServerInfo> chunkservers;
    int res = mdsClient_->ListChunkServersInCluster(&chunkservers);
    if (res != 0) {
    std::cout << "ListChunkServersInCluster fail!" << std::endl;
    return -1;
    }
    for (const auto& chunkserver : chunkservers) {
    braft::cli::CliOptions opt;
    opt.timeout_ms = FLAGS_timeout_ms;
    opt.max_retry = FLAGS_max_retry;
    std::string csAddr = chunkserver.hostip() + ":" +
    std::to_string(chunkserver.port());
    curve::common::Peer peer;
    peer.set_address(csAddr);
    butil::Status st = curve::chunkserver::SnapshotAll(peer, opt);
    if (!st.ok()) {
    std::cout << "Do all snapshot of chunkserver " << csAddr
    << " fail, error: " << st.error_str() << std::endl;
    res = -1;
    }
    }
    return res;
    }
  • The old command input and out put:
curve_ops_tool do-snapshot-all
-------
output:

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

Describe the solution you'd like (描述你期望的解决方法)

Add subcommand clinet to curve bs list.

Describe alternatives you've considered (描述你想到的折衷方案)

Additional context/screenshots (更多上下文/截图)

@iiiuwioajdks
Copy link

I want to complete this task, can you assign it to me?

@Cyber-SiKu
Copy link
Contributor Author

Cyber-SiKu commented Apr 12, 2023

@iiiuwioajdks You can do it first do-snapshot

@Cyber-SiKu Cyber-SiKu changed the title [curve/toos-v2]: add do-snapshot and do-snapshot-all [curve/toos-v2]: add do-snapshot-all Apr 12, 2023
@iiiuwioajdks
Copy link

@iiiuwioajdks You can do it first do-snapshot

ok

@zhanghuidinah
Copy link
Member

@Cyber-SiKu
Copy link
Contributor Author

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 Author

目前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 Author

@iiiuwioajdks Are you still going on?

@caoxianfei1
Copy link
Contributor

We temporarily closed this issue because you haven't responded for a long time, others can choose to do it. you are welcome to continue it if have time.

@montaguelhz
Copy link
Contributor

May I try it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants