您现在的位置是:网站首页> 编程资料编程资料
linux 开机自启动redis服务的方法_linux shell_
2023-05-26
319人已围观
简介 linux 开机自启动redis服务的方法_linux shell_
[Unit] Description=The redis-server Process Manager Documentation=https://redis.io/ After=network.target [Service] Type=forking ExecStart=/root/redis-5.0.7/src/redis-server /root/redis-5.0.7/redis.conf #有密码则需要在cli后面加 -a "密码" ExecStop=/root/redis-5.0.7/src/redis-cli shutdown [Install] WantedBy=multi-user.target
1.先输入
vi /lib/systemd/system/redis.service
把上述配置复制进去,保存退出
2.设置开机自启动
systemctl enable redis
3.使用命令
#开启服务 systemctl start redis #停止服务 systemctl stop redis #查看运行状态 system status redis
总结
以上所述是小编给大家介绍的linux 开机自启动redis服务的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
您可能感兴趣的文章:
相关内容
- Linux实现定时备份MySQL数据库并删除30天前的备份文件_linux shell_
- Linux 中shell脚本设置开头固定格式的实现方法_linux shell_
- shell中set指令的用法详解_linux shell_
- shell字符串截取报错:Bad substitution的解决_linux shell_
- 详解shell中脚本参数传递的两种方式_linux shell_
- 浅析Linux之bash反弹shell原理_linux shell_
- linux反弹shell的原理详解_linux shell_
- Shell文本处理三剑客之sed的使用_linux shell_
- shell脚本实现公司项目部署交付环境预检查的思路_linux shell_
- 一键配置本地yum源的shell脚本_linux shell_
