keepalived的官方网址是http://www.keepalived.org,可以在这里下载到各种版本的keepalived,这里下载的是keepalived-1.2.19.tar.gz。安装步骤如下:
[root@dns ~]# mkdir src_soft
[root@dns ~]# cd src_soft/
[root@dns src_soft]# wget http://www.keepalived.org/software/keepalived-1.2.19.tar.gz
[root@dns src_soft]# tar xzvf keepalived-1.2.19.tar.gz
[root@dns src_soft]# cd keepalived-1.2.19
[root@dns keepalived-1.2.19]# ./configure --prefix=/usr/local/keepalived --sysconf=/etc
configure: error:
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!
解决方法:
[root@dns keepalived-1.2.19]# yum install openssl-devel
重新安装:
[root@dns keepalived-1.2.19]# ./configure --prefix=/usr/local/keepalived --sysconf=/etc
[root@dns keepalived-1.2.19]# make > make.20160403.log
[root@dns keepalived-1.2.19]# make install >install.20160403.log
[root@dns keepalived-1.2.19]# ln -s /usr/local/keepalived/sbin/keepalived /sbin/keepalived
--制作随机启动
[root@dns keepalived-1.2.19]# ln -s /etc/rc.d/init.d/keepalived /etc/rc.d/rc3.d/S100keepalived
在编译选项中,--sysconf指定了keepalived配置文件的安装路径,即路径为/etc/keepalived/keepalived.conf
--完成安装后,执行如下操作:
[root@dns keepalived-1.2.19]# keepalived --help
Usage: keepalived [OPTION...]
-f, --use-file=FILE Use the specified configuration file
-P, --vrrp Only run with VRRP subsystem
-C, --check Only run with Health-checker subsystem
-l, --log-console Log messages to local console
-D, --log-detail Detailed log messages
-S, --log-facility=[0-7] Set syslog facility to LOG_LOCAL[0-7]
-X, --release-vips Drop VIP on transition from signal.
-V, --dont-release-vrrp Don't remove VRRP VIPs and VROUTEs on daemon stop
-I, --dont-release-ipvs Don't remove IPVS topology on daemon stop
-R, --dont-respawn Don't respawn child processes
-n, --dont-fork Don't fork the daemon process
-d, --dump-conf Dump the configuration data
-p, --pid=FILE Use specified pidfile for parent process
-r, --vrrp_pid=FILE Use specified pidfile for VRRP child process
-c, --checkers_pid=FILE Use specified pidfile for checkers child process
-v, --version Display the version number
-h, --help Display this help message
列出了keepalived各种用法,同时表明keepalived已安装成功。
转载于:https://blog.51cto.com/wengxiaoxi/1761992