keepalived 安装:
1 2 3 4 5 6 7 8 9 10 11 12 |
cd <keepalived_sourcecode_path> ./configure --prefix=/usr/local/keepalived make && make install mkdir /etc/keepalived mkdir /etc/keepalived/scripts cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/ cp /root/keepalived-2.0.6/keepalived/etc/init.d/keepalived /etc/init.d/ cp /usr/local/keepalived/sbin/keepalived /sbin/keepalived cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/ chmod +x /etc/init.d/keepalived |
由于在默认状态下keepalived的日志会写入到/var/log/message中,我们需要将此剥离出来。 在centos 6下可以:
1 2 3 4 5 6 |
(1)首先修改/etc/sysconfig/keepalived文件,注释掉如下,添加如下: #KEEPALIVED_OPTIONS="-D" KEEPALIVED_OPTIONS="-D -d -S 0" (2)其次修改 /etc/rsyslog.conf 文件,添加如下: local0.* /var/log/keepalived.log |
[…]