当前位置:网站首页>Kept dual machine hot standby
Kept dual machine hot standby
2022-07-26 08:41:00 【For whom do the stars change】
1、 Realization keepalived+LVS-DR Highly available load balancing web to cluster around
keepalived The role of :
Support for automatic fail over
Support node health status check
2、keepalived Installation and configuration ( In the main 、 On the backup server )
yum -y install keepalived ipvsadm
systemctl enable keepalived ( Boot from boot )
Modify kernel parameter file , close ICMP Redirect
vim /etc/sysctl.conf
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.ens33.send_redirects = 0
sysctl -p
master server keepalived.conf Configuration of
vim /etc/keepalived/keepalived.conf
( The following is the modification )
router_id LVS_DEVEL1 ( This router ( The server ) The name of )
state MASTER ( Hot standby state ,MASTER Represents the primary server )
interface ens33 ( bearing VIP Physical interface of address )
virtual_router_id 51 ( Virtual router ID Number , Each hot standby group is consistent )
priority 100 ( priority , The higher the value, the higher the priority )
virtual_ipaddress {
200.0.0.100 ( Specify the drift address , There can be multiple )
}
virtual_server 200.0.0.100 80 { ( Virtual server address ((ViP)、 port )
delay_loop 15 ( Intervals between health checks ( second ))
lb_algo rr ( polling (rr) Scheduling algorithm )
lb_kind DR ( Direct routing ((DR) Cluster working mode )
nat_mask 255.255.255.0
! persistence_timeout 50 ( Connection retention time ( second ), If enabled, please remove it ! Number )
protocol TCP
real_server 200.0.0.4 80 { ( the second Web The address of the node )
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
real_server 200.0.0.4 80 { ( Third Web The address of the node )
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
Backup server keepalived.conf Configuration of
vim /etc/keepalived/keepalived.conf
router_id LVS_DEVEL2
vrrp_instance VI_1 {
state BACKUP
interface ens33
virtual_router_id 51
priority 90
Other configurations are the same as the main service
Start the service
systemctl start keepalived
systemctl enable keepalived
3、web1 and web2 Server configuration
ifcfg-lo:0 Configure cluster ip Address 200.0.0.100, The subnet mask is 255.255.255.255
cd /etc/sysconfig/network-scripts
cp ifcfg-lo ifcfg-lo:0
vim ifcfg-lo:0
DEVICE=lo:0
IPADDR=200.0.0.100
NETMASK=255.255.255.255
ONBOOT=yes
ifup lo:0
vim /etc/rc.local
/sbin/route add -host 200.0.0.100 dev lo:0
route add -host 200.0.0.100 dev lo:0
Close the part ARP The reply
vim /etc/sysctl.conf
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.arp_ignore = 1
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
sysctl -p
install HTTP Create a test page
yum -y install httpd
vim /var/www/html/index.html
<h1>1111111<h1> (web1 To configure )
<h1>2222222<h1> (web2 To configure )
systemctl restart httpd
systemctl enable httpd
边栏推荐
- Web3 Games: current situation and future
- [GUI] GUI programming; AWT package (interface properties, layout management, event monitoring)
- QT uses QSS to make a beautiful login interface (hand-in-hand teaching)
- 23.2 customizing the banner control display hidden banner modify banner
- Excel find duplicate lines
- Dear teachers, how can sqlserver get DDL in flinkcdc?
- Oracle 19C OCP 1z0-082 certification examination question bank (7-12)
- 23.8 using the applicationrunner or commandlinerunner to implement applicationrunner and commandlinerunner
- The second lesson is the construction of development environment
- 基于C语言的内存管理-动态分区分配方式模拟
猜你喜欢
Mycat2 deploy master-slave MariaDB
After MySQL 8 OCP (1z0-908), hand in your homework
2022-7-9 personal qualifying 6 competition experience
22-07-12 personal training match 1 competition experience
The second lesson is the construction of development environment
Human computer interaction software based on C language
IC's first global hacking bonus is up to US $6million, helping developers venture into web 3!
Leetcode and query question summary
Prefix infix suffix expression (written conversion)
CV learning notes (optical flow)
随机推荐
Kotlin operator
Solve the problem of C # calling form controls across threads
flink oracle cdc 读取数据一直为null,有大佬知道么
shell编程
[untitled]
Problems caused by slivereappbar
Memory management based on C language - Simulation of dynamic partition allocation
Special lecture 2 dynamic planning learning experience (should be updated for a long time)
B title: razlika priority queue approach
File management file system based on C #
Fluent custom popupmenubutton
Error handling response: Error: Syntax error, unrecognized expression: .c-container /deep/ .c-contai
2022年全国职业院校技能大赛“网络安全”竞赛试题文件上传渗透测试答案Flag
Install HR schema, example, and Scott schema on Oracle and MySQL
2022-7-8 personal qualifying 5 competition experience (supplementary)
Alphabetic string
请问现在flinkcdc支持sqlserver实例名方式连接吗?
基于C语言实现的人机交互软件
Spark SQL common date functions
Leetcode and query question summary