title: I want to know, why get a exception of redis.clients.jedis.exceptions.JedisConnectionException?
body: <p>I used jedis in my java project with one master and slave, once the slave started, it come to this in redis_slave.log:</p>
  
  <pre><code>44764 [2721] 24 Dec 14:07:41.157 * Connecting to MASTER...
  44765 [2721] 24 Dec 14:07:41.158 * MASTER &lt;-&gt; SLAVE sync started
  44766 [2721] 24 Dec 14:07:41.158 # Error condition on socket for SYNC: Connection refused
  </code></pre>
  
  <p>and in my java source file, I want to delete all data in redis, so I wrote this code:</p>
  
  <pre><code>public class TestJedisPool {
  
      private Jedis jedis = null;
      private JedisPool jedisPool = null;
  
      public TestJedisPool() {
          initialPool();
          jedis = jedisPool.getResource();
          jedis.auth("123456");
      }
  
      private void initialPool() {
          JedisPoolConfig config = new JedisPoolConfig();
          config.setMaxActive(20);
          config.setMaxIdle(5);
          config.setMaxWait(1000L);
          config.setTestOnBorrow(false);
          jedisPool = new JedisPool(config, "192.168.144.3", 6397);
      }
  
      private void masterThread() {
  
          System.out.println(jedis.flushAll());       
          jedisPool.returnResource(jedis);
          jedis.disconnect();
      }
  
      /**
       * @param args
       */
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          TestJedisPool test = new TestJedisPool();
          test.masterThread();
      }
  }
  </code></pre>
  
  <p>and get a exception like this:</p>
  
  <pre><code>    Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
  Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
      at redis.clients.util.Pool.getResource(Pool.java:22)
      at com.oppo.testpool.TestJedisPool.&lt;init&gt;(TestJedisPool.java:15)
      at com.oppo.testpool.TestJedisPool.main(TestJedisPool.java:41)
  Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect
  </code></pre>
  
  <p>any one can help me ?</p>