Skip to content

Commit 4534798

Browse files
authored
Merge pull request #9126 from drmingdrmer/50-doc-export-from-running-service
docs(meta/service): export from a running service
2 parents b4068fa + 957d5c5 commit 4534798

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/doc/10-deploy/06-metasrv/30-metasrv-backup-restore.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ This guideline will introduce how to back up and restore the meta service cluste
99

1010
## Export Data From Meta Service
1111

12+
It supports to export from a databend-meta data dir or from a running databend-meta server.
13+
14+
### Export from data dir
15+
1216
Shutdown the `databend-meta` service.
1317

1418
Then export sled DB from the dir(`<your_meta_dir>`) in which the `databend-meta` stores meta to a local file `output_fn`, in multi-line JSON format.
@@ -29,6 +33,20 @@ E.g., every line in the output file is a JSON of an exported key-value record.
2933

3034
Note: without the `--db` argument, the exported data will output to the stdio instead.
3135

36+
### Export from a running server
37+
38+
Similar to exporting from data dir, but with the service endpoint argument `--grpc-api-address <ip:port>` in place of the `--raft-dir`,
39+
where `<ip:port>` is the `grpc_api_address` in [databend-meta config.toml](./15-metasrv-config.md), e.g.:
40+
41+
```shell
42+
./target/debug/databend-metactl --export --grpc-api-address "127.0.0.1:9191" --db <output_fn>
43+
44+
# tail "<output_fn>"
45+
# ["state_machine/0",{"Nodes":{"key":2,"value":{"name":"","endpoint":{"addr":"localhost","port":28203}}}}]
46+
# ...
47+
```
48+
49+
3250
## Restore a databend-meta
3351

3452
The following command rebuild a meta service db in `<your_meta_dir>` from

0 commit comments

Comments
 (0)