mongodb 副本集能否方便的扩展为分片的方式而不用停机?
分片的方式用的机子有点多,能不能做一个副本集使用,到需要分片来提高性能的时候再建立多个副本集,然后使用路由,控制服务器组成分片的集群?
ringa_lee2017-04-26 09:03:52
Yes.
See the official tutorial here: Convert a Replica Set to a Replicated Sharded Cluster
The prerequisite for smooth migration is to have a config server and all requests go through mongos. Since the subject already has a replica-set, the prerequisites are already met, so there should be no problem with smooth expansion.