Technology Sharing

LVS Keepalived Cluster

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Theoretical part

1: Basic knowledge of Keepalived dual-machine hot standby

1.1: keepalived overview and installation

1: keepalived hot standby mode

2: Installation and service control of keepalived

[root@localhost ~]# systemctl stop NetworkManager

[root@localhost ~]# setenforce 0

[root@localhost ~]# systemctl stop firewalld

[root@localhost ~]# yum -y install keepalived ipvsadm

[root@localhost ~]# systemctl enable keepalived

1.2: Use keepalived to achieve hot standby on two machines

1: Configuration of the primary server

[root@localhost ~]# cd /etc/keepalived/

[root@localhost keepalived]# cp keepalived.conf keepalived.conf.bak

[root@localhost keepalived]# vi keepalived.conf

global_defs {