Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Keepalived dual computer hot standby

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1.1.Keepalived was originally designed as a powerful auxiliary tool for LVS, mainly used to provide failover and health check functions-to determine the availability of LVS load dispatchers and node servers, isolate and replace them with new servers in time, and rejoin the cluster when the failed machine recovers.

Hot standby mode of 1.keepalived

Keepalived uses VRRP (Virtual Router Redundancy Protocol Virtual routing redundancy Protocol) hot backup protocol to realize the multi-machine hot backup function of Liunx server in a software way. Each router in the hot standby group can become the primary router, and the IP address (VIP) of the virtual router can be transferred between the routers in the hot standby group, so it is also called a drift IP address.

Installation and Service Control of 2.keepalived

* install keepalided [root @ localhost ~] # rm-rf / etc/yum.repos.d/* [root@localhost ~] # vim / etc/yum.repos.d/a.repo [root@localhost ~] # mount / dev/cdrom / media/mount: / dev/sr0 write protection [root@localhost ~] # yum-y install keepalived ipvsadm loaded plug-in will be mounted read-only: fastestmirror LangpacksA | 3.6 kB 00:00:00 (1 kB 2): A/group_gz | 155 kB 00:00:00 (2 stroke 2): A/primary_db | | 3.0 MB 00:00:00 Loading mirror speeds from cached hostfile is resolving dependencies to control the keepalived service |

After yum installs keepalived, execute the following command to set the keepalived service to boot. [root@localhost] # systemctl enable keepalived.service Created symlink from / etc/systemd/system/multi-user.target.wants/keepalived.service to / usr/lib/systemd/system/keepalived.service.

1.2. Using keepalived to realize dual-computer Hot standby

1) configuration of the primary server

[root@localhost ~] # vim / etc/keepalived/keepalived.conf

Confirm the above configuration, and then start the keepalived service. The master server with the actual state of MASTER will automatically add the VIP address to the ens33 interface, which can be seen through the ip command.

2) configuration of standby server

In the same keepalived hot standby group, the keepalived configuration files of all servers are basically the same, including the ID number of the virtual router, authentication information, drift address, heartbeat rate and so on. The main difference lies in the router name, hot standby status, and priority.

After confirmation, you also need to start the keepalived service. At this time, the primary server is still online, the VIP address is actually still controlled by the primary server, and the other servers are in a standby state, so the VIP address will not be added to the ens33 interface in the standby server.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report