title: Spring Redisson Sentinel Error - At least two sentinels are required
body: <p>I am using Sentinel mode for Redis. I am using Redisson Client version 3.9.1</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.redisson&lt;/groupId&gt;
          &lt;artifactId&gt;redisson-spring-data-20&lt;/artifactId&gt;
          &lt;version&gt;${redisson-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.redisson&lt;/groupId&gt;
          &lt;artifactId&gt;redisson&lt;/artifactId&gt;
          &lt;version&gt;${redisson-version}&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>The configuration of Sentinel using Redisson:</p>
  
  <pre><code>@EnableCaching
  public class RedisCache {
  
      @Autowired
      private ObjectMapper objectMapper;
  
      @Bean
      public RedissonClient redissonClient() {
          Config config = new Config();
          config.setCodec(new JsonJacksonCodec(objectMapper));
  
          config.useSentinelServers()
                      .setMasterName("redis-master")
                      .addSentinelAddress("redis://localhost:26378")
                      .addSentinelAddress("redis://localhost:26379");
  
          return Redisson.create(config);
      }
  
      @Bean
      public RedissonConnectionFactory redissonConnectionFactory(RedissonClient redisson) {
          return new RedissonConnectionFactory(redisson);
      }
  }
  </code></pre>
  
  <p>I am running two sentinel servers and one Redis master with no slave.
  This is just a setup on my local environment.<br>
  Output of some commands:  </p>
  
  <pre><code>redis-cli -p 26379
  127.0.0.1:26379&gt; SENTINEL get-master-addr-by-name redis-master
  1) "127.0.0.1"
  2) "6379"
  redis-cli -p 26378
  127.0.0.1:26378&gt; SENTINEL get-master-addr-by-name redis-master
  1) "127.0.0.1"
  2) "6379"
  </code></pre>
  
  <p>Whenever I am running my Spring Boot Application, I get the following error:</p>
  
  <pre><code>       Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonClient' defined in class path resource [xxxx/cache/impl/redis/config/RedisCache.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is org.redisson.client.RedisConnectionException: At least two sentinels should be defined in Redis configuration!
  
  ......
  
              at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:317)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:315)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:204)
              at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType (ServletContextInitializerBeans.java:226)
              at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType (ServletContextInitializerBeans.java:214)
              at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans (ServletContextInitializerBeans.java:91)
              at org.springframework.boot.web.servlet.ServletContextInitializerBeans.&lt;init&gt; (ServletContextInitializerBeans.java:80)
              at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans (ServletWebServerApplicationContext.java:250)
              at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize (ServletWebServerApplicationContext.java:237)
              at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup (TomcatStarter.java:54)
              at org.apache.catalina.core.StandardContext.startInternal (StandardContext.java:5245)
              at org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:150)
              at org.apache.catalina.core.ContainerBase$StartChild.call (ContainerBase.java:1420)
              at org.apache.catalina.core.ContainerBase$StartChild.call (ContainerBase.java:1410)
              at java.util.concurrent.FutureTask.run (FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
              at java.lang.Thread.run (Thread.java:748)
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD FAILURE
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 22.566 s
          [INFO] Finished at: 2018-12-07T13:44:14+05:30
          [INFO] ------------------------------------------------------------------------
          [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:run (default-cli) on project xxx: An exception occurred while running. null: InvocationTargetException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthEndpoint]: Factory method 'healthEndpoint' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.redis.RedisHealthIndicatorConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redissonConnectionFactory' defined in class path resource [xxxxxxx/cache/impl/redis/config/RedisCache.class]: Unsatisfied dependency expressed through method 'redissonConnectionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonClient' defined in class path resource [xxxxxx/cache/impl/redis/config/RedisCache.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is org.redisson.client.RedisConnectionException: At least two sentinels should be defined in Redis configuration!
  </code></pre>
  
  <p>How do I resolve this error?</p>
  
  <p>PS: I have tried master-slave configuration also, with one sentinel attached to the host and other one attached to the slave, but the error remains the same. I have tried sentinels running on different local machines with different private IPs, but the error remains the same.
  Tried with 3 sentinel servers, no benefits.</p>