我是一只小白兔~
分类: 服务器与存储
2016-04-11 14:48:03
点击(此处)折叠或打开
1.建立服务启动脚本,以便使用service命令控制;
(1)复制文件
cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/keepalived
(2)添加执行权限
chmod +x /etc/init.d/keepalived
2.修改/etc/init.d/keepalived文件
将/etc/sysconfig/keepalived修改为. /usr/local/keepalived/etc/sysconfig/keepalived
3.在上述行下添加内容(将keepalived主程序所在路径导入到环境变量PATH中)
PATH="$PATH:/usr/local/keepalived/sbin"
export PATH
4.修改/usr/local/keepalived/etc/sysconfig/keepalived文件,设置正确的服务启动参数
KEEPALIVED_OPTIONS="-D -f /usr/local/keepalived/etc/keepalived/keepalived.conf"
5.至此,keepalived配置完毕,启动
service keepalived restart
6.设置服务为开机启动
chkconfig keepalived on
点击(此处)折叠或打开
点击(此处)折叠或打开
点击(此处)折叠或打开
点击(此处)折叠或打开