- 进入 keepalived 安装目录
cd /home/software/keepalived-2.0.18
- 进入安装包目录中的 /keepalived/etc/
cd keepalived/etc/
- 执行以下两条 copy 命令
cp init.d/keepalived /etc/init.d/
cp sysconfig/keepalived /etc/sysconfig/
- 刷新系统进程
systemctl daemon-reload
- 使用系统命令操作 keepalived
systemctl start keepalived.service
systemctl stop keepalived.service
systemctl restart keepalived.service
注意:
- 使用
systemctl start keepalived.service
启动 keepalived 才能使用systemctl stop keepalived.service
进行关闭! - 使用
/usr/local/keepalived/sbinkeepalived
方式启动的 keepalived 无法使用systemctl stop keepalived.service
进行关闭,只能采用kill -9 pid
形式进行关闭!