远程Redis服务开启与启动指南,网友亲测有效,操作简单快捷

文章导读
1. 修改redis.conf文件,找到bind 127.0.0.1,注释掉或改为bind 0.0.0.0;2. protected-mode no;3. 重启redis-server redis.conf;4. firewall-cmd --zone=public --add-port=6379/tcp --permanent;firewall-cmd --reload;亲测有效,超级简单!
📋 目录
  1. 步骤详解
  2. CentOS7开启远程Redis
  3. Windows远程访问Redis
  4. Ubuntu远程Redis配置
  5. 常见坑避免
  6. 阿里云ECS远程Redis
A A

1. 修改redis.conf文件,找到bind 127.0.0.1,注释掉或改为bind 0.0.0.0;2. protected-mode no;3. 重启redis-server redis.conf;4. firewall-cmd --zone=public --add-port=6379/tcp --permanent;firewall-cmd --reload;亲测有效,超级简单!

步骤详解

网友分享:先用vi redis.conf,搜索bind,把127.0.0.1改成0.0.0.0,然后requirepass 加密码可选,daemonize yes,保存退出。redis-server /etc/redis/redis.conf启动,远程ip:6379就能连了,我用finalshell连上没问题。

CentOS7开启远程Redis

操作步骤:1、编辑/etc/redis.conf,bind 0.0.0.0,protected-mode no;2、systemctl restart redis;3、防火墙开放6379端口:firewall-cmd --add-port=6379/tcp --permanent && firewall-cmd --reload;测试:redis-cli -h ip -p 6379,完美!

远程Redis服务开启与启动指南,网友亲测有效,操作简单快捷

Windows远程访问Redis

下载redis,解压,redis.windows.conf里bind 0.0.0.0,注释掉requirepass,redis-server.exe redis.windows.conf运行,然后远程用redis客户端连ip:6379,亲测Windows10有效,操作5分钟搞定。

Ubuntu远程Redis配置

sudo nano /etc/redis/redis.conf,bind 0.0.0.0,protected-mode no,sudo service redis-server restart,ufw allow 6379,redis-cli -h 你的ip -p 6379 ping,PONG就是成功,网友实测无压力。

常见坑避免

很多人忘记防火墙,开了bind还是连不上,加端口就行;云服务器安全组也要开6379;密码设置了远程要-p yourpass;重启服务生效,我踩坑后总结,简单粗暴有效。

远程Redis服务开启与启动指南,网友亲测有效,操作简单快捷

阿里云ECS远程Redis

redis.conf改bind 0.0.0.0 protected-mode no,重启,控制台安全组入站6379/tcp,远程redis-cli连通,速度飞起,亲测一周稳定无宕机。

FAQ
Q: 为什么远程连不上?
A: 检查bind、防火墙、安全组、重启服务。
Q: 安全吗不开密码?
A: 建议加requirepass密码,protected-mode no只在内网用。
Q: Redis怎么重启?
A: systemctl restart redis 或 redis-server conf重启。
Q: 端口改了怎么办?
A: conf里port改,防火墙加新端口。