I need to restart a service on a few elasticsearch nodes. I’m trying to do it with pssh.
I’m getting this error when I try to do that:
pssh -h es_list “/bin/sudo -S /bin/systemctl restart elasticsearch”
 17:01:50 [FAILURE] firstname.lastname@example.org Exited with error code 1
 17:01:51 [FAILURE] email@example.com Exited with error code 1
 17:01:51 [FAILURE] firstname.lastname@example.org Exited with error code 1
I have to sudo up from my user account as root logins are disallowed.
However a simple ‘echo hello’ command that doesn’t require sudo works fine:
#pssh -h es_list “/bin/echo hello”
 17:00:40 [SUCCESS] email@example.com
 17:00:41 [SUCCESS] firstname.lastname@example.org
 17:00:41 [SUCCESS] email@example.com
What am I doing wrong?