Linux 添加redis守护进程

1、编写启动服务文件 /lib/systemd/system/redis.service

[Unit]
Description=The redis-server Process Manager
Documentation=https://redis.io/
After=network.target

[Service]
Type=forking

#根据自己的redis路径启动和停止
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
ExecStop=/usr/local/redis/bin/redis-cli shutdown

[Install]
WantedBy=multi-user.target

 

2、添加开机启动

systemctl daemon-reload
systemctl enable redis

posted @   leihongnu  阅读(193)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2020-06-01 Starting MySQL. ERROR! The server quit without updating PID file
2020-06-01 shell 脚本二进制安装mysql
点击右上角即可分享
微信分享提示