0

I have the following requirements: 1. Implement the load balancing for two same processes(Mirth3.0.1) available on two different LINUX machine. 2. The two processes(Mirth) capable to receiving the requests. 3. If a process over UNIX server taking lots of CPU usage then switch to other process running on different LINUX sever.

Let me know how this can be achieved using JMX. OR let me know if this can be achieved using different programming technique.

Thanks!

Rohit
  • 445
  • 2
  • 7
  • 17
  • You seem to be confusing "load balancing" with "high availability". Also, you should try the [all-knowing oracle](http://www.google.com). – Elliott Frisch Jan 23 '14 at 05:18
  • Right now, I am not bothering about the clustering which I suppose is high availability. Sorry, if I am wrong here because I have recently learned the terms "load balancing" and "clustering". I have to do the load balancing by looking the CPU usage of a process and then switching to the other process over different server – Rohit Jan 23 '14 at 05:29

1 Answers1

0

You'd generally need a 3rd process that acts a "reverse proxy". All the requests go to that process and it will route the request and response to whichever server is the active one.

This 3rd process would also be looking at the machines to measure CPU (using JMX or whatever tools you'd like), and use some logic to change the active server.

Ted Bigham
  • 4,237
  • 1
  • 26
  • 31
  • In my requirements the 3rd process(let's JMX) can't handle the request and response becoz the process(Mirth) which I have to monitor runs on its own. – Rohit Jan 23 '14 at 05:35
  • I guess I'm not sure what you mean by "runs on its own". Typically the load balancer would be on it's own machine, although it could run on one of the two servers as well. – Ted Bigham Jan 23 '14 at 05:48
  • The processes which I have mentioned in my question are actually Mirth channels which runs like crone jobs. Mirth channel/process runs as soon as events triggers such as placing TXT file in IN folder as soon as file comes there, Mirth starts processing it. So JMX would not have any idea what Mirth process is executing. It have to look into the CPU usage of Mirth process. – Rohit Jan 23 '14 at 06:01
  • 1
    Got it. So in your example of a file trigger, you'd still use a 3rd process and it would have it's own folder to receive files. Then based on the load, it would decide which one to send it to (scp/ftp). For other trigger types it might not be that easy. Also, for getting the CPU load, the 3rd process could open an ssh port and query for it. See this thread for details around possible commands: http://stackoverflow.com/questions/9229333/how-to-get-overall-cpu-usage-e-g-57-on-linux – Ted Bigham Jan 23 '14 at 06:29
  • I have spent hours to know how to get the process IDs(including non java applications) and names of all process running on the same machine using JMX but hasn't found the solution yet. Please suggest. – Rohit Jan 30 '14 at 00:23