vim /etc/init.d/keepalived#. /etc/sysconfig/keepalived #此行注释. /usr/local/keepalived/etc/sysconfig/keepalived #此两行添加export PATH="$PATH:/usr/loccal/keepalived/sbin" #将keepalived 主程序所在的路径导入到环境变量PATH中
keepalived 可在安装后的目录里查找,然后复制到/etc/init.d/目录下
注意:$PATH:/usr 后连接符是冒号
此时还无法启动,需要继续修改
vim /usr/local/keepalived/etc/sysconfig/keepalivedKEEPALIVED_OPTIONS="-D"改为KEEPALIVED_OPTIONS="-D -f /usr/local/keepalived/etc/keepalived/keepalived.conf" #修改制定keepalived要加载的配置文件,配置服务启动参数