Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to backup and restore mongo shards and replication sets

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to backup and restore mongo fragmentation and replication set. The article is very detailed and has certain reference value. Interested friends must read it!

rpm version download

wget https://github.com/Percona-Lab/mongodb_consistent_backup/releases/download/1.1.0/mongodb_consistent_backup-1.1.0-1.el7.centos.x86_64.rpm

Backup:

[root@ip-10-1-2-32 data]# mongodb-consistent-backup -H 10.1.2.32:30000 -H 10.1.2.68:30000 -n backup -l ./ --archive.method=none --backup.mongodump.compression=gzip

Backup to the backup directory under the current directory

Recovery:

For example, restore conf files:

[root@ip-10-1-2-32 data]# /usr/local/mongodb/bin/mongorestore --oplogReplay --gzip /data/backup/20180503_1357/conf/dump/ --host 10.1.2.32 --port 27000

Recovery shard fragmentation is the same

The above is "mongo fragmentation plus replication set how to backup and restore" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report