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服务架构分析与搭建


下一篇:mybatis学习笔记:注解开发CRUD和Lombok