今天加入redis但连接一直报无法获取到连接,看配置

 

今天加入redis但连接一直报无法获取到连接,看配置


```
<bean >
<set>
<!-- <value>abcd</value> -->
<value>192.168.82.242</value>
</set>
</constructor-arg>
</bean>

jedis.properties
redis.ip=192.168.82.224
#Port
redis.port=6379
redis.timeout=5000
redis.password=chelizi

都是正确的

 


登录242服务器,查看sentinal的配置
# The valid charset is A-z 0-9 and the three characters ".-_".
sentinel monitor mymaster 127.0.0.1 6379 2


也是对的,怎么连不进了?

 


用wireshark跟踪一下网络包,发现连接redis的时候竟然是去连192.168.63.247, why?
赶紧登录服务器
./redis-cli -p 26379
执行命令
SENTINEL masters
返回
1) 1) "name"
2) "mymaster"
3) "ip"
4) "192.168.63.247"
5) "port"
6) "6379"

shit, 看来是改了配置之后没有重启sentinal, 执行命令
先移除之前的监控
127.0.0.1:26379> SENTINEL REMOVE mymaster
OK

再添加监控

127.0.0.1:26379> SENTINEL MONITOR mymaster 192.168.82.242 6379 2
OK
127.0.0.1:26379> SENTINEL masters
1) 1) "name"
2) "mymaster"
3) "ip"
4) "192.168.82.242"
5) "port"
6) "6379"

问题解决

相关文章:

  • 2021-08-24
  • 2022-01-16
  • 2022-02-02
  • 2022-01-08
  • 2021-08-05
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-01
  • 2021-07-13
  • 2021-10-28
  • 2022-01-15
  • 2021-10-09
  • 2021-11-13
  • 2022-12-23
相关资源
相似解决方案