0

We have deployed a java application which will be run by a job scheduler.

This application might be run on many different server machines of intranet. Now we had a problem that there might be more than one instance of this application running simultaneously on multiple machine of product env, and that's a nightmare and we must to avoid that.

So I would like to know what's the proper way to ensure only one single application instance can be run per network.

Wuaner
  • 929
  • 2
  • 14
  • 31
  • There is a [thread](http://stackoverflow.com/questions/12090442/single-application-instance-per-network) on SO asking the same question as I am. But its a C# one, and I do not found solution there. so I asked here. sorry for duplication. – Wuaner Apr 25 '17 at 12:19
  • That depends so much on your application, your environment and other things. There's no standard "SingleNetworkApplication" solution. – Kayaman Apr 25 '17 at 12:22
  • It's a standalone java application, and the environment is intranet, for example, production environment. – Wuaner Apr 25 '17 at 12:45
  • Well that was helpful. Like I said, there's no standard "SingleNetworkApplication" solution. – Kayaman Apr 25 '17 at 12:46
  • 1
    One approach is to have a scheduler rule where the next run of the app will not start until the previous run completes. Another approach is to simplify and have the standalone code on a single active server (with possibly a cold standby). So if you have a naive scheduler it can only execute on the single machine. The shell script which starts the app can check to see if the process is already running. – Andrew S Apr 25 '17 at 13:09

0 Answers0