CentOS 将 Redis 配置为系统服务
创建 redis.service
cd /usr/lib/systemd/system touch redis.service
编辑内容
[Unit] Description=Redis Server After=network.target [Service] PIDFile=/var/run/redis_6379.pid ExecStart=/usr/local/bin/redis-server /etc/redis.conf ExecStop=/usr/local/bin/redis-cli -a passwd shutdown ExecReload=/bin/kill -s HUP $MAINPID [Install] WantedBy=mutli-user.target
重新载入 systemctl 并启动服务
systemctl daemon-reload systemctl start redis.service
查看状态
systemctl status redis.service
关闭 Redis
systemctl stop redis.service
开机自启
systemctl enable redis.service
是否开机自启
systemctl is-enabled redis.service
本文首发于本人博客
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04