I have an application that uses Redis Tomcat Session Manager to connect to Redis Server to externalize sessions. Because we aim for high availability, we wanted to distribute the Redis Master-Slave configuration in a distributed manner. We can successfully achieve this on the same server with several Master-Slave configurations, and we use sentinal to do this.
Our problem begins when we switch from one server to several server environments, i.e. we have s1, s2, s3 and Master servers in s1, while s2 and s3 start slave processes. Sentinal easily switches when master s1 dies, but our application is completely unaware of the switch and continues to point to the IP address of server s1, while the master is now s2. How to solve this problem and how we can increase its availability.
The configuration changes we make in Apache Tomcat are in the Server.xml file and are as follows: -
<Valve className="com.radiadesign.catalina.session.RedisSessionHandlerValve" /> <Manager className="com.radiadesign.catalina.session.RedisSessionManager" host="localhost" <!-- optional: defaults to "localhost" --> port="6379" database="0" maxInactiveInterval="60" />
How to get along with this situation and increase accessibility. I read some plugins with zookeeper, but not for Java, and I donβt even know how we will implement the same.
Please feel free to ask for any clarification if required.
source share