Note that there are some explanatory texts on larger screens.

plurals
  1. POMongoDB, sharding problems: fail mongos process after config server was crashed
    primarykey
    data
    text
    <p>I have some problems with creating mongoDB shard cluster. I try to use 4 servers: 3 for mongo databases (host1, host2 and host3) and one for application side (for mongos process). On each database server I start 4 processes:</p> <pre>$ mongod --configsvr --smallfiles --noprealloc --port 27020 --dbpath /mongodb/conf --logappend --logpath=/mongodb/logs/logsmongodcfg.log $ mongod --shardsvr --smallfiles --noprealloc --replSet repl1 --port 27030 --dbpath /mongodb/repl1 --logappend --logpath=/mongodb/logs/mongod_shard1.log $ mongod --shardsvr --smallfiles --noprealloc --replSet repl2 --port 27031 --dbpath /mongodb/repl2 --logappend --logpath=/mongodb/logs/mongod_shard2.log $ mongod --shardsvr --smallfiles --noprealloc --replSet repl3 --port 27032 --dbpath /mongodb/repl3 --logappend --logpath=/mongodb/logs/mongod_shard3.log</pre> <p>As you can see on each server in cluster we have one config server and 3 mongod servers for replication implementation. On application server I start only one mongos process:</p> <pre>mongos --configdb host1:27020,host2:27020,host3:27020 --port 27017 --logappend --logpath=/var/log/mongo/mongos.log</pre> <p>After this I try to configure sharding:</p> <pre>mongo 127.0.0.1:27017/admin</pre> <pre>db.runCommand( { addShard : "repl1/host1:27030,host2:27030,host3:27030" } ); db.runCommand( { addShard : "repl2/host1:27031,host2:27031,host3:27031" } ); db.runCommand( { addShard : "repl3/host1:27032,host2:27032,host3:27032" } );</pre> <p>And this scheme is working, but there is one big problem. If i try to shutdown one of the hosts, mongos can't connect to the other hosts and to the new primary replications. In mongos logs I get such information:</p> <pre>Thu Jun 14 21:10:37 [CheckConfigServers] DBClientCursor::init call() failed Thu Jun 14 21:10:37 [ReplicaSetMonitorWatcher] trying reconnect to host1:27030 Thu Jun 14 21:10:42 [ReplicaSetMonitorWatcher] reconnect host1:27030 failed couldn't connect to server host1:27030 Thu Jun 14 21:10:42 [ReplicaSetMonitorWatcher] trying reconnect to host1:27032 Thu Jun 14 21:10:47 [ReplicaSetMonitorWatcher] reconnect host1:27032 failed couldn't connect to server host1:27032 Thu Jun 14 21:10:56 [LockPinger] SyncClusterConnection connecting to [host1:27020]</pre> <p>So if any of 3 config servers goes down mongos got connection exception. What's wrong and how to resolve this problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload