mongos> sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"minCompatibleVersion" : 5,
"currentVersion" : 6,
"clusterId" : ObjectId("5b0e2d7ed1f399107bae2836")
}
shards:
{ "_id" : "shard1", "host" : "shard1/s05:27020,s06:27020", "state" : 1 }
{ "_id" : "shard2", "host" : "shard2/s05:27021,s07:27021", "state" : 1 }
{ "_id" : "shard3", "host" : "shard3/s06:27022,s07:27022", "state" : 1 }
active mongoses:
"3.4.15" : 3
autosplit:
Currently enabled: yes
balancer:
Currently enabled: yes
Currently running: no
NaN
Failed balancer rounds in last 5 attempts: 0
Migration Results for the last 24 hours:
2 : Success
databases:
{ "_id" : "testdb", "primary" : "shard1", "partitioned" : true }
testdb.hashed
shard key: { "id" : "hashed" }
unique: false
balancing: true
chunks:
shard1 2
shard2 2
shard3 2
{ "id" : { "$minKey" : 1 } } -->> { "id" : NumberLong("-6148914691236517204") } on : shard1 Timestamp(3, 2)
{ "id" : NumberLong("-6148914691236517204") } -->> { "id" : NumberLong("-3074457345618258602") } on : shard1 Timestamp(3, 3)
{ "id" : NumberLong("-3074457345618258602") } -->> { "id" : NumberLong(0) } on : shard2 Timestamp(3, 4)
{ "id" : NumberLong(0) } -->> { "id" : NumberLong("3074457345618258602") } on : shard2 Timestamp(3, 5)
{ "id" : NumberLong("3074457345618258602") } -->> { "id" : NumberLong("6148914691236517204") } on : shard3 Timestamp(3, 6)
{ "id" : NumberLong("6148914691236517204") } -->> { "id" : { "$maxKey" : 1 } } on : shard3 Timestamp(3, 7)
testdb.range
shard key: { "id" : 1 }
unique: false
balancing: true
chunks:
shard1 1
{ "id" : { "$minKey" : 1 } } -->> { "id" : { "$maxKey" : 1 } } on : shard1 Timestamp(1, 0)
{ "_id" : "test", "primary" : "shard2", "partitioned" : false }
只有hash分片,能均勻添加到三個分片節點。而默認分片,則只能添加到第一個分片shared1。求大神解答。
uj5u.com熱心網友回復:
range分片是這樣的 資料足夠多的時候 片開始分裂 然后遷移片到別的shard上uj5u.com熱心網友回復:
班主,我看網上他們的3000資料回圈插入就可以隨機分配到多個片上,是要設定什么嗎
uj5u.com熱心網友回復:
注意shard2 的 "partitioned" : false 應該是配置沒搞好哦轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/60885.html
標籤:MongoDB
上一篇:請教一個mysql 死鎖的問題
