您好,登錄后才能下訂單哦!
mongoDB sharding服務器架構如下圖:
config=rs.conf()
config.members[0].host ="10.9.110.116:30001"
rs.reconfig(config,{force:true})
根據實際情況,更改每個節點的IP地址信息,config.members[0]的數字是根據rs.conf()顯示的自然排序來的,從0開始,并非id
【shard部分】
修改mongos記錄分片的IP地址
>use config;
>db.shards.find()
{ "_id" : "kk-comic-test-shard02", "host" : "kk-comic-test-shard02/10.9.70.22:30004,10.9.70.22:30005" }
{ "_id" : "kk-comic-test-shard03", "host" : "kk-comic-test-shard03/10.9.70.22:30007,10.9.70.22:30008" }
{ "_id" : "kk-comic-test-shard01", "host" : "kk-comic-test-shard01/10.9.110.116:30001,10.9.110.116:30002" }
將上述地址進行如下更改:
>db.shards.update( { "_id" : "kk-comic-test-shard02" }, { $set: { "host": "kk-comic-test-shard02/10.9.110.116:30004,10.9.110.116:30005" } }, { multi: true })
>db.shards.update( { "_id" : "kk-comic-test-shard03" }, { $set: { "host": "kk-comic-test-shard03/10.9.110.116:30007,10.9.110.116:30008" } }, { multi: true })
>db.shards.update( { "_id" : "kk-comic-test-shard01" }, { $set: { "host": "kk-comic-test-shard01/10.9.110.116:30001,10.9.110.116:30002" } }, { multi: true })
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。