In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Delete a slave node:
# redis-trib.rb del-node 192.168.2.202:6380 e4dc23dc67418bf66c6c63655110612cb9516aff
/ / del-node host:port node-id
>
> Sending CLUSTER FORGET messages to the cluster...
> > SHUTDOWN the node.
View cluster node information:
# redis-trib.rb check 192.168.2.100 6379 (confirm that the slave node has been deleted)
> Performing Cluster Check (using node 192.168.2.100)
M: 098e7eb756b6047fde988ab3c0b7189e1724ecf5 192.168.2.100:6379
Slots:333-5460 (5128 slots) master
1 additional replica (s)
S: 7119dec91b086ca8fe69f7878fa42b1accd75f0f 192.168.2.100:6380
Slots: (0 slots) slave
Replicates 5844b4272c39456b0fdf73e384ff8c479547de47
Delete a master node:
First remove the hash slot from the master, then delete the master.
Currently, the slot cannot be deleted directly. The slot of the deleted master should be migrated to other master nodes.
# redis-trib.rb reshard 192.168.2.100 6379 / / slot migrate to 2.100
How many slots do you want to move (from 1 to 16384)? 1000
/ / how many slot are migrated? (how many slot are there on the master node to be deleted)
What is the receiving node ID? 098e7eb756b6047fde988ab3c0b7189e1724ecf5
/ / what is the ID when migrating to that node? (whose ID slot is migrated to and whose ID is written)
Please enter all the source node IDs.
Type 'all' to use all the nodes as source nodes for the hash slots.
Type 'done' once you entered all the source nodes IDs.
Source node # 1:8326ff0be199fa0d4db74f0ebcc58f27e65991b4
/ / ID of the deleted master
Source node # 2:done / / indicates the end
......
Do you want to proceed with the proposed reshard plan (yes/no)? Yes
/ / are you satisfied with the hash slot mobility plan?
Remove the master to be deleted from the cluster:
# redis-trib.rb del-node 192.168.2.100:6379 8326ff0be199fa0d4db74f0ebcc58f27e65991b4
/ / IP of any node in the cluster: Port, ID of the master to be deleted
Change the master to which the slave node belongs:
In the current configuration, 192.168.2.100VR 6380 belongs to 192.168.2.200RV 6379
Change the membership of 192.168.2.100purl 6380 to 192.168.2.100purl 6379
1. Login method specifies the IP and port of the membership to be changed
2. When changing the membership, directly specify the ID of the new master node
# redis-cli-c-h 192.168.2.100-p 6380
> cluster nodes
5844b4272c39456b0fdf73e384ff8c479547de47 192.168.2.200 5844b4272c39456b0fdf73e384ff8c479547de47 6379 master-0 1527165062499 3 connected 5795-10922
2faf68564a70372cfc06c1afff197019cc6a39f3 192.168.2.201:6380 slave 3ff3a74f9dc41f8bc635ab845ad76bf77ffb0f69 0 1527165063511 6 connected
098e7eb756b6047fde988ab3c0b7189e1724ecf5 192.168.2.100 098e7eb756b6047fde988ab3c0b7189e1724ecf5 6379 master-0 1527165060482 10 connected 0-5794 10923-11255
227f51028bbe827f27b4e40ed7a08fcc7d8df969 192.168.2.200:6380 slave 098e7eb756b6047fde988ab3c0b7189e1724ecf5 0 1527165059474 10 connected
7119dec91b086ca8fe69f7878fa42b1accd75f0f 192.168.2.100:6380 myself,slave 5844b4272c39456b0fdf73e384ff8c479547de47 00 2 connected
3ff3a74f9dc41f8bc635ab845ad76bf77ffb0f69 192.168.2.201 6379 master-0 1527165058465 5 connected 11256-16383
192.168.2.100purl 6380 >
192.168.2.100 6380 > cluster replicate 098e7eb756b6047fde988ab3c0b7189e1724ecf5
OK
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.