It is easy to get into the weeds with clustering.
Quote:
Originally Posted by mmhs
I have a custom application which is written by java. I want to know is it possible to cluster this application by pacemaker. For example copy this application in two different nodes and setup a cluster by pacemaker. In one time only one application work and when primary node goes down my application start to work on second node in simple word i need a way to cluster my simple application like clustering nginx server with packemaker,
|
This is flirting with becoming a case of the
XY Problem. You probably can use pacemaker, but it depends. Pacemaker may or may not be the answer. Will your application ever run on FreeBSD, Solaris, AIX, Windows, etc? Clustering comes in two forms. One is known as scalable clustering, where work loads are distributed between nodes. The second is high availability clustering, where a failure doesn't cause a service outage. It sounds like you want HA.
Some questions that should point you in the right direction:
Are others going to be supporting this application? Your sysads might have a clustering tech they are already using. If they are using for example Solaris Cluster or Service Guard, I doubt they want to deal with pacemaker. I would focus on making it able to run in a cluster in general rather than worrying about a specific tech. If it is something that is going to run on an appliance, then use whatever cluster tech you like.
Does your application use storage or a database? Is this data changing? Where is it stored? Changing data adds considerable complexity to a cluster. It might be best to say not my problem and let a DBMS, LDAP directory, reddis, etc handle it. If others will be supporting it, try to keep things standard so for instance, a MSSQL shop isn't stuck dealing with MariaDB or vice versa. Ditto with AD vs OpenLDAP. LDAP is usually a client side failover. DBMS is usually a server side failover, so you will need to be able to fail over the VIP(s).
Are user sessions a problem? Failing over between hosts with no sessions is easy. Adding user sessions makes things a little more challenging, but still doable. How you do it depends on where the sessions persist. If so, is your application running on something like Tomcat or is it a standalone Java application? If not, have you considered it? Java application servers generally have session peering abilities that aid in clustering. If user sessions aren't a problem, the easiest thing to do would be to not worry about clustering. Let the sysads deal with it. If it is for an appliance, you just need to worry about failing over the VIP(s).
Quote:
Originally Posted by mmhs
And also is there any solution to cluster two OS. If first OS goes down second OS start to serve request ?
|
Yes. If your application is a network server, reverse proxies, such as
HAProxy, can do this.
Hopefully this helps.