Jedis无法连接centOS7上的redis

通过查看资料无法连接基本是两个原因:

1)redis.conf中的bind配置,bind的默认是 127.0.0.1 只可本机访问,我们改为 bind 0.0.0.0 即所有地址均可访问。

Jedis无法连接centOS7上的redis

 2)centOS有防火墙,没有开放6379端口

centOS6关闭防火墙命令:sevice iptables stop

centOS7关闭防火墙命令:systemctl stop firewalld.service #停止

centOS7禁止firewall开机启动命令:firewall systemctl disable firewalld.service

 

如果是修改防火墙规则,可以修改:/etc/sysconfig/iptables文件

 

OK

 

相关文章:

  • 2021-06-22
  • 2021-12-23
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2021-05-23
猜你喜欢
  • 2022-12-23
  • 2021-08-08
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案