142536a 发表于 2018-10-24 13:46:38

mongodb+分片集群+ycsb测试一例

#看看现在的状态,很长  
mongos>sh.status()
  
--- Sharding Status ---
  
sharding version: {
  
      "_id" : 1,
  
      "minCompatibleVersion" : 5,
  
      "currentVersion" : 6,
  
      "clusterId" : ObjectId("5a69925ee61d3e7c0519035a")
  
}
  
shards:
  
      {"_id" : "shard0000","host" : "10.21.1.206:40001" }
  
      {"_id" : "shard0001","host" : "10.21.1.207:40001" }
  
      {"_id" : "shard0002","host" : "10.21.1.208:40001" }
  
      {"_id" : "shard0003","host" : "10.21.1.209:40001" }
  
      {"_id" : "shard0004","host" : "10.21.1.210:40001" }
  
      {"_id" : "shard0005","host" : "10.21.1.211:40001" }
  
      {"_id" : "shard0006","host" : "10.21.1.212:40001" }
  
active mongoses:
  
      "3.2.18" : 1
  
balancer:
  
      Currently enabled:yes
  
      Currently running:no
  
      Failed balancer rounds in last 5 attempts:5
  
      Last reported error:Connection refused
  
      Time of Reported error:Thu Feb 01 2018 14:26:07 GMT+0800 (CST)
  
      Migration Results for the last 24 hours:
  
databases:
  
      {"_id" : "ycsb","primary" : "shard0000","partitioned" : true }
  
                ycsb.usertable
  
                        shard key: { "_id" : "hashed" }
  
                        unique: false
  
                        balancing: true
  
                        chunks:
  
                              shard0000    2
  
                              shard0001    2
  
                              shard0002    2
  
                              shard0003    2
  
                              shard0004    2
  
                              shard0005    2
  
                              shard0006    2
  
                        { "_id" : { "$minKey" : 1 } } -->> { "_id" : NumberLong("-7905747460161236400") } on : shard0000 Timestamp(7, 2)
  
                        { "_id" : NumberLong("-7905747460161236400") } -->> { "_id" : NumberLong("-6588122883467697000") } on : shard0000 Timestamp(7, 3)
  
                        { "_id" : NumberLong("-6588122883467697000") } -->> { "_id" : NumberLong("-5270498306774157600") } on : shard0001 Timestamp(7, 4)
  
                        { "_id" : NumberLong("-5270498306774157600") } -->> { "_id" : NumberLong("-3952873730080618200") } on : shard0001 Timestamp(7, 5)
  
                        { "_id" : NumberLong("-3952873730080618200") } -->> { "_id" : NumberLong("-2635249153387078800") } on : shard0002 Timestamp(7, 6)
  
                        { "_id" : NumberLong("-2635249153387078800") } -->> { "_id" : NumberLong("-1317624576693539400") } on : shard0002 Timestamp(7, 7)
  
                        { "_id" : NumberLong("-1317624576693539400") } -->> { "_id" : NumberLong(0) } on : shard0003 Timestamp(7, 8)
  
                        { "_id" : NumberLong(0) } -->> { "_id" : NumberLong("1317624576693539400") } on : shard0003 Timestamp(7, 9)
  
                        { "_id" : NumberLong("1317624576693539400") } -->> { "_id" : NumberLong("2635249153387078800") } on : shard0004 Timestamp(7, 10)
  
                        { "_id" : NumberLong("2635249153387078800") } -->> { "_id" : NumberLong("3952873730080618200") } on : shard0004 Timestamp(7, 11)
  
                        { "_id" : NumberLong("3952873730080618200") } -->> { "_id" : NumberLong("5270498306774157600") } on : shard0005 Timestamp(7, 12)
  
                        { "_id" : NumberLong("5270498306774157600") } -->> { "_id" : NumberLong("6588122883467697000") } on : shard0005 Timestamp(7, 13)
  
                        { "_id" : NumberLong("6588122883467697000") } -->> { "_id" : NumberLong("7905747460161236400") } on : shard0006 Timestamp(7, 14)
  
                        { "_id" : NumberLong("7905747460161236400") } -->> { "_id" : { "$maxKey" : 1 } } on : shard0006 Timestamp(7, 15)
  
