0

This question is rather hard to ask as I do not know what technology or processes to even leverage to make this happen. If it even is possible.

  1. I have two computers. Master A and Server B.

  2. I want Master A to start a Java process on Server B

  3. I want to be able to "view" the running java processes somehow and be able to interact with this. This means that I want to have some sort of connection to the running java processes on Server B from Master A.

Perhaps this is possible by starting up a container that runs this specific client and allows a remote connecton to it from the master computer?

Is this possible? Thanks!

k9b
  • 1,457
  • 4
  • 24
  • 54
  • Your question is rather broad. What do you want to "view" in the running process? But perhaps [JMX](https://docs.oracle.com/javase/tutorial/jmx/) is what you're looking for. – Andreas May 20 '17 at 07:30

1 Answers1

1

How about using SSH?

https://en.wikipedia.org/wiki/Secure_Shell

Once configured, you can connect from your Master via:

$ ssh user@SLAVE_IP

And then you are logged in the slave computer from the Master one. Once logged in, you can do:

$ cd FOLDER/WHERE/THE/JAR/IS/PLACED
$ java -jar MyJar.jar -DMyProperty=Value...

Is this what you were looking for?

  • Thanks for the response. This would launch the jar on the specified linux machine. I want to be able to interact and view this running jar from the host computer. I've never seen the DMyProperty command before, doubtful that this tag accomplishes that but I shall look into that one thanks :) – k9b May 20 '17 at 07:17
  • @k9b you can send the video too https://unix.stackexchange.com/questions/2302/can-i-pipe-dev-video-over-ssh you can send files https://www.maketecheasier.com/ssh-pipes-linux/ you can do almost everything :) but, if what you want is something like a remote desktop, there are solutions for that too, for example: https://www.realvnc.com/ or https://www.remmina.org/wp/ – Federico José Sorenson May 20 '17 at 07:29
  • BTW, the -D parameter is the way that JAVA has to send properties to your application. Take a look at http://stackoverflow.com/questions/29811377/how-to-pass-system-properties-to-a-jar-file – Federico José Sorenson May 20 '17 at 07:32
  • @k9b Use SSH like this answer suggests for *starting* the java process, then use JMX to *view* it, i.e. the see what's going on inside the process, to change settings (aka *manage* it), and to ask it to shut down gracefully. – Andreas May 20 '17 at 07:33