Redis服务器开启远程访问
2021/5/11 19:25:15
本文主要是介绍Redis服务器开启远程访问,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
来源:微信公众号「编程学习基地」文章目录
- 提权限
- 编辑redis配置文件
- 重启Redis服务器
提权限
首先把权限升到root
su root
编辑redis配置文件
sudo vi /etc/redis/redis.conf
重启Redis服务器
sudo /etc/init.d/redis-server restart
root@VM-16-5-ubuntu:/home/ubuntu/redis# vi /etc/redis/redis.conf root@VM-16-5-ubuntu:/home/ubuntu/redis# /etc/init.d/redis-server restart [ ok ] Restarting redis-server (via systemctl): redis-server.service. root@VM-16-5-ubuntu:/home/ubuntu/redis# sudo /etc/init.d/redis-server status ● redis-server.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-05-11 18:37:44 CST; 7s ago Docs: http://redis.io/documentation, man:redis-server(1) Process: 27417 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS) Process: 27423 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS) Main PID: 27436 (redis-server) Tasks: 4 (limit: 2122) CGroup: /system.slice/redis-server.service └─27436 /usr/bin/redis-server *:6379 May 11 18:37:44 VM-16-5-ubuntu systemd[1]: Stopped Advanced key-value store. May 11 18:37:44 VM-16-5-ubuntu systemd[1]: Starting Advanced key-value store... May 11 18:37:44 VM-16-5-ubuntu systemd[1]: redis-server.service: Can't open PID file /var/run/redis/redis-server.pid (yet?) after start: No such fil…r directory May 11 18:37:44 VM-16-5-ubuntu systemd[1]: Started Advanced key-value store. Hint: Some lines were ellipsized, use -l to show in full. root@VM-16-5-ubuntu:/home/ubuntu/redis# redis-cli
这篇关于Redis服务器开启远程访问的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-18Redis安装入门:新手必读指南
- 2024-11-08阿里云Redis项目实战入门教程
- 2024-11-08阿里云Redis资料:新手入门与初级使用指南
- 2024-11-08阿里云Redis教程:新手入门及实用指南
- 2024-11-07阿里云Redis学习入门:新手必读指南
- 2024-11-07阿里云Redis学习入门:从零开始的操作指南
- 2024-11-07阿里云Redis学习:初学者指南
- 2024-11-06阿里云Redis入门教程:轻松搭建与使用指南
- 2024-11-02Redis项目实战:新手入门教程
- 2024-10-22Redis入门教程:轻松掌握数据存储与操作