[CentOS] use pssh to restart a service

Tim Dunphy

bluethundr at gmail.com
Sat Oct 31 21:04:53 UTC 2015


Hi all,

 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"
[1] 17:01:50 [FAILURE] bluethundr at es2.example.com Exited with error code 1
[2] 17:01:51 [FAILURE] bluethundr at es3.example.com Exited with error code 1
[3] 17:01:51 [FAILURE] bluethundr at es1.example.com 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"
[1] 17:00:40 [SUCCESS] bluethundr at es1.example.com
[2] 17:00:41 [SUCCESS] bluethundr at es3.example.com
[3] 17:00:41 [SUCCESS] bluethundr at es2.example.com

What am I doing wrong?

Thanks,
Tim


-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B



More information about the CentOS mailing list