Redis教程

redis哨兵centos7开机自启动

本文主要是介绍redis哨兵centos7开机自启动,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
[root@vm10-37-2-16 data]# cat /lib/systemd/system/redis-sentinel.service

[Unit]
Description=redis-server
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/redis-server /usr/local/redis/etc/sentinel.conf --sentinel
PrivateTmp=true

[Install]
WantedBy=multi-user.target

 

[root@vm10-37-2-16 data]# cat /lib/systemd/system/redis.service

[Unit]
Description=redis-server
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/redis-server /usr/local/redis/etc/redis.conf
PrivateTmp=true

[Install]
WantedBy=multi-user.target

  

systemctl daemon-reload
systemctl enable redis
systemctl enable redis-sentinel.service

这篇关于redis哨兵centos7开机自启动的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!