一、单库基础环境
单库mongodb操作系统: Ubuntu 14.04 LTS
单库服务器内核版本:3.13.0-24-generic
单库mongodb版本:v2.4.9
二、集群mongos基础环境
集群mongodb操作系统: CentOS release 6.5 (Final)
集群服务器内核版本:2.6.32-431.el6.x86_64
集群mongodb版本:v3.0.2
1.单库正在使用,迁移的时候,停单库业务。
2.主要问题是对业务不是非常熟,造成不清楚如何选择集合的片键,查了相关资料,有建议根据查询条件比较多的字段作为分片的键值,这方面如何选择。
3.迁移中要注意哪些东西,有单库向集群迁移的大牛可方便指点下,或者列出大致的迁移步骤即可,感谢!!
The selection of shard keys is more complicated, and it is not enough to query more fields directly (although this may be an important reason). The official documentation has given a more detailed explanation, please refer to: https://docs.mongodb.org/manual/tutorial...
Standalone to Sharded Cluster is also not that simple.
First of all, you are currently on 2.4 and need to upgrade to 3.0. (We recommend upgrading to 3.2. If you insist on using 3.0, please use 3.0.11 or above) When upgrading, be careful not to skip versions.Be sure to upgrade one by one, 2.4->2.6->3.0-> ;3.2. Upgrade instructions for each version can be found in the official documentation
https://docs.mongodb.org/manual/release-...
http://docs.mongodb.org/manual/release-n...
http ://docs.mongodb.org/manual/release-n...
These are major version upgrades,Be sure to read the instructions carefully before operating
After completion, you can convert standalone to replica set:
https: //docs.mongodb.org/manual/tutorial...
Then convert replica set to sharded cluster:
https://docs.mongodb.org/manual/tutorial...
You can find that everything is official Document correspondence, official documentation is a good resource, please make good use of it.