linux安装和配置keepalived,史上最简单的教程
解决方法:
之前我都是到网上把keepalived-2.0.7.tar.gz下载下来安装配置,都不成功,所以试试用命令行安装,感觉超级方便,没错误。
我的主机是centos6.6,执行以下命令即可安装,如果有错误就先解决错误:
yum -y install keepalived
启动执行命令:service keepalived start
检测是否安装成功:
执行ps -ef|grep keepalived,正确的话会有几行,不成功就只有root 12666 6800 0 09:36 pts/0 00:00:00 grep keepalived这句话
root 12651 1 0 09:35 ? 00:00:00 /usr/sbin/keepalived -D
root 12652 12651 0 09:35 ? 00:00:00 /usr/sbin/keepalived -D
root 12653 12651 0 09:35 ? 00:00:00 /usr/sbin/keepalived -D
root 12666 6800 0 09:36 pts/0 00:00:00 grep keepalived
要配置keepalived结合nginx实现主从的话可以到/etc/keepalived/keepalived.conf中配置
日志路径:/var/log/message