0
votes

I am using 64-bit MongoDB, and i am undergoing test on multiple-shards. If i keep multiple shards in a single machine. Its working fine but if i keep shards in different machine, its failed in sharding to second shard. I have restricted the first-shard size to 10MB, once its reaches the limited size in first shard it should start sharding to second-shard but not happening so.Instead failed to store in second-shard updating to first shard. The following are my shard details. In my environment initially i have two shards. The first shard is on my first-machine running along with my application. The Second-shard is on my second machine. Configuration as follows:- *)On both of my shards, shard-server,configserver,mongos and i have connected mongo through mongos as follows ./mongo hostname:27017/admin and i have added both the shards in first & second shard and enabled sharding for database and collection level by using shard-key. Please, let me know if i gone wrong anywhere in the configuration.

Advance Thanks,

1

1 Answers

1
votes

Your post could use some editing, this is very difficult to read.

It looks like you have 2 machines. On each machine you have:

  • mongod process serving as one shard
  • mongod process serving as a config
  • mongos process
  • a copy of your application connecting to localhost:27017/admin

Please, let me know if i gone wrong anywhere in the configuration.

There are several possible problems here. Please check the following:

  1. You can only have 1 or 3 config processes. It looks like you have 2, this will not work.
  2. When you connect to localhost:27017/admin are you connecting to mongos or mongod? Either one could be running on those ports. Can you specify the ports for each process to help clarify? You must connect to mongos or the sharding will not happen.
  3. Please look at the logs, they generally have output indicating what the server is doing. If there is no indication of "splits" or "chunks" happening, then your database may be configured incorrectly.

Your best bet is to start from top and test each piece one at a time.