I have an application that uses Redis Tomcat Session Manager in order to connect to the Redis Server in order to externalize the sessions. Since we are targeting high availability, we wanted to run Redis Master-Slave configuration in a distributed manner. We are successfully able to achieve it in a single server with multiple Master-Slave configuration and we use sentinal to do so.
Our problem starts when we move from a single server to multiple server environment, i.e Consider we have servers s1,s2,s3 and Master runs in s1 whereas s2 and s3 runs slave processes. Sentinal easily does a switch over whenever the s1 master dies but our application is totally unaware of the switch over and keeps on pointing to the IP of s1 server whereas the master now is s2. How to address this problem and how can we increase the availability.
The configuration changes that we do in the Apache Tomcat is in the Server.xml file and is as follows :-
<Valve className="com.radiadesign.catalina.session.RedisSessionHandlerValve" />
<Manager className="com.radiadesign.catalina.session.RedisSessionManager"
host="localhost" <!-- optional: defaults to "localhost" -->
port="6379" <!-- optional: defaults to "6379" -->
database="0" <!-- optional: defaults to "0" -->
maxInactiveInterval="60" <!-- optional: defaults to "60" (in seconds) --> />
How to get along with this situation and increase the availability. I read some plugins with zookeeper but none for Java and dont even know how would we implement the same.
Please feel free to ask any clarification if required.