当前位置:网站首页>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 -pmaster 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:0Close 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 -pinstall 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
边栏推荐
- Flutter compilation fails
- Super potential public chain dfinity -- the best time for DFI developers to enter
- Poor English, Oracle OCP or MySQL OCP exam can also get a high score of 80 points
- The full name of flitter IDFA is identity for advertisers, that is, advertising identifiers. It is used to mark users. At present, it is most widely used for advertising, personalized recommendation,
- Flutter distribution
- 基于C语言实现的人机交互软件
- Human computer interaction software based on C language
- 基于Raft共识协议的KV数据库
- Code cloud change remote warehouse command
- Oracle 19C OCP 1z0-082 certification examination question bank (19-23)
猜你喜欢

Shell programming

Cadence(十)走线技巧与注意事项

Registration of finite element learning knowledge points

Foundry tutorial: writing scalable smart contracts in various ways (Part 1)

2022-7-7 personal qualifying 4 competition experience

MySQL 8.0 OCP (1z0-908) has a Chinese exam

【C语言】程序员筑基功法——《函数栈帧的创建与销毁》

IC's first global hacking bonus is up to US $6million, helping developers venture into web 3!

【FreeSwitch开发实践】使用SIP客户端Yate连接FreeSwitch进行VoIP通话

Transfer guide printing system based on C language design
随机推荐
Spark persistence strategy_ Cache optimization
Maximum common substring & regularity problem
Super nice navigation page (static page)
1、 Redis data structure
Redis advanced
各位老师,请问在flinkcdc中,sqlserver如何获取到ddl?
请问flink sql client 在sink表,有什么办法增大写出速率吗。通过sink表的同步时
【FreeSwitch开发实践】自定义模块创建与使用
2022-7-4 personal qualifying 1 competition experience
Excel delete blank lines
Which financial product has the highest yield in 2022?
Storage of drawings (refined version)
Oracle 19C OCP 1z0-082 certification examination question bank (42-50)
File management file system based on C #
Automation and disconnection monitoring of video addition
Spark scheduling analysis
[C language] programmer's basic skill method - "creation and destruction of function stack frames"
JS工具函数大全
Huffman transformation software based on C language
Use of room database in kotlin