---
title: "另一种reids的Could not get a resource from the pool原因"
author: "BlackWing"
date: "2014-11-21T11:20:54Z"
tags: []
categories: ["开源软件"]
slug: "reids-could-not-get-a-resource-from-the-pool"
draft: false
lastmod: "2014-11-21T11:25:42Z"
id: 2158799
url: "https://blackwing.iteye.com/blog/2158799"
---

转载请标明出处：http://blackwing.iteye.com/blog/2158799

由于sentinel redis集群是搭建在组内的服务器，而某个应用需要从其他组的storm集群访问sentinel，并且组内的sentinel配置了防火墙访问规则。

sentinel对外开通的是26379端口，所以程序连接sentinel是，能正常建立对sentinel master的连接，但当需要活动pool资源时：

```java
sentinelPool.getResource();
```

则报一下错误：

```java
Could not get a resource from the pool
```


原来除了需要防火墙开发sentinel的26379端口外，还需要开通sentinel集群中每台redis server的端口（默认是6379）。