不管是spring还是原生jedis连接redis,如果连不上多半是linux服务器的问题:

1 首先确保redis端口开放:

java连接redis无法连接,报异常RedisConnectionException

把6379或者redis的端口开放即可

 

2 redis.conf配置注释掉 bind 127.0.0.1,redis默认绑定了本地ip,只允许本机使用,所以需要注释

java连接redis无法连接,报异常RedisConnectionException

 

3 Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to

编辑配置文件关闭保护模式,保护模式下只能本机访问

protected-mode no

4 如果还是连接报异常,就要考虑程序配置问题了,可以再windows中先测试是否能连通

telnet ip 6379

 

相关文章:

  • 2022-01-16
  • 2022-12-23
  • 2021-06-03
  • 2021-06-14
  • 2021-12-27
  • 2021-10-17
  • 2021-11-15
  • 2022-02-13
猜你喜欢
  • 2021-10-10
  • 2021-12-14
  • 2022-01-15
  • 2021-10-28
  • 2018-09-14
  • 2021-10-05
相关资源
相似解决方案