You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/guides/10-deploy/01-deploy/02-production/30-metasrv-backup-restore.md
+35-17Lines changed: 35 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,12 @@ description: How to back up and restore Meta Service cluster data
6
6
7
7
This guideline will introduce how to back up and restore the meta service cluster data.
8
8
9
-
## Export Data From Meta Service
9
+
## Export Data From databend-meta
10
10
11
-
It supports to export from a databend-meta data dir or from a running databend-meta server.
11
+
It supports to export either from a databend-meta data dir or from a running databend-meta server.
12
+
Since Raft replicates the data to all nodes, it is enough to export from any one node.
12
13
13
-
### Export from a running server
14
+
### Export from running databend-meta
14
15
15
16
Similar to exporting from data dir, but with the service endpoint argument `--grpc-api-address <ip:port>` in place of the `--raft-dir`,
16
17
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.:
**Caveat**: Data in `<your_meta_dir>` will be cleared.
65
+
Note that the backup data contains node id,
66
+
so it is necessary to ensure the node id in the backup data is consistent with the node id in the restored databend-meta node.
67
+
To restore a different node, i.e., restore node-2 with the backup data of node-1, you need to specify the cluster config when importing, see the next section.
68
+
69
+
**Caveat**: Data in `<your_meta_dir>` will be cleared when importing.
65
70
66
71
## Import data as a new databend-meta cluster
67
72
68
-
With specifies the `--initial-cluster` argument, the `databend-metactl` can import the data as a new cluster.
69
-
The `--initial-cluster` format is: `node_id=raft_advertise_host:raft_api_port`, each node config is separated by space, the meaning of `raft_advertise_host`,`raft_api_port` is the same in raft config.
73
+
With the `--initial-cluster` argument, the `databend-metactl` import the data and re-initialize the cluster info and node ids.
74
+
The `--initial-cluster` value format is: `<node_id>=<raft_advertise_host>:<raft_api_port`,
75
+
`raft_advertise_host`,`raft_api_port` is the same as the fields in the toml config file.
70
76
71
-
E.g.:
77
+
For example, to restore a databend-meta cluster with three nodes:
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.
80
-
Note that the `--initial-cluster` argument in these three command line is the same.
97
+
In the above commands, the cluster info are all identical.
98
+
But each databend-meta node has a different node id specified.
81
99
82
-
After that, can start a new three nodes databend-meta cluster with the new config and imported data.
100
+
After that, it is ready to start a new three nodes databend-meta cluster.
0 commit comments