GitHub - andrewpillar/cl: Concurrently run commands across multiple servers via...
source link: https://github.com/andrewpillar/cl
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
readme.md
cl is a simple tool that allows you to run multiple commands concurrently across a cluster of servers via SSH. It works by taking the name of the cluster to run the command across, followed by the command to run like so.
$ cl uat systemctl status postgresql
cl expects a ClFile
to be in the current directory from where the
command is invoked. This is a plain-text file that describes the cluster, and
how they can be accessed via SSH.
uat:
db@db-host-1 ~/.ssh/id_rsa
db@db-host-2 ~/.ssh/id_rsa
db@db-host-3 ~/.ssh/id_rsa
The ClFile
The ClFile
expects the cluster of servers to be organised in the below format,
where the heading is the name that will be used via the command, and each
subsequent entry is the server to connect to.
[name]:
[user]@[host]:[port] [identity]
[name]:
A human readable string that specifies the alias for the cluster machines.
[user]
The user to connect to the machine as, if not specified then $USER
will be
used instead.
[host]
The host to connect to, this is always required.
[port]
The port to connect to on the machine, if not specified then 22
will be used
instead.
[identity]
The identity file to use during SSH authentication, if not specified then
~/.ssh/id_rsa
will be used by default.
There is no limit to the number of clusters that can be specifed in the ClFile
.
uat:
db@db-host-1 ~/.ssh/id_rsa
db@db-host-2 ~/.ssh/id_rsa
db@db-host-3 ~/.ssh/id_rsa
prod:
db@prod-db-host1:1234 ~/.ssh/id_prod_db
prod-db-host2:44
prod-db-host3 ~/.ssh/id_rsa
Recommend
-
67
Go Meta Linter gometalinter is DEPRECATED and the project will be archived on 2019-04-07. See #590 for discussion. Switch t...
-
50
automerge - A JSON-like data structure that can be modified concurrently by different users, and merged again automatically.
-
62
README.md Conget Conget is a CLI app which is a concurrent file downloader that download the file data by splitting into several chunks and fetch the data asynchronously. Install...
-
60
README.md brute
-
5
My Bug, My Bad #4: Reading Concurrently posted by Craig Gidney on July 30, 2013 A week ago, I woke up having put two and two to...
-
5
Execute Artisan commands on remote servers Original – ...
-
11
A lightweight solution for running PHP code concurrently This package only works on Linux and Mac or any other systems t...
-
5
A lightweight solution for running PHP code concurrently Original – ...
-
1
Running Multiple Rails Apps Concurrently with Foreman and Procfile.dev Jul 18, 2022
-
9
tvOS 17 delivers spatial audio to two pairs of AirPods concurrently Friday, August 4, 2023 2:01 pm
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK