当前位置:网站首页>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
边栏推荐
- Hunan University | robust Multi-Agent Reinforcement Learning in noisy environment
- Basic editing specifications and variables of shell script
- Summarize the past to motivate yourself to move on
- Small program graduation project based on wechat reservation small program graduation project opening report reference
- A. Min Max Swap
- LV1 Roche limit
- The "message withdrawal" of a push message push, one click traceless message withdrawal makes the operation no longer difficult
- Yyds dry goods inventory it's not easy to say I love you | use the minimum web API to upload files
- false sharing
- C # learning notes: structure of CS documents
猜你喜欢
Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge
Gee import SHP data - crop image
Mysql-15 aggregate function
Write the first CUDA program
What is the intelligent monitoring system of sewage lifting pump station and does it play a big role
Applet graduation project based on wechat selection voting applet graduation project opening report function reference
High level application of SQL statements in MySQL database (I)
false sharing
Yyds dry goods inventory hand-in-hand teach you the development of Tiktok series video batch Downloader
Johnson–Lindenstrauss Lemma
随机推荐
G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
Key knowledge of embedded driver
Redis transaction
Remember another interview trip to Ali, which ends on three sides
The automatic control system of pump station has powerful functions and diverse application scenarios
Bacteriostatic circle scanning correction template
Network byte order
The difference between int (1) and int (10)
C learning notes: C foundation - Language & characteristics interpretation
Sword finger offer 14- I. cut rope
Gee import SHP data - crop image
[Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)
Flex flexible layout, box in the middle of the page
Portapack application development tutorial (XVII) nRF24L01 launch C
Small program graduation design is based on wechat order takeout small program graduation design opening report function reference
Advanced learning of MySQL -- Application -- storage engine
Winter vacation daily question -- a single element in an ordered array
LV1 previous life archives
Question C: Huffman tree
長文綜述:大腦中的熵、自由能、對稱性和動力學