CentOS将Redis配置为系统服务的方法

下面由Redis教程栏目给大家介绍redis队列实现历史搜索功能的方法,希望对需要的朋友有所帮助!

汉源网站建设公司成都创新互联,汉源网站设计制作,有大型网站制作公司丰富经验。已为汉源上千余家提供企业网站建设服务。企业网站搭建\成都外贸网站建设公司要多少钱,请找那个售后服务好的汉源做网站的公司定做!

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

分享题目:CentOS将Redis配置为系统服务的方法
当前路径:http://lszwz.com/article/cpdgdp.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款