1

I have some java processes which need to be started by roster:

J1 on X --> J2 on Y --> J3 on Z

An idea comes to my mind is let J1 start automatically and use Nagios + NRPE to start J2 based the J1 state. Is there any better way to do this?

quanta
  • 51,413
  • 19
  • 159
  • 217

1 Answers1

2

Use ssh with public key encryption.

I had an environment like this. Starting the primary (J1 in your example) would connect to host Y and run command J2. Again, in your example, I would make the startup of J2 do the same thing: connect to Z and start J3.

Use ssh this way (with a public key) to start J2 from X:

ssh -i J2-on-Y.key user@y start j2

Likewise, starting up J2 on Y would have this command:

ssh -i J3-on-Z.key user@z start j3

With this in place, starting J1 would bring up all of the rest. Don't forget to account for shutdown as well - as well as the case when a startup is attempted but the process is already running.

Mei
  • 4,590
  • 8
  • 45
  • 53