redis开机启动脚本-systemd

redis服务


[Unit]
Description=Redis persistent key-value database
After=network.target

[Service]
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/bin/redis-server /etc/redis/6379.conf
ExecStop=/usr/bin/redis-shutdown

[Install]
WantedBy=multi-user.target

redis-Sentinel服务


[Unit]
Description=Redis Sentinel
After=network.target

[Service]
ExecStart=/usr/bin/redis-sentinel /etc/redis-sentinel.conf --daemonize no
ExecStop=/usr/bin/redis-shutdown redis-sentinel

[Install]
WantedBy=multi-user.target

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注