启动服务时,redisson客户端连不上virtualbox虚拟机上的redis ?
虚拟机使用的Virtual box 的NAT模式
代码配置
idea中的报错
org.redisson.client.RedisConnectionException: MasterConnectionPool no available Redis entries. Disconnected hosts: [/10.200.67.168:6379]
at org.redisson.connection.pool.ConnectionPool.get(ConnectionPool.java:195) ~[redisson-2.7.0.jar:na]
at org.redisson.connection.pool.MasterConnectionPool.get(MasterConnectionPool.java:31) ~[redisson-2.7.0.jar:na]
at org.redisson.connection.MasterSlaveEntry.connectionWriteOp(MasterSlaveEntry.java:392) ~[redisson-2.7.0.jar:na]
at org.redisson.connection.MasterSlaveConnectionManager.connectionWriteOp(MasterSlaveConnectionManager.java:675) ~[redisson-2.7.0.jar:na]
at org.redisson.command.CommandAsyncService.async(CommandAsyncService.java:489) ~[redisson-2.7.0.jar:na]
at org.redisson.command.CommandAsyncService$7.run(CommandAsyncService.java:538) ~[redisson-2.7.0.jar:na]
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTimer.java:715) ~[netty-common-4.1.87.Final.jar:4.1.87.Final]
at io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:34) ~[netty-common-4.1.87.Final.jar:4.1.87.Final]
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:703) ~[netty-common-4.1.87.Final.jar:4.1.87.Final]
at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:790) ~[netty-common-4.1.87.Final.jar:4.1.87.Final]
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503) ~[netty-common-4.1.87.Final.jar:4.1.87.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]
windows的ip:
虚拟机的ip:
接口转发:
回复
1个回答

test
2024-07-01
看看redis监听的地址是什么,可能要改成0.0.0.0或者10.0.2.15这个地址。redis.conf
bind 0.0.0.0
回复

适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容