From b1865b08b808f5b9cbf841895b78a7be107260a5 Mon Sep 17 00:00:00 2001 From: giteequan Date: Sat, 22 Jul 2023 09:42:44 +0000 Subject: [PATCH 1/2] update keepalived service file. Signed-off-by: giteequan --- .../README.md" | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git "a/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" "b/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" index 15204f1..c2f07a3 100644 --- "a/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" +++ "b/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" @@ -708,6 +708,36 @@ Thank you for using NGINX Plus! root@nginx-plus-1:/# ``` +** service 服务启动脚本更新 ** +在目前的版本中,安装的nginx-ha-keepalived 程序,在service 服务中指定的PID文件是PID文件是/var/run/keepalived.pid,导致服务无法启动,查看日志 +```bash +root@nginx-plus-1:/# tail -f /var/log/syslog +Jul 22 17:32:23 nginx-plus-1 systemd[1]: /lib/systemd/system/nginx.service:9: PIDFile= references a path below legacy directory /var/run/, updating /var/run/nginx.pid → /run/nginx.pid; please update the unit file accordingly. +``` + +需要更新一下PDF文件至 /run/keepalived.pid 即可恢复 +```bash +root@nginx-plus-1:/lib/systemd/system# cat keepalived.service +[Unit] +Description=LVS and VRRP High Availability Monitor +Wants=network-online.target +After=syslog.target network-online.target +# Only start if there is a configuration file +ConditionFileNotEmpty=/etc/keepalived/keepalived.conf + +[Service] +Type=forking + +PIDFile=/run/keepalived.pid + +EnvironmentFile=-/etc/sysconfig/keepalived +ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target +root@nginx-plus-1:/lib/systemd/system# +``` **配置检查** -- Gitee From b74b3f83377ce6c3aa1a845738b63b8415fab8a8 Mon Sep 17 00:00:00 2001 From: giteequan Date: Sat, 22 Jul 2023 09:46:32 +0000 Subject: [PATCH 2/2] update keepalived service file Signed-off-by: giteequan --- .../README.md" | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git "a/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" "b/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" index c2f07a3..306a1e4 100644 --- "a/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" +++ "b/4 NGINX\351\233\206\347\276\244\347\256\241\347\220\206/README.md" @@ -707,8 +707,9 @@ NGINX-HA-keepalived documentation can be found at: Thank you for using NGINX Plus! root@nginx-plus-1:/# -``` -** service 服务启动脚本更新 ** +``` + +**service 服务启动脚本更新** 在目前的版本中,安装的nginx-ha-keepalived 程序,在service 服务中指定的PID文件是PID文件是/var/run/keepalived.pid,导致服务无法启动,查看日志 ```bash root@nginx-plus-1:/# tail -f /var/log/syslog -- Gitee