Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
25% Recurring Discount on NVMe VPS
Try EnsoVPN - Reliable VPN - 1-Day Free Trial
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
CloudLinux
Try EnsoVPN - Fast & Private VPN - 1-Day Free Trial
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Clush: clustershell for multiple node administration

Yes, i love those bargain LET deals too. But administrating them uniformly can be very cumbersome. Thats why i was searching something easier(lighter) than some dashboard tool or chef,puppet, ansible, teraform. I came across clush. What i like about clustershell (clush in short) similarly like ansible, clustershell communicates over ssh to your nodes. No need for agent installs, also there is no extra credential administration needed. Just use your already in place ssh keys plus your .ssh/config. And your configuration is already done. So if you can ssh into your nodes, you are good to go with clush.

Some clush examples;

    # administration example: update your 100 ubuntu webservers

    $ clush -w web[1-100] " sudo apt update && sudo apt upgrade -y"

    # logging example: check top process on srv1 and srv2 

    $ clush -w srv1,srv2 "ps -eo pid,user,%cpu,%mem,comm --sort=-%cpu | head"

    srv1:     PID USER     %CPU %MEM COMMAND
    srv1:  619792 dbadude  57.1  0.3 ps
    srv1:  619768 dbadude  14.8  0.7 systemd
    srv1:  619765 root      4.0  0.7 sshd
    srv1:  275753 root      0.3  4.4 tailscaled
    srv1:  604758 root      0.0  0.0 kworker/0:1-events
    srv1:      15 root      0.0  0.0 rcu_preempt
    srv1:     404 message+  0.0  0.3 dbus-daemon
    srv1:      28 root      0.0  0.0 kcompactd0
    srv1:     189 root      0.0  2.0 systemd-journal
    srv2:     PID USER     %CPU %MEM COMMAND
    srv2:  246506 dbadude  50.0  0.2 ps
    srv2:  246481 dbadude  10.6  0.5 systemd
    srv2:  246478 root      1.2  0.5 sshd
    srv2:     408 root      0.1  5.5 tailscaled
    srv2:  242965 root      0.0  0.0 kworker/0:0-events
    srv2:      15 root      0.0  0.0 rcu_preempt
    srv2:     393 message+  0.0  0.2 dbus-daemon
    srv2:     401 root      0.0  0.4 systemd-logind
    srv2:      28 root      0.0  0.0 kcompactd0


    #group actions example:

    # create groups of machines (web,db and all in this example) ;

    $nano /etc/clustershell/groups.d/local.yaml
    web:
      - web01
      - web02
      - web03

    db:
      - db01
      - db02

    all:
      - web01
      - web02
      - web03
      - db01
      - db02

    # do a operation on a server group (firing my backupscripts);

    clush -g db "/usr/local/scripts/backup_db.sh"

Its all in parallel too. And yes I dont like ansbible(yes ansbible) or puppet for small probing into your grid. Tinkering with your machines, should not be static configuration file exercise, and hope for the best. Shell work should always be interactive. And now you can do it over your whole chicken farm.

Have fun cli tinkering with your idlers.

Thanked by 1buggedout
Sign In or Register to comment.