解决Linux下redis客户端工具连接不到redis服务
1.修改redis.conf配置文件
默认的地址是127.0.0.1 代表的是只能本地连接
修改为0.0.0.0 表示打开远程连接 所有的地址都可以连接
将受保护模式修改为no(redis4.0以下的版本没有这个模式配置,不 用修改)
保存退出redis.conf文件
2.在linux下的防火墙中开放6379端口
注意:端口号也可以在redis.conf配置文件中修改的 你修改成多少了 就要开放相应的端口号。
[root@localhost bin]# firewall-cmd --zone=public --add-port=6379/tcp --permanent
结果:success
3、重启防火墙
[root@localhost bin]# systemctl restart firewalld
4、启动redis
[root@localhost bin]# ./redis-server redis.conf
现在在用redis客户端工具连接redis服务 应该就没啥问题了 。