Home > database >  Mongo using default shard, can only be assigned to the first shard
Mongo using default shard, can only be assigned to the first shard

Time:09-21

 mongos> Sh. The status () 
- Sharding Status -- -- --
Sharding version: {
"_id" : 1,
"MinCompatibleVersion" : 5,
"CurrentVersion" : 6,
"ClusterId" : ObjectId (" 5 b0e2d7ed1f399107bae2836 ")
}
Shards:
{" _id ":" shard1 ", "the host" : "shard1/s05:27020, s06:27020", "state" : 1}
{" _id ":" shard2 ", "the host" : "shard2/s05:27021, s07:27021", "state" : 1}
{" _id ":" shard3 ", "the host" : "shard3/s06:27022, s07:27022", "state" : 1}
The active mongoses:
"3.4.15" : 3
Autosplit:
Currently enabled: yes
Balancer:
Currently enabled: yes
Currently running: no
NaN
Failed balancer rounds in the last 5 attempts: 0
Migration Results for the last 24 hours:
2: Success
The 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}} - & gt;> {" id ": NumberLong (" 6148914691236517204")} on: shard1 Timestamp (3, 2)
{" id ": NumberLong (" 6148914691236517204")} - & gt;> {" id ": NumberLong (" 3074457345618258602")} on: shard1 Timestamp (3, 3)
{" id ": NumberLong (" 3074457345618258602")} - & gt;> {" id ": NumberLong (0)} on: shard2 Timestamp (3, 4)
{" id ": NumberLong (0)} - & gt;> {" id ": NumberLong (" 3074457345618258602")} on: shard2 Timestamp (3, 5)
{" id ": NumberLong (" 3074457345618258602")} - & gt;> {" id ": NumberLong (" 6148914691236517204")} on: shard3 Timestamp (3, 6)
{" id ": NumberLong (" 6148914691236517204")} - & gt;> {" id ": {" $maxKey" : 1}} on: shard3 Timestamp (3, 7)
Testdb. Range
Shard key: {" id ": 1}
Unique: false
Balancing: true
Chunks:
Shard1 1
{" id ": {" $minKey" : 1}} - & gt;> {" id ": {" $maxKey" : 1}} on: shard1 Timestamp (1, 0)
{" _id ":" test ", "primary" : "shard2", "partitioned" : false}


Only a hash subdivision, can even added to the node, three divided by default shard, only added to the first shard shared1, strives for the great god answers,

CodePudding user response:

Is such data range divided enough pieces begin to split and then migrated to other shard

CodePudding user response:

reference 1st floor rucypli response:
range fragmentation is such data enough time begin to split and migrate to other shard

Squad, I think their 3000 data online circular insert can be randomly assigned to more than one piece, is to set up

CodePudding user response:

Note "partitioned" shard2: false should be configured not good oh
  • Related