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/platform-ops/operation.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,69 @@ Subsystem:
61
61
62
62
63
63
64
+
## How to Back Up and Restore TapData
65
+
66
+
While TapData is running, critical data such as task configurations and shared cache are stored in MongoDB. For safe upgrades or migrations, use the [MongoDB Database Tools](https://www.mongodb.com/docs/database-tools/mongodump/) to back up the metadata database and (optionally) the TapData work directory, then restore them when needed.
67
+
68
+
69
+
**Backup**
70
+
71
+
1. Preparation
72
+
73
+
Log in to the server hosting TapData, go to the installation directory, and stop the service. In an HA deployment, run this on each node one by one.
74
+
```bash
75
+
./tapdata stop -f
76
+
```
77
+
78
+
2. Back up the metadata database using the following command format.
-`<username>`, `<password>`: Username and password for the MongoDB instance.
84
+
-`<mongodb_host>`, `<mongodb_port>`: MongoDB host and port (default: 27017).
85
+
-`<database_name>`: Database name (default: tapdata; use your actual name if customized).
86
+
-`--gzip`: Compresses backup files to reduce backup size.
87
+
-`--excludeCollection="collection_name"`: Excludes specific collections from the backup (for example, system logs) to reduce backup time and storage usage. You can specify this option multiple times. Recommended settings: `--excludeCollection="AgentMeasurementV2" --excludeCollection="AlarmInfo" --excludeCollection="ApiCall" --excludeCollection="fs.files" --excludeCollection="fs.chunks" --excludeCollection="Message" --excludeCollection="monitoringLogs" --excludeCollection="InspectDetails" --excludeCollection="DDlTaskHistories" --excludeCollection="Logs"`
88
+
89
+
3. (Optional) For a full backup (for example, host-level migration), also back up the TapData work directory:
90
+
```bash
91
+
# Replace <tapdata_work_dir> with the actual work directory
92
+
tar -czf /backup/tapdata_work_$(date +%F).tar.gz <tapdata_work_dir>
93
+
```
94
+
4. Start the service. In an HA deployment, run this on each node one by one.
95
+
```bash
96
+
# Replace <tapdata_work_dir> with the actual work directory
97
+
./tapdata start --workDir <tapdata_work_dir>
98
+
```
99
+
100
+
**Restore / Rollback**
101
+
102
+
1. Stop the service. In an HA deployment, run this on each node one by one.
103
+
```bash
104
+
./tapdata stop -f
105
+
```
106
+
107
+
2. Import the metadata using `mongorestore`. If the target database already contains data, clean it up or rename it first to avoid conflicts.
-`<username>`, `<password>`: Username and password for the MongoDB instance.
112
+
-`<mongodb_host>`, `<mongodb_port>`: MongoDB host and port (default: 27017).
113
+
-`<database_name>`: Database name (default: tapdata; use your actual name if customized).
114
+
-`<backup_dir>`: Directory that contains the backup files (the output directory specified by `mongodump -o`).
115
+
116
+
3. Start the service. In an HA deployment, run this on each node one by one.
117
+
```bash
118
+
# Replace <tapdata_work_dir> with the actual work directory
119
+
./tapdata start --workDir <tapdata_work_dir>
120
+
```
121
+
122
+
:::tip
123
+
For full host migrations, restore the TapData work directory to the new server before starting the service.
124
+
:::
125
+
126
+
64
127
## <spanid="release330-upgrade">How to Perform a Rolling Upgrade?</span>
65
128
66
129
Starting with version 3.3.0, TapData supports rolling upgrades. Compared to the standard downtime upgrade, it helps shorten the upgrade window and further reduce business impact. The specific steps are as follows:
0 commit comments