Re:Cluster SSH – Manage Multiple Linux Servers Simultaneously
by scarby2 on Tuesday October 29, 2019 @12:14PM
(#21388813)
this is good for a few servers - but its sequential nature will become onerous if for example you needed to run something that took 10 minutes on 100 hosts.
ansible ad-hoc commands do almost exactly what you do but in a more scalable fashion
https://docs.ansible.com/ansible/latest/user_guide/intro_adh...
Re:Cluster SSH – Manage Multiple Linux Servers Simultaneously
by reacweb on Tuesday October 29, 2019 @12:34PM
(#21389058)
<list_of_hosts xargs -I {} -P 0 -n 1 ssh {} hostname
Re:Cluster SSH – Manage Multiple Linux Servers Simultaneously
by downerending on Tuesday October 29, 2019 @12:59PM
(#21389374)
Here's a more polished version of just this idea: https://github.com/michaelkarlcoleman/ssssh
Re:Cluster SSH – Manage Multiple Linux Servers Simultaneously
by latchkey on Wednesday October 30, 2019 @02:09AM
(#21395048)
This is not transactional. What happens when a host reboots randomly in the middle of execution? Or the network drops? You're stuck looking through the logs to see the failure along the way. No thanks. I want something that forces me to be idempotent and retries automatically on failures.
<run-on-all.sh>
All one needs to do is call it like so: ./run-on-all.sh /path/to/cluster/file/list-of-servers-here.txt "sleep 60; reboot"