linux 卸载keepalived,CentOS操作系统keepalived安装步骤

1、把keepalived-1.2.2.tar.gz、openssl-1.0.1c.tar.gz、popt-1.16.tar.gz上传至home目录;

2、安装OpenSSL

# cd /home

# tar -zxf openssl-1.0.1c.tar.gz

# cd openssl-1.0.1c/

# ./config  --prefix=/usr/local --openssldir=/usr/local/ssl

# make && make install

# ./config shared --prefix=/usr/local --openssldir=/usr/local/ssl

# make clean

# make && make install

2、安装popt

# cd /home

# tar zxvf popt-1.16.tar.gz

# cd popt-1.16

# ./configure

# make

# make install

3、安装keepalived

# cd /home

# tar -xzvf keepalived-1.2.2.tar.gz

# cd keepalived-1.2.2

# ./configure --prefix=/usr/local/keepalived

# make

# make install clean

4、删除安装文件

# cd /home

# rm -Rf openssl-1.0.1c

# rm -Rf popt-1.16

# rm -Rf keepalived-1.2.2

5、修改keepalived配置文件

把文件keepalived.conf上传至/usr/local/keepalived/etc/keepalived覆盖原有文件

主机修改virtual_ipaddress为虚拟IP地址

从机把priority由100修改为99,并且修改virtual_ipaddress为虚拟IP地址

6、如果使用了iptables,则需要在iptables中加入一条配置

-A INPUT -p vrrp -j ACCEPT

iptables默认配置文件的位置在哪里

/etc/sysconfig/iptables

修改完后,重启iptables:service iptables restart

6、启动keepalived和开机启动

# cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/

# cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/

# mkdir /etc/keepalived

# cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/

# cp /usr/local/keepalived/sbin/keepalived /usr/sbin/

# chkconfig --level 2345 keepalived on

# service keepalived start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值