How to finish all processes in parallel remote servers?

1

When run multiple servers by pssh, here use

pssh -h hosts-file -A -I script.sh

in script.sh, it contains several java commands,

after the command, I want to finish all process, here use:

pnuke -h hosts-file -A script.sh

but when run the process again, it shows some ports had been used (the java command use some ports, so it means the java process still work in each server) After use punk, here is the return info:

[1] 10:43:39 [FAILURE] student@10.18.6.204:22 Exited with error code 1
[2] 10:43:39 [FAILURE] student@10.18.6.202:22 Exited with error code 1
[3] 10:43:39 [FAILURE] student@10.18.6.203:22 Exited with error code 1

So how to finish all parallel java processes in the master server? So it do not need to log into each server to kill them.

Andi

Posted 2016-12-24T14:53:44.090

Reputation: 67

Killing processes with open IO resources always relies on those processes exiting cleanly (closing and releasing their resources) when signaled, which is apparently not happening. What is the return code from pnuke? – Frank Thomas – 2016-12-24T18:21:28.397

[1] 10:43:39 [FAILURE] student@10.18.6.204:22 Exited with error code 1 [2] 10:43:39 [FAILURE] student@10.18.65202:22 Exited with error code 1 [3] 10:43:39 [FAILURE] student@10.18.6.203:22 Exited with error code 1 – Andi – 2016-12-24T20:46:52.350

Answers

0

Here use this:

pnuke -h hosts-file -A java

can finish all java process in each server

Andi

Posted 2016-12-24T14:53:44.090

Reputation: 67

0

Looks like your pnuke command is incorrect, pnuke doesn't accept a script to be sent on standard input in the same way pssh does.

Source: https://www.mankier.com/1/pnuke

Zlemini

Posted 2016-12-24T14:53:44.090

Reputation: 291

0

Can you try:

SSHPASS=`ssh-askpass` PARALLEL_SSH='sshpass ssh' parallel --slf hosts-file script.sh

GNU Parallel should kill remote running jobs when the parent dies.

Ole Tange

Posted 2016-12-24T14:53:44.090

Reputation: 3 034