当前位置:网站首页>Centos7下使用systemd管理redis服务启动
Centos7下使用systemd管理redis服务启动
2022-08-02 03:36:00 【hzsnone】
systemctl管理Redis
背景
直接编译安装的redis没有直接service管理,试试使用systemctl管理吧。
1.编辑服务文件
vim /usr/lib/systemd/system/redis.service
[Unit]
Description=Redis persistent key-value database
After=network.target
[Service]
ExecStart=/home/data/redis/bin/redis-server /home/data/redis/etc/redis.conf --supervised systemd
ExecStop=/bin/kill -s QUIT $MAINPID
Type=notify
User=redis
Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
2.加载服务,启动
systemctl daemon-reload
systemctl enable redis
systemctl start redis
边栏推荐
猜你喜欢
随机推荐
如何搭建私有云盘?
AD Actual Combat
STM32 CAN 介绍以及相关配置
Go的安装使用(一)
Process (below): process control, termination, waiting, replacement
asyncawait和promise的区别
MongoDB相关记录
v-model修饰符
Liunx服务环境部署
全排列 DFS
《2022年中国网络安全市场全景图》
ES6中变量的使用及结构赋值
功能性网站
企业需要知道的5个 IAM 最佳实践
二进制中1的个数
rosdep update failure solution (pro-test effective)
h264转hls
节流阀和本地存储
Django、Rest framework访问数据库获取数据
【 LeetCode 】 design list