当前位置:网站首页>Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
2022-07-04 02:26:00 【Daxin brother 666】
Be careful : Be sure to turn off the firewall test first , First, we can ensure that the test passes .
If the server must use a firewall , Then after the test is correct , Run... By command VRRP Routing redundancy protocol .
Allow multicast , Both devices need to perform
iptables -A INPUT -d 224.0.0.18 -j ACCEPT
Or modify :vim /etc/sysconfig/iptables
Add rows in place :
-A INPUT -d 224.0.0.18 -j ACCEPT
- 1.
- 2.
- 3.
- 4.
- 5.
By default keepalived There is a master server (master, Later it will be called M The server ), A standby server (backup, Later it will be called B The server ). Under normal circumstances M The server takes over VIP Become 【 Lord 】, When M When the server goes down ,B The server takes over VIP Become 【 Lord 】, The effect of disaster recovery has been achieved , If M The server is back to normal again , that M The server will recover VIP Become 【 Lord 】 B The server becomes 【 To prepare 】.
The core configuration is as follows , Configuration here is incomplete , We need to pay attention to :
Master To configure
vrrp_instance VI_1 {
state MASTER
interface eno16777736
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.80.120
}
#notify_master /home/keepshell/notify_master.sh
#notify_backup /home/keepshell/notify_backup.sh
#notify_fault /home/keepshell/notify_fault.sh
#notify_stop /home/keepshell/notify_stop.sh
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
Backup To configure
vrrp_instance VI_1 {
state BACKUP
interface eno16777736
virtual_router_id 51
nopreempt
priority 90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.80.120
}
#notify_master /home/keepshell/notify_master.sh
#notify_backup /home/keepshell/notify_backup.sh
#notify_fault /home/keepshell/notify_fault.sh
#notify_stop /home/keepshell/notify_stop.sh
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
Sometimes we need M Do not take over again after the server returns to normal VIP, Give Way B The server continues to be 【 Lord 】 Let later return to normal M The server is 【 To prepare 】.
modify Master To configure , Backup The configuration of the server remains unchanged .
vrrp_instance VI_1 {
state BACKUP
interface eno16777736
virtual_router_id 51
priority 100
nopreempt
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.80.120
}
notify_master /home/keepshell/notify_master.sh
notify_backup /home/keepshell/notify_backup.sh
notify_fault /home/keepshell/notify_fault.sh
notify_stop /home/keepshell/notify_stop.sh
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
state MASTER It is amended as follows state BACKUP nopreempt Set not to snatch VIP
you 're right , modify M,B Server's state BACKUP All for 【 To prepare 】 type , Simultaneous setting nopreempt Set not to snatch VIP, And then start M The server ,M The server will become 【 Lord 】,
Then start B The server , because M High priority 【priority 100】 therefore B Won't rob VIP, At this time M Downtime ,B Become 【 Lord 】, next M Back to normal , Due to the nopreempt therefore M Won't rob VIP,B Continue for 【 Lord 】 and M by 【 To prepare 】.
Technology exchange group : 212320390
边栏推荐
- Yyds dry goods inventory it's not easy to say I love you | use the minimum web API to upload files
- PTA tiantisai l1-079 tiantisai's kindness (20 points) detailed explanation
- 17. File i/o buffer
- The automatic control system of pump station has powerful functions and diverse application scenarios
- 14. Process time
- What are the conditions for the opening of Tiktok live broadcast preview?
- Network communication basic kit -- IPv4 socket structure
- A fan summed up so many interview questions for you. There is always one you need!
- Write the first CUDA program
- Keep an IT training diary 055- moral bitch
猜你喜欢
What is the intelligent monitoring system of sewage lifting pump station and does it play a big role
在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
Save Private Ryan - map building + voltage dp+deque+ shortest circuit
Remember another interview trip to Ali, which ends on three sides
Small program graduation project based on wechat examination small program graduation project opening report function reference
[leetcode daily question] a single element in an ordered array
Network communication basic kit -- IPv4 socket structure
Will the memory of ParticleSystem be affected by maxparticles
Buuctf QR code
Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge
随机推荐
Reading notes - learn to write: what is writing?
MySQL workbench use
Small program graduation project based on wechat reservation small program graduation project opening report reference
Crawler practice website image batch download
Day05 branch and loop (II)
Libcblas appears when installing opencv import CV2 so. 3:cannot open shared object file:NO such file or directory
STM32 key content
C # learning notes: structure of CS documents
Override and virtual of classes in C #
Will the memory of ParticleSystem be affected by maxparticles
Neo4j learning notes
MySQL advanced (Advanced) SQL statement (I)
Small program graduation project based on wechat examination small program graduation project opening report function reference
The automatic control system of pump station has powerful functions and diverse application scenarios
Keep an IT training diary 055- moral bitch
Properties of binary trees (numerical aspects)
The "two-way link" of pushing messages helps app quickly realize two-way communication capability
2022 electrician (elementary) examination question bank and electrician (elementary) simulation examination question bank
Jerry's update contact [article]
What are the main investment products of bond funds and what are they