java 串連 redis叢集時報錯:Could not get a resource from the pool

來源:互聯網
上載者:User

標籤:from   div   style   cti   pool   class   檢查   es2017   not   

由於弄這個的時候浪費了太多的時間,所以才記錄下這個錯,給大夥參考下

檢查了一下,配置啥的都沒問題的,但在redis叢集機器上就可以,錯誤如下:

Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

 

原因:

是因為我在創叢集的時候的ip地址是:127.0.0.1,不是原生電腦訪問的話是不能訪問的,所以重新建立一個叢集,把下列命令的127.0.0.1改成本機ip

錯誤的:

./redis-trib.rb  create  --replicas  1   127.0.0.1:7001  127.0.0.1:7002 127.0.0.1:7003  127.0.0.1:7004  127.0.0.1:7005  127.0.0.1:7006

 正確的:

./redis-trib.rb  create  --replicas  1   本機ip:7001  本機ip:7002 本機ip:7003  本機:7004  本機ip:7005  本機ip:7006

 

java 串連 redis叢集時報錯:Could not get a resource from the pool

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.