1、安装keepalived
访问Keepalived官网(http://www.keepalived.org)下载软件包,并上传到服务器上。
或者直接用命令下载并解压:
[root@localhost ~]# tar zxvf keepalived-1.3.4.tar.gz
安装依赖插件:
[root@localhost ~]# yum install -y gcc openssl-devel popt-devel
编译安装:
[root@localhost ~]# cd keepalived-1.3.4
[root@localhost keepalived-1.3.4]# ./configure --prefix=/usr/local/keepalived
[root@localhost keepalived-1.3.4]# make && make install
配置:(后面部分会详细介绍,这里就用默认配置)
启动:
首先拷贝几个文件到CentOS7环境中:
[root@localhost ~]# cp keepalived-1.3.4/keepalived/etc/init.d/keepalived /etc/init.d/
[root@localhost ~]# mkdir /etc/keepalived
[root@localhost ~]# cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
[root@localhost ~]# cp keepalived-1.3.4/keepalived/etc/sysconfig/keepalived /etc/sysconfig/
[root@localhost ~]# cp /usr/local/keepalived/sbin/keepalived /usr/sbin/
执行启动服务:
[root@localhost ~]# service keepalived start
文章评论