#看看有什么数据库
  
mongos> show dbs
  
config    0.007GB
  
ycsb      0.000GB
  
#登进目标数据库
  
mongos> use ycsb
  
switched to db ycsb
  
#查看数据库的状态
  
mongos> db.stats()
  
{
  
    "raw" : {
  
      "10.21.1.206:40001" : {
  
            "db" : "ycsb",
  
            "collections" : 1,
  
            "objects" : 0,
  
            "avgObjSize" : 0,
  
            "dataSize" : 0,
  
            "storageSize" : 4096,
  
            "numExtents" : 0,
  
            "indexes" : 2,
  
            "indexSize" : 8192,
  
            "ok" : 1
  
      },
  
      "10.21.1.207:40001" : {
  
            "db" : "ycsb",
  
            "collections" : 1,
  
            "objects" : 0,
  
            "avgObjSize" : 0,
  
            "dataSize" : 0,
  
            "storageSize" : 4096,
  
            "numExtents" : 0,
  
            "indexes" : 2,
  
            "indexSize" : 8192,
  
            "ok" : 1
  
      },
  
      "10.21.1.208:40001" : {
  
            "db" : "ycsb",
  
            "collections" : 1,
  
            "objects" : 0,
  
            "avgObjSize" : 0,
  
            "dataSize" : 0,
  
            "storageSize" : 4096,
  
            "numExtents" : 0,
  
            "indexes" : 2,
  
            "indexSize" : 8192,
  
            "ok" : 1
  
      },
  
      "10.21.1.209:40001" : {
  
            "db" : "ycsb",
  
            "collections" : 1,
  
            "objects" : 0,
  
            "avgObjSize" : 0,
  
            "dataSize" : 0,
  
            "storageSize" : 4096,
  
            "numExtents" : 0,
  
            "indexes" : 2,
  
            "indexSize" : 8192,
  
            "ok" : 1
  
      },
  
      "10.21.1.210:40001" : {
  
            "db" : "ycsb",
  
            "collections" : 1,
  
            "objects" : 0,
  
            "avgObjSize" : 0,
  
            "dataSize" : 0,
  
            "storageSize" : 4096,
  
            "numExtents" : 0,
  
            "indexes" : 2,
  
            "indexSize" : 8192,
  
            "ok" : 1
  
      },
  
      "10.21.1.211:40001" : {
  
            "db" : "ycsb",
  
            "collections" : 1,
  
            "objects" : 0,
  
            "avgObjSize" : 0,
  
            "dataSize" : 0,
  
            "storageSize" : 4096,
  
            "numExtents" : 0,
  
            "indexes" : 2,
  
            "indexSize" : 8192,
  
            "ok" : 1
  
      },
  
      "10.21.1.212:40001" : {
  
            "db" : "ycsb",
  
            "collections" : 1,
  
            "objects" : 0,
  
            "avgObjSize" : 0,
  
            "dataSize" : 0,
  
            "storageSize" : 4096,
  
            "numExtents" : 0,
  
            "indexes" : 2,
  
            "indexSize" : 8192,
  
            "ok" : 1
  
      }
  
    },
  
    "objects" : 0,
  
    "avgObjSize" : 0,
  
    "dataSize" : 0,
  
    "storageSize" : 28672,
  
    "numExtents" : 0,
  
    "indexes" : 14,
  
    "indexSize" : 57344,
  
    "fileSize" : 0,
  
    "extentFreeList" : {
  
      "num" : 0,
  
      "totalSize" : 0
  
    },
  
    "ok" : 1
  
}


baodeyun 发表于 2018-10-24 20:07:15

很细致
页: [1]
查看完整版本: mongodb+分片集群+ycsb测试一例