已经弃用
集群自我修复,服务于同一数据集的多个mongodb实例
添加新mongodb节点的操作:
source | target |
---|---|
172.21.0.1:27017 | 172.21.0.31:27017 |
mongosync -h 10.0.4.91:27017 -u admin -p 123 --to 10.0.4.91:27020 --tu admin --tp 456
mongosync -h 10.0.4.91:27017 -u admin -p 123 --to 10.0.4.91:27020 --tu admin --tp 456 --oplog -s 1369406664,1
mongosync -h 10.0.4.91:27017 -u admin -p 123 --to 10.0.4.91:27020 --tu admin --tp 456 --oplog
mongosync -h 10.0.4.91:27017 -u admin -p 123 --to 10.0.4.91:27020 --tu admin --tp 456 --oplog -s 1369811325,1 -t 1369811373,1
by\sync | Full sync | Inc sync |
---|---|---|
All dbs | Yes | Yes |
Specify one db(-d) | Yes | Yes |
Specify one coll(-d -c) | Yes | Yes |
Time range(-s -t) | Yes | Yes |
from\to | mongod | Replica sets | Sharding |
---|---|---|---|
mongod | Yes | Yes | Yes |
Replica sets | Yes( Pri or Sec) | Yes (Pri) | Yes |
Sharding | Yes | Yes | Yes |
from\to | mongod | Replica sets | Sharding |
---|---|---|---|
mongod | — | — | — |
Replica sets | Yes(Pri or Sec) | Yes(Pri) | Yes |
Sharding | Yes | Yes | Yes |
mkdir /data/mongo
mongod --dbpath /data/mogno1 --replSet rs0 --smallfiles --oplogSize 128
mongod --dbpath /data/mongo2 --replSet rs0 --smallfiles --oplogSize 128
mongod --dbpath /data/mongo3 --replSet rs0 --smallfiles --oplogSize 128
mongo;rs.initiate()
mongo;rs.add("node1:27017")
mongo;rs.add("node2:27017")
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有