title: in redis master-slave-sentinel configuration and Spring boot application, RedisConnectionException occured
body: <p>I configured redis master-slave-sentinel environment using docker-compose.
  and I completed it and tested it.</p>
  <p>but, in my spring boot application, I wrote a redis sentinel config  code.
  below spring config class.</p>
  <pre><code>@Configuration
  @EnableRedisRepositories
  public class RedisConfig {
        @Bean
      public RedisConnectionFactory redisConnectionFactory(){
          RedisSentinelConfiguration redisSentinelConfiguration = new RedisSentinelConfiguration()
                  .master(&quot;redis-master&quot;)
                  .sentinel(&quot;localhost&quot;,26379)
                  .sentinel(&quot;localhost&quot;,26380)
                  .sentinel(&quot;localhost&quot;,26381);
          LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisSentinelConfiguration);
          return lettuceConnectionFactory;
      }
  }
  </code></pre>
  <p>and then I did run  application, then  problem occured.</p>
  <p><a href="https://i.stack.imgur.com/8OnGF.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I think there are some docker-compose network configs....</p>
  <p>I want to know why it was...</p>
  <p>If you guys know, .. please let me know about it.</p>
  <p>↓ redis master-slave-sentinel config docker-compose.yml code.</p>
  <pre><code>version: '3.9'
  services:      
    redis-master:
      hostname: redis-master
      container_name: redis-master
      image: bitnami/redis:6.2.6
      environment:
        - REDIS_REPLICATION_MODE=master
        - ALLOW_EMPTY_PASSWORD=yes
      volumes:
        - ./master/backup:/freelog/backup
      networks:
        - net-redis
      ports:
        - 6379:6379
  
    # slave1 : bitnami/redis:6.2.6
    redis-slave-1:
      hostname: redis-slave-1
      container_name: redis-slave-1
      image: bitnami/redis:6.2.6
      environment:
        - REDIS_REPLICATION_MODE=slave
        - REDIS_MASTER_HOST=redis-master
        - ALLOW_EMPTY_PASSWORD=yes
      ports:
        - 6480:6379
      volumes:
        - ./slave1/backup:/freelog/backup
      networks:
        - net-redis
      depends_on:
        - redis-master
  
    # slave2 : bitnami/redis:6.2.6
    redis-slave-2:
      hostname: redis-slave-2
      container_name: redis-slave-2
      image: bitnami/redis:6.2.6
      environment:
        - REDIS_REPLICATION_MODE=slave
        - REDIS_MASTER_HOST=redis-master
        - ALLOW_EMPTY_PASSWORD=yes
      ports:
        - 6481:6379
      networks:
        - net-redis
      volumes:
        - ./slave2/backup:/freelog/backup
      depends_on:
        - redis-master
        - redis-slave-1
  
  
    # slave3 : bitnami/redis:6.2.6
    redis-slave-3:
      hostname: redis-slave-3
      container_name: redis-slave-3
      image: bitnami/redis:6.2.6
      environment:
        - REDIS_REPLICATION_MODE=slave
        - REDIS_MASTER_HOST=redis-master
        - ALLOW_EMPTY_PASSWORD=yes
      ports:
        - 6482:6379
      volumes:
        - ./slave3/backup:/freelog/backup
      networks:
        - net-redis
      depends_on:
        - redis-master
        - redis-slave-2
  
    # sentinel1 : bitnami/redis-sentinel:6.2.6
    redis-sentinel-1:
      hostname: redis-sentinel-1
      container_name: redis-sentinel-1
      image: bitnami/redis-sentinel:6.2.6
      environment:
        - REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=3000
        - REDIS_SENTINEL_FAILOVER_TIMEOUT=60000
        - REDIS_MASTER_HOST=redis-master
        - REDIS_MASTER_PORT_NUMBER=6379
        - REDIS_MASTER_SET=master-name
        - REDIS_SENTINEL_QUORUM=2
        # - REDIS_SENTINEL_PASSWORD=170anwkd!
      depends_on:
        - redis-master
        - redis-slave-1
        - redis-slave-2
        - redis-slave-3
      ports:
        - 26379:26379
      networks:
        - net-redis
      volumes:
        - ./sentinel1/backup:/freelog/backup
  
    redis-sentinel-2:
      hostname: redis-sentinel-2
      container_name: redis-sentinel-2
      image: bitnami/redis-sentinel:6.2.6
      environment:
        - REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=3000
        - REDIS_SENTINEL_FAILOVER_TIMEOUT=60000
        - REDIS_MASTER_HOST=redis-master
        - REDIS_MASTER_PORT_NUMBER=6379
        - REDIS_MASTER_SET=master-name
        - REDIS_SENTINEL_QUORUM=2
        # - REDIS_SENTINEL_PASSWORD=170anwkd!
      depends_on:
        - redis-master
        - redis-slave-1
        - redis-slave-2
        - redis-slave-3
      ports:
        - 26380:26379
      networks:
        - net-redis
      volumes:
        - ./sentinel2/backup:/freelog/backup
  
    # sentinel3 : bitnami/redis-sentinel:6.2.6
    redis-sentinel-3:
      hostname: redis-sentinel-3
      container_name: redis-sentinel-3
      image: bitnami/redis-sentinel:6.2.6
      environment:
        - REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=3000
        - REDIS_SENTINEL_FAILOVER_TIMEOUT=60000
        - REDIS_MASTER_HOST=redis-master
        - REDIS_MASTER_PORT_NUMBER=6379
        - REDIS_MASTER_SET=master-name
        - REDIS_SENTINEL_QUORUM=2
        # - REDIS_SENTINEL_PASSWORD=170anwkd!
      depends_on:
        - redis-master
        - redis-slave-1
        - redis-slave-2
        - redis-slave-3
      ports:
        - 26381:26379
      networks:
        - net-redis
      volumes:
        - ./sentinel3/backup:/freelog/backup
  
    
  networks: 
    net-redis:
      driver: bridge
  </code></pre>