title: spring data redis master slave config
body: <p>Following is my jedis config</p>
  
  <pre><code>@Bean
  public JedisConnectionFactory getJedisConnectionFactory() {
      JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
      jedisConnectionFactory.setUsePool(true);
      return jedisConnectionFactory;
  }
  
  @Bean
  public RedisTemplate&lt;String, Object&gt; getRedisTemplate() {
      RedisTemplate&lt;String, Object&gt; redisTemplate = new RedisTemplate&lt;String, Object&gt;();
      redisTemplate.setConnectionFactory(getJedisConnectionFactory());
      return redisTemplate;
  }
  </code></pre>
  
  <p>This config works well when I have single server. What I want to do is have 1 redis master and multiple redis slaves. Per redis documentation, read should happen from slaves, and write should happen from master. How do I change above configuration to use master for writing and slave for reading?</p>
  
  <p>Lets say that my master is at 192.168.10.10 and slave is at localhost.</p>
  
  <p>Thanks!</p>