TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ad-hoc multi-server management with pdsh and friends

2 pointsby lcall3 months ago
Back when I was occasionally managing many servers, I would have to run the same adhoc command on all of them and see which ones succeeded identically to the others, and which ones failed, for further follow-up. These commands were really useful (assuming ssh keys are set up already, for logins). (I didn&#x27;t know about these until a coworker told me, so I thought I&#x27;d pass it on.):<p>To send the same command to multiple servers, use pdsh: https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;pdsh<p>To collect all the results and show which ones are the same or different, use dshbak (i.e., &quot;pdsh &lt;parameters including servers&gt;|dshbak&quot;): https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;dshbak<p>Similar things, sometimes more convenient but less efficient for a large number of servers, are to use the konsole terminal program and link multiple window tabs together so the same typed command goes to all, and quickly view the results across the tabs; or to use tmux and send the same commands to multiple windows (possible useful &quot;man tmux&quot; page terms: link-window, pipe-pane, related things to those, activity, focus, hooks, control mode).<p>And others that I haven&#x27;t used but which also look possibly interesting for platforms where pdsh and dshbak might not be available (like OpenBSD at least):<p>- https:&#x2F;&#x2F;github.com&#x2F;duncs&#x2F;clusterssh&#x2F;wiki (available on OpenBSD as a package)<p>- https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;parallel&#x2F; (also available as a package on OpenBSD 7.6: named &quot;parallel-20221122&quot;; might relate to &quot;pdksh&quot;)<p>Maye things like Puppet or CFEngine have similar capabilities where those are in place; I haven&#x27;t used them enough to know.

1 comment

lcall3 months ago
The above links but clickable now are:<p>- pdsh: <a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;pdsh" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;pdsh</a><p>- dshbak: <a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;dshbak" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;dshbak</a><p>- clusterssh: <a href="https:&#x2F;&#x2F;github.com&#x2F;duncs&#x2F;clusterssh&#x2F;wiki">https:&#x2F;&#x2F;github.com&#x2F;duncs&#x2F;clusterssh&#x2F;wiki</a><p>- parallel: <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;parallel&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;parallel&#x2F;</a>
评论 #42882869 未加载