consul lock
.
Please check the
Consul Lock Documentation
for details on how to use it.
zlocker is a small tool meant to ease sequential execution of a command across a large number of hosts.
zlocker is configured through command line arguments:
-z
Comma-separated list of zookeeper servers to contact
-l
Name of lock node in zookeeper
-w
Optional sleep period, defaults to none
-t
Zookeeper session timeout
The rest of the command line will be fed to the shell if a lock is successfully acquired.
If you wish to inspect zlocker and build it by yourself, you may do so by cloning this repository and peforming the following steps :
go build
zlocker -z zk01,zk02,zk03 -l /zlock-service-restart service my-daemon restart