|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
|
|
|
|
|
#### 下载
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
```shell
|
|
|
|
|
percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17-minimal.tar.gz
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@ -13,7 +13,7 @@ percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17-minimal.tar.gz
|
|
|
|
|
|
|
|
|
|
#### 安装
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
```shell
|
|
|
|
|
cd /usr/local
|
|
|
|
|
gunzip percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17-minimal.tar.gz
|
|
|
|
|
tar -xvf percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17-minimal.tar
|
|
|
|
@ -30,9 +30,9 @@ ln -sf /usr/local/xtrabackup/bin/* /usr/bin/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 下载qpress
|
|
|
|
|
#### 下载$qpress$
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
```shell
|
|
|
|
|
rz -be
|
|
|
|
|
选择:qpress-11-linux-x64.tar
|
|
|
|
|
tar -xf qpress-11-linux-x64.tar
|
|
|
|
@ -43,7 +43,7 @@ cp -a qpress /usr/bin/
|
|
|
|
|
|
|
|
|
|
#### 查看版本
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
```shell
|
|
|
|
|
xtrabackup --version
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@ -51,7 +51,7 @@ xtrabackup --version
|
|
|
|
|
|
|
|
|
|
#### 查看位置
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
```shell
|
|
|
|
|
which xtrabackup
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@ -59,52 +59,33 @@ which xtrabackup
|
|
|
|
|
|
|
|
|
|
#### 解包
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
```shell
|
|
|
|
|
cd /usr/local/mongodb/db
|
|
|
|
|
|
|
|
|
|
rz -be
|
|
|
|
|
选择 hins15335287_data_20240730061703_qp.xb
|
|
|
|
|
选择 hins15335287_data_20240814061706_qp.xb
|
|
|
|
|
|
|
|
|
|
cat hins15335287_data_20240730061703_qp.xb | xbstream -x -v
|
|
|
|
|
cat hins15335287_data_20240814061706_qp.xb | xbstream -x -v
|
|
|
|
|
|
|
|
|
|
innobackupex --decompress --remove-original /usr/local/mongodb/db
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 打扫垃圾
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
rm -rf hins15335287_data_20240730061703_qp.xb
|
|
|
|
|
rm -rf hins15335287_data_20240814061706_qp.xb
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 启动MongoDB
|
|
|
|
|
#### 启动$MongoDB$
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
cd /usr/local/mongodb
|
|
|
|
|
chmod 777 db
|
|
|
|
|
chmod 777 log
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 备份数据库
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
mongodump
|
|
|
|
|
cd /usr/local/mongodb
|
|
|
|
|
./bin/mongod -f ./mongodb.conf
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
https://mp.weixin.qq.com/s?__biz=MjM5NTcxMTE2Nw==&mid=2653126118&idx=2&sn=d7c3fa8bc119856dae3d66de09067ab8&chksm=bd238c368a5405209c9b9e5409afe31a39c3774b09312164822933734639eefd0289e74e5a48&scene=27
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@RockyLinux dump]# ll
|
|
|
|
|
total 4
|
|
|
|
|
drwxr-xr-x. 2 root root 128 Jul 29 23:02 admin
|
|
|
|
|
drwxr-xr-x. 2 root root 4096 Jul 29 23:04 yltcharge
|
|
|
|
|
[root@RockyLinux dump]# pwd
|
|
|
|
|
/usr/local/mongodb/db/dump
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|