主机连接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

嗯。。看上去的确没问题呀,防火墙关了没

1
1
qq_慕用5491575
大意了,还是防火墙没关,谢谢老师的提醒!
2021-04-13
共1条回复

Spring Boot短视频小程序开发 全栈式实战项目

一门课程带你搞定短视频小程序全栈开发,毕业设计之利器!

2613 学习 · 1952 问题

查看课程

相似问题

redis

回答 1

redis连接

回答 1