In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Change the IP address of each server after mongoDB Sharded Cluster migration author: sylar copyright [articles are allowed to be reprinted, but the source address must be indicated by link, otherwise legal liability will be investigated.]
The mongoDB sharding server architecture is shown below:
[background description]
When mongoDB Sharded Cluster is migrated, if you use cold backup or other methods to migrate, and you need to change the IP address information recorded by each node, here's how to change the IP address [replica set]
Modify the master-slave relationship of the replica set of each fragment and the master-slave relationship of the replica set of config as follows
Config=rs.conf ()
Config.members [0] .host = "10.9.110.116virtual 30001"
Rs.reconfig (config, {force:true})
According to the actual situation, change the IP address information of each node. The number of config.members [0] is sorted naturally according to the display of rs.conf (), starting with 0, not id.
[shard part]
Modify the IP address of mongos record fragments
> 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"}
Make the following changes to the above address:
> 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})
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.