标签:
1.环境配置
ln -s /usr/src/kernels/2.6.32-573.26.1.el6.x86_64/ /usr/src/linux
如果/usr/src/kernels/下没有东西,先安装kernel-devel(yum install kernel-devel)
2.两台linux按安装keepalived
tar -zxvf keepalived-1.2.19.tar.gz ./configure make make install echo $?
cp /usr/local/etc/rc.d/init.d/keepalived /etc/init.d/ cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/ mkdir /etc/keepalived cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/ cp /usr/local/sbin/keepalived /usr/bin/
/etc/init.d/keepalived start ps -ef|grep keep
3.修改配置文件
主节点:
备节点:
4.测试
5.多实例设置
6.日志设置(keepalived日志默认在/var/log/messages里面):
设置keepalived使其生成一个独立的日志文件:
vim /etc/sysconfig/keepalived #KEEPALIVED_OPTIONS="-D" KEEPALIVED_OPTIONS="-D -S 0 -d" vim /etc/rsyslog.conf #keepalived log local0.* /var/log/keepalived.log [root@server05 ~]# /etc/init.d/rsyslog restart Shutting down system logger: [ OK ] Starting system logger: [ OK ] [root@server05 ~]# /etc/init.d/keepalived restart Stopping keepalived: [ OK ] Starting keepalived:
[root@server05 log]# ll keepalived.log
-rw-------. 1 root root 34922 May 13 18:11 keepalived.log
标签:
原文地址:http://www.cnblogs.com/vijayfly/p/5490130.html