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,
And also is there any solution to cluster two OS. If first OS goes down second OS start to serve request ?
Thanks in advance
To clarify my scenario. I have a java application which process some messages. It is not like a service and acts like a local application. I want to be sure one instance of my application is always running in two or more nodes of my cluster and when one instance of my application is running in one node of my cluster other instances not allowed to work. I Know how pacemaker work and use float ip as a resource. I want to know is there any solution to add my application as resource or pacemaker monitor my application and when failed switch to other node.
Updated: for more information I want to deploy application on physical servers and I cannot use virtualization and VM. Furthermore methods like Vmware FT has some limitations like max no of VCPU and also RAM. I think it should be much easier if I can use pacemaker as a cluster resource manager but I dont know how to introduce my application as a resource and how to route all traffic to my primary server and when server or application goes down traffic and requests route to other node.
Unfortunately my application is not like a service. normally my application gathers information from different servers and sends them to another servers thus methods like loadbalancer is not suitable for my scenario.
I need a floating IP for my cluster and when serverA goes down All traffic switch to ServerB( Input and Output) also cluster start Stopped application on serverB. And when ServerA backs online all requests (Input or Output ) route to ServerA and Stop App on ServerB.