100 likes | 189 Views
Plug-in for Singleton Service in Clustered environment and improving failure detection methodology Advisor: By: Dr. Chung-E-Wang Srinivasa c Kodali Department of computer science California state university, Sacramento. AGENDA
E N D
Plug-in for Singleton Service in Clustered environment and improving failure detection methodology Advisor:By: Dr. Chung-E-Wang Srinivasa c Kodali Department of computer science California state university, Sacramento
AGENDA • Importance of Singleton service in clustered environment. • Implementation of singleton service. • Need for singleton service as a plug-in • Handling failure detection • Improving failure detection methodologies • Future Developments
Importance of Singleton service in clustered environment • What is singleton service? • Service which manages all the singleton objects across the clustered application. • What are singleton objects? • Singleton is a pattern which makes sure that only one instance of that object is present at any point of time in the application. • Need for singleton services • At a time if only one user need to access the JDBC connection. • Chat room application in the clustered environment where multiple users will be sending messages and broadcaster should send the messages to all the clients. Here broadcaster should be only one instance.
Implementation of Singleton Service • Implementation requires all the singleton objects to be accessible only as RMI objects. • Instances of the service code will be present in all the JVM Instances but only one instance of RMI will be started. • If the RMI service is started at one instance then update of JNDI registry should take place which tells where singleton service is running. • JNDI will maintained to know which JVM is running the service and other JVM’s running on the system. • If another server instance need access to singleton object then the instance should make RMI call to the instance where the singleton service is running by looking into the JNDI.
Implementation of Singleton Service cont’d Service contains a set of API methods which helps to start the RMI service, binding to the JNDI and unbinding the service. Some of the API methods that plug-in will contain are: start() - will create RMI service on particular server. Bind() - Bind particular address to the JNDI directory. unBind() – Un bind the address from the JNDI registry. getServerInstances() - returns a list of server instances running at that point.
Need for developing a plug-in • Open source servers doesn’t have the singleton service implementation. • Plug-in will reduces the coding time and maintenance capabilities of singleton services in clustered environment. • Plug-in will be compatible with different kind of J2EE application servers like Tomcat, Jetty, glassfish etc.,
Handling failure detection • In clustered environment if the service running the JVM fails, all the singleton objects will not be accessible. It can become single-point failure. • If JVM running the singleton service is down, how would the system know? • A monitor in the cluster will be pinging the system which is running the singleton service at equal interval. • What if the monitor pinging the system is down? • A Highly available singleton service need to developed. • How would other system know that the service is down • If the monitor can’t ping the system, monitor should be able to start the another singleton service automatically and update the JNDI directory.
Improving failure detection methodologies • Methodologies to make the singleton service highly available i.e failure detection algorithms: • Heart beat method: similar to the Ping system which mentioned above. • Async-BFD ( Asynchronous Bi-directional forwarding detection method) : In this method any two nodes( can be random node, neighbor node) should be able to establish a communicate channel for a period of time. • In the channel the nodes should send messages (ping) each other. If the ping node gets the reply back then other node alive. • This method can eradicate any single point failure.
Future Developments • This methodology can be extended to cluster the instances like JMS etc., • Electing server to start the singleton service (failover detection) can be challenging task. Can use using complex distributed algorithms like leader- election algorithm.
Questions ??