MongoDB не перемещает куски в новый шард в кластере шардинга

Я использую mongodb для хранения данных. Кластер MongoDB имеет 3 шарда, каждый шард имеет 3 набора реплик сервера, 2 монго и 3 сервера конфигурации. Каждый сервер имеет 1 ТБ для хранения. Теперь все 2 из 3 шардов имеют данные о 90% емкости. Когда я добавляю новый осколок, MongoDB не перемещает никакие куски из осколка старого в новый. Я проверяю статус шардинга Монго. Это показывает мне это. MongoDB baclancer работает.

mongos> db.printShardingStatus()
--- Sharding Status --- 
  sharding version: {
 "_id" : 1,
 "minCompatibleVersion" : 5,
 "currentVersion" : 6,
 "clusterId" : ObjectId("59c0ef31619ac70cb8ac5f5c")
}
  shards:
 {  "_id" : "rs0",  "host" : "rs0/10.5.36.88:27017,10.5.36.92:27017,10.5.36.93:27017",  "state" : 1,  "maxSize" : 990000 }
 {  "_id" : "rs1",  "host" : "rs1/10.5.36.101:27017,10.5.36.103:27017,10.5.36.97:27017",  "state" : 1,  "maxSize" : 990000 }
 {  "_id" : "rs2",  "host" : "rs2/10.5.36.100:27017,10.5.36.117:27017,10.5.36.126:27017",  "state" : 1,  "maxSize" : 990000 }
 {  "_id" : "rs3",  "host" : "rs3/10.5.36.152:27017,10.5.36.156:27017,10.5.36.164:27017",  "state" : 1,  "maxSize" : 990000 }
  active mongoses:
 "3.4.9" : 1
 autosplit:
 Currently enabled: yes
  balancer:
 Currently enabled:  yes
 Currently running:  yes
  Balancer lock taken at Wed Sep 20 2017 09:21:43 GMT+0700 by ConfigServer:Balancer
 Collections with active migrations: 
  fbgroups.comments started at Wed Nov 22 2017 22:36:15 GMT+0700
 Failed balancer rounds in last 5 attempts:  0
 Migration Results for the last 24 hours: 
  No recent migrations
  databases:
 {  "_id" : "fbpages",  "primary" : "rs0",  "partitioned" : true }
  fbpages.comments
   shard key: { "CommentFbId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 6263
    rs1 6652
    rs2 6175
   too many chunks to print, use verbose if you want to force print
  fbpages.links
   shard key: { "PageFbId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 23
    rs1 23
    rs2 23
   too many chunks to print, use verbose if you want to force print
  fbpages.posts
   shard key: { "PostFbId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 11931
    rs1 11847
    rs2 5043
   too many chunks to print, use verbose if you want to force print
 {  "_id" : "fbgroups",  "primary" : "rs0",  "partitioned" : true }
  fbgroups.comments
   shard key: { "CommentFbId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 6451
    rs1 6451
    rs2 4742
   too many chunks to print, use verbose if you want to force print
  fbgroups.links
   shard key: { "GroupId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 3
    rs1 3
    rs2 3
   { "GroupId" : { "$minKey" : 1 } } -->> { "GroupId" : "1391082767860588" } on : rs2 Timestamp(7, 0) 
   { "GroupId" : "1391082767860588" } -->> { "GroupId" : "1564129037230139" } on : rs0 Timestamp(7, 1) 
   { "GroupId" : "1564129037230139" } -->> { "GroupId" : "172020656162023" } on : rs0 Timestamp(4, 0) 
   { "GroupId" : "172020656162023" } -->> { "GroupId" : "244621675585655" } on : rs0 Timestamp(5, 0) 
   { "GroupId" : "244621675585655" } -->> { "GroupId" : "375231932588613" } on : rs2 Timestamp(6, 0) 
   { "GroupId" : "375231932588613" } -->> { "GroupId" : "506856652708047" } on : rs2 Timestamp(8, 0) 
   { "GroupId" : "506856652708047" } -->> { "GroupId" : "67046218160" } on : rs1 Timestamp(8, 1) 
   { "GroupId" : "67046218160" } -->> { "GroupId" : "878610618830881" } on : rs1 Timestamp(1, 7) 
   { "GroupId" : "878610618830881" } -->> { "GroupId" : { "$maxKey" : 1 } } on : rs1 Timestamp(1, 8) 
  fbgroups.postdata
   shard key: { "_id" : 1 }
   unique: false
   balancing: true
   chunks:
    rs0 91
    rs1 482
    rs2 91
   too many chunks to print, use verbose if you want to force print
  fbgroups.posts
   shard key: { "PostFbId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 26015
    rs1 26092
    rs2 6526
   too many chunks to print, use verbose if you want to force print
 {  "_id" : "test",  "primary" : "rs1",  "partitioned" : true }
 {  "_id" : "intership",  "primary" : "rs1",  "partitioned" : false }
 {  "_id" : "fbhashtags",  "primary" : "rs2",  "partitioned" : true }
  fbhashtags.postdata
   shard key: { "_id" : 1 }
   unique: false
   balancing: true
   chunks:
    rs0 2
    rs1 2
    rs2 2
   { "_id" : { "$minKey" : 1 } } -->> { "_id" : ObjectId("58f122ff7fe5fb4520b4185a") } on : rs0 Timestamp(2, 0) 
   { "_id" : ObjectId("58f122ff7fe5fb4520b4185a") } -->> { "_id" : ObjectId("58fac0537fe5fb051d0749de") } on : rs1 Timestamp(3, 0) 
   { "_id" : ObjectId("58fac0537fe5fb051d0749de") } -->> { "_id" : ObjectId("5906119e7fe5fb2c7d9d41e9") } on : rs0 Timestamp(4, 0) 
   { "_id" : ObjectId("5906119e7fe5fb2c7d9d41e9") } -->> { "_id" : ObjectId("591012257fe5fb70dc9e49bf") } on : rs1 Timestamp(5, 0) 
   { "_id" : ObjectId("591012257fe5fb70dc9e49bf") } -->> { "_id" : ObjectId("5918b5d77fe5fb2feb06338a") } on : rs2 Timestamp(5, 1) 
   { "_id" : ObjectId("5918b5d77fe5fb2feb06338a") } -->> { "_id" : { "$maxKey" : 1 } } on : rs2 Timestamp(1, 5) 
  fbhashtags.posts
   shard key: { "_id" : 1 }
   unique: false
   balancing: true
   chunks:
    rs2 1
   { "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : rs2 Timestamp(1, 0) 
 {  "_id" : "fbprofiles",  "primary" : "rs2",  "partitioned" : true }
  fbprofiles.fbcomments
   shard key: { "commentFbId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 18
    rs1 18
    rs2 19
   too many chunks to print, use verbose if you want to force print
  fbprofiles.fbposts
   shard key: { "postFbId" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 7
    rs1 7
    rs2 3144
   too many chunks to print, use verbose if you want to force print
  fbprofiles.fbprofiles
   shard key: { "baseUrl" : 1 }
   unique: true
   balancing: true
   chunks:
    rs0 2
    rs1 2
    rs2 141
   too many chunks to print, use verbose if you want to force print
 {  "_id" : "testnewfb",  "primary" : "rs2",  "partitioned" : false }
 {  "_id" : "news_images",  "primary" : "rs2",  "partitioned" : false }
 {  "_id" : "social_index",  "primary" : "rs2",  "partitioned" : false }
 {  "_id" : "twitter",  "primary" : "rs2",  "partitioned" : true }
 {  "_id" : "techmeme",  "primary" : "rs2",  "partitioned" : false }

Почему MongoDB не переносит данные в новый шард (rs3) Спасибо!

1 ответ

Решение

Я нашел свою проблему в моем случае. То есть 1 из трех серверов конфигурации Mongo не настроен правильно на всех хостах. Я переконфигурирую мои /etc/hosts и stepDown() основной сервер конфигурации. И я вижу, что это снова работает правильно. Это отнимает много времени. Я злоупотребляю тем, что при сбое сервера электрическим током он не может восстановить прежнее состояние.

Другие вопросы по тегам