如果出现此问题,先排除以前几点
1.bind 需要注释起来
2.telnet 防火墙之类的就不多说了
我出现的问题是,本地可以访问 服务器的6379 6380,然后项目使用sentinel模式启动就会报错,信息:
jedis错误信息:
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
redisson 错误信息 : org.redisson.client.RedisConnectionException: Can't init enough connections amount! Only 0 from 5 were initialized. Server: /127.0.0.1:6379
注意:如果你本地有redis ,配置如服务器相同。哨兵的名字 端口等等。 项目会使用本地的redis,而不会连接服务器的redis,这个坑了我好久。
现在说说解决方法。报错信息为 Can't init enough connections amount! Only 0 from 5 were initialized. Server: /127.0.0.1:6379 可是我项目中没有配置任何 127.0.0.1的ip。
后来在sentient.conf里面找到了这条
然后把ip改为外网的ip,然后启动服务器。ok,错误解决。
sentinel monitor mymaster 114.55.55.55(你的服务器ip) 6379 2
提醒下各位,千万别忘记设置密码。要不然你的服务器有可能就成为黑客的挖矿机。。 血的教训啊 ps:我觉得我还可以出一篇怎么清楚挖矿机程序。。