java项目启动报错

这个项目需要连接三个数据库,分别是mysql,mongo,redis,
mysql,mongo主要记录,其中redis是做缓存用

在启动的时候报错如下
ConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
2018-11-28 20:21:49,523 [main] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService ‘clientOutboundChannelExecutor’
2018-11-28 20:21:49,523 [main] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService ‘clientInboundChannelExecutor’
2018-11-28 20:21:49,526 [main] INFO org.mongodb.driver.connection - Closed connection [connectionId{localValue:2, serverValue:604}] to 172.31.30.66:27017 because the pool has been closed.
2018-11-28 20:21:49,552 [main] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit ‘default’
2018-11-28 20:21:49,563 [main] INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat]
2018-11-28 20:21:49,580 [main] INFO org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer -

在这里插入图片描述

解决方案

这个报错主要的原因就是服务的内网无法联通,导致项目链接redis的时候失败,项目无法启动
处理方法,将项目配置文件的redis ip修改成外网ip,重启即可。同时也需要上控制台检查一下服务器之间是否开放对应的端口,服务器之间如果走的是内网可以忽略。
检查内网之间是否可以正常通信,ping 一下ip 就可以,能ping通说明,服务器内网是互通的。否则则不通。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rio520

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值