Single library mongod(v2.4.9) migrates to replication cluster (v3.0.2) with three slices

  mongodb, question

I. Single-library Basic Environment
Single library mongodb operating system: Ubuntu 14.04 LTS
Single library server kernel version: 3.13.0-24-generic
Single library mongodb version: v2.4.9

II. Cluster mongos Basic Environment
Cluster mongodb operating system: CentOS release 6.5 (Final)
Cluster Server Kernel Version: 2.6.32-431.el6.x86_64
Cluster mongodb version: v3.0.2

1. The single warehouse is in use. During the migration, the single warehouse business will be stopped.
2. The main problem is that they are not very familiar with the business, which makes it unclear how to select the slice keys of the collection. After checking the relevant data, it is suggested to use fields with more query criteria as the key values of the slices. How to select these fields?
3. What should be paid attention to during the migration? Daniel, who has a single library migrating to the cluster, can give directions or list out the general migration steps. Thank you! !

The selection of slice keys is more complicated, not just referring to fields with more queries (although this may be an important reason). Official documents have been described in more detail, please refer to:https://docs.mongodb.org/manual/tutorial …
Standalone to Sharded Cluster are also not so simple.
First of all, you are now 2.4 and need to upgrade to 3.0. (We further suggest upgrading to 3.2. If you insist on using 3.0, please use version 3.0.11 or above) Be careful not to skip the version when upgrading.We must upgrade one by one.,2.4->2.6->3.0->3.2。 Upgrade instructions for each version can be found in official documents.
https://docs.mongodb.org/manual/release- …
http://docs.mongodb.org/manual/release-n …
http://docs.mongodb.org/manual/release-n …
These are major upgrades.Be sure to read the instructions carefully before operating.
After completion, the conversion from standalone to replica set can be performed:
https://docs.mongodb.org/manual/tutorial …
Then make the conversion from replica set to sharded cluster:
https://docs.mongodb.org/manual/tutorial …
It can be found that all things have official documents corresponding to them. Official documents are a good resource. Please make good use of them.