1. Install ipvs
Go to /opt/software/Packages/
rpm -ivh libnl-1.1.4-2.e16.x86_64.rpm
rpm -ivh libnl-devel-1.1.4-2.e16.x86_64.rpm
rpm -ivh libnfnetlink-1.0.0-1.e16.x86_64.rpm
rpm -ivh ipvsadm-1.26-4.e16.x86_64.rpm
2. Install keepalived dependencies
2.1 libnfnetlink-devel-1.0.0-1.el6.x86_64.rpm
Go to /opt/software
rpm -ivh libnfnetlink-devel-1.0.0-1.el6.x86_64.rpm
2.2 Install nmap
Go to /opt/software/Packages
rpm -ivh libpcap-1.4.0-4.20130826git2dbcaa1.e16.x86_64.rpm
rpm -ivh nmap-5.51-4.e16.x86_64.rpm
3. Install keepalived
Go to /opt/software/
Find keepalived-1.2.16.tar.gz
Extract to the current directory tar -zxvf keepalived-1.2.16.tar.gz
Enter the directory cd keepalived-1.2.16
Enter the installation command:
./configure --prefix=/usr/common/keepalived
make
make install
4. Copy the configuration file
4.1 Confirm whether the shell script exists and is executable
/opt/shell/checkNginx.sh
4.2 Confirm whether the keepalived related configuration exists
Configuration file location /opt/conf/keepalived.conf
4.3 Start keepalived
/usr/common/keepalived/sbin/keepalived -f /opt/conf/keepalived.conf