先前在開發主機上所安裝的 Redis 雖然手動叫起來了,但是他的服務並未能正常執行。
sudo systemctl status redis-server
去重新啟動 redis server 時 ...× redis-server.service - Advanced key-value store
Loaded: loaded (/usr/lib/systemd/system/redis-server.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-10-08 15:48:24 UTC; 9s ago
Duration: 628us
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 233992 (code=exited, status=1/FAILURE)
CPU: 36ms
Oct 08 15:48:24 ip-172-31-132-147 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 835.
Oct 08 15:48:24 ip-172-31-132-147 systemd[1]: redis-server.service: Start request repeated too quickly.
Oct 08 15:48:24 ip-172-31-132-147 systemd[1]: redis-server.service: Failed with result 'exit-code'.
Oct 08 15:48:24 ip-172-31-132-147 systemd[1]: Failed to start redis-server.service - Advanced key-value store.
/etc/redis/redis.conf
在裡面把預設 Pidfile 建立位置,頂層多加上 /var
後,Supervisor 設定為 systemd/lib/systemd/system/redis-server.service
中,修改 [Service]
段中的 Type=forking
、RestartSec=30
、PIDFile=/var/run/redis/redis-server.pid
Start request repeated too quickly.
造成 Service 排程異常,於是便在 Service 中去修改重啟等待時間。