重庆小潘seo博客

当前位置:首页 > 重庆网络营销 > 小潘杂谈 >

小潘杂谈

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

时间:2020-09-23 21:00:08 作者:重庆seo小潘 来源:
下面由Redis教程栏目给大家介绍redis队列实现历史搜索功能的方法,希望对需要的朋友有所帮助! CentOS 将 Redis 配置为系统服务 创建 redis.servicecd/usr/lib/systemd/systemtouch redis.service编辑内容[Unit]Description=Redis ServerAfter=network.targe

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

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

CentOS 将 Redis 配置为系统服务

创建 redis.servicecd/usr/lib/systemd/systemtouch redis.service编辑内容[Unit]Description=Redis ServerAfter=network.target[Service]PIDFile=/var/run/redis_6379.pidExecStart=/usr/local/bin/redis-server /etc/redis.confExecStop=/usr/local/bin/redis-cli -a passwd shutdownExecReload=/bin/kill -s HUP $MAINPID[Install]WantedBy=mutli-user.target重新载入 systemctl 并启动服务systemctl daemon-reloadsystemctl start redis.service查看状态systemctl status redis.service关闭 Redissystemctl stop redis.service开机自启systemctl enable redis.service是否开机自启systemctl is-enabled redis.service以上就是CentOS将Redis配置为系统服务的方法的详细内容,更多请关注小潘博客其它相关文章!