安装keepalived
作者:互联网
yum install –y popt-devel
?
yum install -y gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
mkdir -pv /usr/local/src
cd /usr/local/src
wget http://www.keepalived.org/software/keepalived-1.4.5.tar.gz --no-check-certificate
tar -zxvf keepalived-1.4.5.tar.gz
cd /usr/local/src/keepalived-1.4.5
./configure --prefix=/usr/local/keepalived --sysconf=/etc
如果系统出现警告:
*** WARNING - this build will not support IPVS with IPv6. Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.
不用担心,我们只需要用到VRRP功能,不需要用IPVS功能,所以请确保以下三项是yes就行了。
Use VRRP Framework : Yes
Use VRRP VMAC : Yes
Use VRRP authentication : Yes
yum -y install libnl libnl-devel
安装完以后重新执行configure
如果出现configure: error: libnfnetlink headers missing
yum install -y libnfnetlink-devel
安装完以后重新执行configure
make && make install
vi /lib/systemd/system/keepalived.service
[Unit]
Description=Keepalived
After= network-online.target syslog.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/var/run/keepalived.pid
ExecStart=/usr/local/keepalived/sbin/keepalived -D
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
标签:local,keepalived,devel,VRRP,usr,install,安装 来源: https://www.cnblogs.com/tonggc1668/p/15785521.html