Skip to content

Commit d4adc7b

Browse files
authored
fix: update commands for mentactl (#1155)
1 parent 881b874 commit d4adc7b

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

docs/cn/guides/10-deploy/01-deploy/02-production/30-metasrv-backup-restore.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
title: 备份和恢复 Databend 元服务集群
33
sidebar_label: 备份和恢复元服务
4-
description:
5-
如何备份和恢复元服务集群数据
4+
description: 如何备份和恢复元服务集群数据
65
---
76

87
本指南将介绍如何备份和恢复元服务集群数据。
@@ -17,7 +16,7 @@ description:
1716
其中 `<ip:port>`[databend-meta.toml](https://github.com/datafuselabs/databend/blob/main/scripts/distribution/configs/databend-meta.toml) 中的 `grpc_api_address`,例如:
1817

1918
```shell
20-
databend-metactl --export --grpc-api-address "127.0.0.1:9191" --db <output_fn>
19+
databend-metactl export --grpc-api-address "127.0.0.1:9191" --db <output_fn>
2120

2221
# tail "<output_fn>"
2322
# ["state_machine/0",{"Nodes":{"key":2,"value":{"name":"","endpoint":{"addr":"localhost","port":28203}}}}]
@@ -33,7 +32,7 @@ databend-metactl --export --grpc-api-address "127.0.0.1:9191" --db <output_fn>
3332

3433
```sh
3534

36-
databend-metactl --export --raft-dir "<your_meta_dir>" --db <output_fn>
35+
databend-metactl export --raft-dir "<your_meta_dir>" --db <output_fn>
3736

3837
# tail "<output_fn>"
3938
# ["state_machine/0",{"Nodes":{"key":2,"value":{"name":"","endpoint":{"addr":"localhost","port":28203}}}}]
@@ -50,15 +49,15 @@ databend-metactl --export --raft-dir "<your_meta_dir>" --db <output_fn>
5049
以下命令从导出的元数据中在 `<your_meta_dir>` 重建一个元服务数据库:
5150

5251
```sh
53-
databend-metactl --import --raft-dir "<your_meta_dir>" --db <output_fn>
52+
databend-metactl import --raft-dir "<your_meta_dir>" --db <output_fn>
5453

5554
databend-meta --raft-dir "<your_meta_dir>" ...
5655
```
5756

5857
注意:如果没有 `--db` 参数,导入的数据将来自标准输入,如:
5958

6059
```sh
61-
cat "<output_fn>" | databend-metactl --import --raft-dir "<your_meta_dir>"
60+
cat "<output_fn>" | databend-metactl import --raft-dir "<your_meta_dir>"
6261
```
6362

6463
**注意**`<your_meta_dir>` 中的数据将被清除。
@@ -71,9 +70,9 @@ cat "<output_fn>" | databend-metactl --import --raft-dir "<your_meta_dir>"
7170
例如:
7271

7372
```
74-
databend-metactl --import --raft-dir ./.databend/new_meta1 --id=1 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
75-
databend-metactl --import --raft-dir ./.databend/new_meta2 --id=2 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
76-
databend-metactl --import --raft-dir ./.databend/new_meta3 --id=3 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
73+
databend-metactl import --raft-dir ./.databend/new_meta1 --id=1 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
74+
databend-metactl import --raft-dir ./.databend/new_meta2 --id=2 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
75+
databend-metactl import --raft-dir ./.databend/new_meta3 --id=3 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
7776
```
7877

7978
上述脚本从 `meta.db` 导入导出的数据,并初始化三个集群节点:id 1,其 raft 目录为 `./.databend/new_meta1`,id 2 和 3 也是如此,但使用不同的 raft 目录。

docs/en/guides/10-deploy/01-deploy/02-production/30-metasrv-backup-restore.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
title: Back Up and Restore Databend Meta Service Cluster
33
sidebar_label: Backup and Restore Meta Service
4-
description:
5-
How to back up and restore Meta Service cluster data
4+
description: How to back up and restore Meta Service cluster data
65
---
76

87
This guideline will introduce how to back up and restore the meta service cluster data.
@@ -17,7 +16,7 @@ Similar to exporting from data dir, but with the service endpoint argument `--gr
1716
where `<ip:port>` is the `grpc_api_address` in [databend-meta.toml](https://github.com/datafuselabs/databend/blob/main/scripts/distribution/configs/databend-meta.toml), e.g.:
1817

1918
```shell
20-
databend-metactl --export --grpc-api-address "127.0.0.1:9191" --db <output_fn>
19+
databend-metactl export --grpc-api-address "127.0.0.1:9191" --db <output_fn>
2120

2221
# tail "<output_fn>"
2322
# ["state_machine/0",{"Nodes":{"key":2,"value":{"name":"","endpoint":{"addr":"localhost","port":28203}}}}]
@@ -33,7 +32,7 @@ E.g., every line in the output file is a JSON of an exported key-value record.
3332

3433
```sh
3534

36-
databend-metactl --export --raft-dir "<your_meta_dir>" --db <output_fn>
35+
databend-metactl export --raft-dir "<your_meta_dir>" --db <output_fn>
3736

3837
# tail "<output_fn>"
3938
# ["state_machine/0",{"Nodes":{"key":2,"value":{"name":"","endpoint":{"addr":"localhost","port":28203}}}}]
@@ -51,15 +50,15 @@ The following command rebuild a meta service db in `<your_meta_dir>` from
5150
exported metadata:
5251

5352
```sh
54-
databend-metactl --import --raft-dir "<your_meta_dir>" --db <output_fn>
53+
databend-metactl import --raft-dir "<your_meta_dir>" --db <output_fn>
5554

5655
databend-meta --raft-dir "<your_meta_dir>" ...
5756
```
5857

5958
Note: without the `--db` argument, the import data come from stdio instead, like:
6059

6160
```sh
62-
cat "<output_fn>" | databend-metactl --import --raft-dir "<your_meta_dir>"
61+
cat "<output_fn>" | databend-metactl import --raft-dir "<your_meta_dir>"
6362
```
6463

6564
**Caveat**: Data in `<your_meta_dir>` will be cleared.
@@ -72,9 +71,9 @@ The `--initial-cluster` format is: `node_id=raft_advertise_host:raft_api_port`,
7271
E.g.:
7372

7473
```
75-
databend-metactl --import --raft-dir ./.databend/new_meta1 --id=1 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
76-
databend-metactl --import --raft-dir ./.databend/new_meta2 --id=2 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
77-
databend-metactl --import --raft-dir ./.databend/new_meta3 --id=3 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
74+
databend-metactl import --raft-dir ./.databend/new_meta1 --id=1 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
75+
databend-metactl import --raft-dir ./.databend/new_meta2 --id=2 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
76+
databend-metactl import --raft-dir ./.databend/new_meta3 --id=3 --db meta.db --initial-cluster 1=localhost:29103 --initial-cluster 2=localhost:29203 --initial-cluster 3=localhost:29303
7877
```
7978

8079
The script above imports the exported data from `meta.db` and initializes the three cluster nodes: id 1, which raft directory is `./.databend/new_meta1`, and so are id 2 and 3 with different raft directory.

docs/en/guides/10-deploy/01-deploy/02-production/60-metasrv-status.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
title: Meta Service HTTP APIs
33
sidebar_label: Meta Service HTTP APIs
4-
description:
5-
Meta Service HTTP APIs
4+
description: Meta Service HTTP APIs
65
---
76

87
In order to capture and keep track of various meta stats that are useful for your analysis, Databend provides a number of HTTP APIs.
@@ -78,6 +77,12 @@ Returns the status information of each meta node in the cluster.
7877
}
7978
```
8079

80+
### MetaCTL command
81+
82+
```shell
83+
databend-metactl status
84+
```
85+
8186
## Meta Metrics API
8287

8388
Shows a bunch of metrics that Databend captures and tracks about the meta service performance. For more information about the meta service metrics, see [Databend Meta Metrics](../../03-monitor/10-metasrv-metrics.md).

0 commit comments

Comments
 (0)