You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
Mongodb备份:
当前备份文件类型为物理备份, 本地恢复方法请参见ApsaraDB for MongoDB物理备份恢复方案。
还原办法:
https://blog.csdn.net/w13511069150/article/details/133687350
#下载
percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17-minimal.tar.gz
# 安装
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
mv percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17-minimal /usr/local/xtrabackup
# 创建软连接
ln -sf /usr/local/xtrabackup/bin/* /usr/bin/
# 下载qpress
rz -be
选择: qpress-11-linux-x64.tar
tar -xf qpress-11-linux-x64.tar
cp -a qpress /usr/bin/
# 查看版本
xtrabackup --version
# 查看位置
which xtrabackup
# 解包
cd /usr/local/mongodb/db
rz -be
选择 hins15335287_data_20240730061703_qp.xb
# 解压缩
cat hins15335287_data_20240730061703_qp.xb | xbstream -x -v
# 解压缩
innobackupex --decompress --remove-original /usr/local/mongodb/db
# 打扫垃圾
rm -rf hins15335287_data_20240730061703_qp.xb
# 启动MongoDB
cd /usr/local/mongodb
chmod 777 db
chmod 777 log
# 启动命令
/usr/local/mongodb/bin/mongod --dbpath /usr/local/mongodb/db --bind_ip 0.0.0.0 --port 27017 --fork --journal --logpath /usr/local/mongodb/log/mongod.log --logappend --noauth --directoryperdb
# 本地的数据库备份操作
mongodump
[root@RockyLinux /]# cd /usr/local/mongodb/db/dump
[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]# du -sh
48G .