-
Type: Bug
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.0.6
-
Component/s: Sharding
-
Labels:None
-
Environment:OS: SLES 11 SP3, Linux version 3.0.101-0.40-default (geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) ) #1 SMP Thu Sep 18 13:09:38 UTC 2014 (44b8c95)
Memory: 96GB
MongoDB: mongodb-linux-x86_64-suse11-3.0.6.tgz
StoreEngine:WiredTiger
-
ALL
I used three linux server create a sharded system with 3 shard server, 3 config server, 3 mongos, and used ycsb import 1000,000,0 records, then use ycsb write and read (50% to 50%) to test the mongodb, the config server will sometimes stop response, and the ycsb show 0 ops/sec.
I tested with MongoDB 3.0.4 and 3.0.6. There are all have this problem.
How to create the shard system:
- create folder
mkdir -p /opt/qyy/data/mongodb/mongos/log mkdir -p /opt/qyy/data/mongodb/config/data mkdir -p /opt/qyy/data/mongodb/config/log mkdir -p /opt/qyy/data/mongodb/shard1/data mkdir -p /opt/qyy/data/mongodb/shard1/log mkdir -p /opt/qyy/data/mongodb/shard2/data mkdir -p /opt/qyy/data/mongodb/shard2/log mkdir -p /opt/qyy/data/mongodb/shard3/data mkdir -p /opt/qyy/data/mongodb/shard3/log
- start config server on 3 linux servers
numactl --interleave=all ./mongod --configsvr --dbpath /opt/qyy/data/mongodb/config/data --port 27019 --logpath /opt/qyy/data/mongodb/config/log/config.log --fork --smallfiles --maxConns=65535 --storageEngine wiredTiger
- start router server on 3 linux servers
numactl --interleave=all ./mongos --configdb 10.68.160.95:27019,10.68.160.96:27019,10.68.160.100:27019 --port 27017 --logpath /opt/qyy/data/mongodb/mongos/log/mongos.log --fork
- start shard server on 3 linux servers
numactl --interleave=all ./mongod --shardsvr --replSet shard1 --port 27020 --dbpath /opt/qyy/data/mongodb/shard1/data --logpath /opt/qyy/data/mongodb/shard1/log/shard1.log --fork --oplogSize 10240 --storageEngine wiredTiger numactl --interleave=all ./mongod --shardsvr --replSet shard2 --port 27021 --dbpath /opt/qyy/data/mongodb/shard2/data --logpath /opt/qyy/data/mongodb/shard2/log/shard2.log --fork --oplogSize 10240 --storageEngine wiredTiger numactl --interleave=all ./mongod --shardsvr --replSet shard3 --port 27022 --dbpath /opt/qyy/data/mongodb/shard3/data --logpath /opt/qyy/data/mongodb/shard3/log/shard3.log --fork --oplogSize 10240 --storageEngine wiredTiger
- init Replica set
./mongo 10.68.160.95:27020 use admin config = { _id:"shard1", members:[{_id:0,host:"10.68.160.95:27020",priority:2},{_id:1,host:"10.68.160.96:27020",priority:1},{_id:2,host:"10.68.160.100:27020",priority:0.7}]} rs.initiate(config); exit ./mongo 10.68.160.96:27021 use admin config = { _id:"shard2", members:[{_id:0,host:"10.68.160.95:27021",priority:0.7},{_id:1,host:"10.68.160.96:27021",priority:2},{_id:2,host:"10.68.160.100:27021",priority:1}]} rs.initiate(config); exit ./mongo 10.68.160.100:27022 use admin config = { _id:"shard3", members:[{_id:0,host:"10.68.160.95:27022",priority:1},{_id:1,host:"10.68.160.96:27022",priority:0.7},{_id:2,host:"10.68.160.100:27022",priority:2}]} rs.initiate(config); exit
- add replica set to shard
./mongo 10.68.160.95:27017 use admin db.runCommand( { addshard:"shard1/10.68.160.95:27020,10.68.160.96:27020,10.68.160.100:27020"}); db.runCommand( { addshard : "shard2/10.68.160.95:27021,10.68.160.96:27021,10.68.160.100:27021"}); db.runCommand( { addshard : "shard3/10.68.160.95:27022,10.68.160.96:27022,10.68.160.100:27022"});
- shard collection
db.runCommand( { enablesharding :"mydb"}); db.runCommand( { shardcollection : "mydb.usertable", key:{_id: 'hashed'} } );
- use ycsb to import records to mydb
- use ycsb to test read and write(50%read 50%write or 80%read 20%write) through mongo router server.