连接Linux系统的Redis服务
通过RedisDesktopManager连接Linux上的Redis,RedisDesktopManager连接Linux上刚配好的Redis服务器会出现下面这个样子
这是因为Redis默认是只能从Linux上访问,而拒绝了网络访问,还有可能就是被防火墙拦截了!
修改Redis的配置文件
编辑 redis.conf 文件找到并且做以下更改
更改第61行:
bind 127.0.0.1 ——》 bind 0.0.0.0
让外网能够访问Redis服务器
更改第80行:
protected-mode yes ——》 protected-mode no
不启用保护模式
启动Redis
启动Redis让其读取我们刚才修改的配置文件
redis-server /root/java/Redis/original/redis.conf
再次连接测试,此时应该能够访问Linux的Redis服务器
修改配置文件后依然不可以访问
这是就不是Redis的问题了,而是Linux服务器的防火墙作怪了
systemctl stop firewalld 关闭防火墙
systemctl disable firewalld 防火墙永久关闭
直接关闭防火墙,然后再次连接。
注意:以上防火墙内容只是针对VM虚拟机中的Linux。如果是云服务器,那么要开放连接的端口