主机连接Redis问题
来源:5-14 开发用户redis-session

qq_慕用5491575
2021-04-13
老师,我使用主机上的Redis Desktop Manager连接不上Linux上的Redis。
1、主机使用的家庭WIFI上网,防火墙已关闭;虚拟机使用桥接模式上网,防火墙已关闭。
主机IP:192.168.0.102,子网掩码:255.255.255.0,默认网关:192.168.0.1;
虚拟机IP:192.168.0.106,子网掩码:255.255.255.0,默认网关:192.168.0.1。
然后主机可以ping通虚拟机;虚拟机也可以ping通主机,也可以ping通www.baidu.com
2、Redis version=5.0.12
在redis.conf中修改bind 0.0.0.0,daemonize yes,port 6379,requirepass imooc
然后执行命令./redis-server redis.conf回车、./redis-cli -p 6379 -a imooc并回车
显示:127.0.0.1:6379>
输入 set hello helloworld
显示:OK
输入 get hello
显示:"helloworld"
3、使用主机的Redis Desktop Manager连接不上Linux上的Redis,
显示:
2021-04-13 15:39:43 : Connection: Cancel running commands
2021-04-13 15:39:43 : Connection: Connection error: Connection refused
2021-04-13 15:39:43 : Connection: imooc-redis > connection failed
2021-04-13 15:39:49 : Connection: Cancel running commands
2021-04-13 15:39:49 : Connection: Connection error: Connection refused
2021-04-13 15:39:49 : Connection: imooc-redis > connection failed
现在不知道该怎么办了,求老师指导!
1回答
-
风间影月
2021-04-13
嗯。。看上去的确没问题呀,防火墙关了没
112021-04-13