虚拟机使用的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:
接口转发:
看看redis监听的地址是什么,可能要改成0.0.0.0或者10.0.2.15这个地址。
redis.conf