将keepallived注册为系统服务,方便开启关闭

  1. 找到keepallived解压后释放的文件夹 注:不是安装目录,是下载后的压缩包解压后的文件夹
  2. 进入keepalived/etc文件夹
    将keepallived注册为系统服务,方便开启关闭_第1张图片
  3. 将 init.d/keepalived 复制到 /etc/init.d/ 下
cp init.d/keepalived /etc/init.d/
  1. 将 sysconfig/keepalived 复制到/etc/sysconfig/ 下
cp sysconfig/keepalived /etc/sysconfig/
#注:如果提示覆盖,按y即可
  1. 刷新配置
systemctl daemon-reload
  1. 配置成功后,可用如下命令进行操作
# 启动keepalived
systemctl start keepalived
# 停止keepalived
systemctl stop keepalived
# 重启keepalived
systemctl restart keepalived

你可能感兴趣的:(Keepalived)