Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20388

Run Mongo 3.0 in sharded system(StoreEngine WiredTiger), config server will always inconsistent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.0.6
    • Fix Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Environment:
    • Operating System:
      ALL

      Description

      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:

      1. 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
        

      2. 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
        

      3. 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
        

      4. 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
        

      5. 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
        

      6. 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"});
        

      7. shard collection

        db.runCommand( { enablesharding :"mydb"});
        db.runCommand( { shardcollection : "mydb.usertable", key:{_id: 'hashed'} } );
        

      8. use ycsb to import records to mydb
      9. use ycsb to test read and write(50%read 50%write or 80%read 20%write) through mongo router server.

        Attachments

          Activity

            People

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            qianyiyong@huawei.com qianyiyong
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: