I built up a system in this way
1 replica set shard with 3 nodes
3 config server
1 mongos
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/set1a --port 20001 --rest --shardsvr --replSet set1/172.16.1.193:20002
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/set1b --port 20002 --rest --shardsvr --replSet set1/172.16.1.193:20001
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/set1c --port 20003 --rest --shardsvr --replSet set1/172.16.1.193:20001
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/conf1 --port 30001 --rest --configsvr
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/conf2 --port 30002 --rest --configsvr
/opt/mongodb/bin/mongod --dbpath /var/lib/mongo/conf3 --port 30003 --rest --configsvr
echo 'cfg = {_id: "set1", members:[{_id: 0, host:"172.16.1.193:20001"},{_id: 1, host:"172.16.1.193:20002"}, {_id: 2, host: "172.16.1.193:20003"}]}; rs.initiate(cfg);' | /opt/mongodb/bin/mongo 172.16.1.193:20001
/opt/mongodb/bin/mongos --configdb 172.16.1.193:30001,172.16.1.193:30002,172.16.1.193:30003
echo 'db.runCommand(
{"addshard": "set1/172.16.1.193:20001,172.16.1.193:20002,172.16.1.193:20003"})' | /opt/mongodb/bin/mongo admin
Then I do following operations:
1. shard a database "mytest"
2. shard its collection "mycoll" by _id
3. insert one record
4. find the record and get 'error:
'
- depends on
-
SERVER-1584 sharding + rs issue on getMore
- Closed