Giter Site home page Giter Site logo

zlocker's Introduction

zlocker: zookeeper based isolated command execution

⚠️ Usage of this tool is deprecated and being replaced by consul lock. Please check the Consul Lock Documentation for details on how to use it.

Build Status

zlocker is a small tool meant to ease sequential execution of a command across a large number of hosts.

Configuration

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.

Building

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

Example usage

zlocker -z zk01,zk02,zk03 -l /zlock-service-restart service my-daemon restart

zlocker's People

Contributors

pyr avatar brutasse avatar jpmenil avatar falzm avatar irregulator avatar exo-cedric avatar gabrielexoscale avatar

Stargazers

Naadir Jeewa avatar

Watchers

 avatar Pierre-Jean Coudert avatar Max Penet avatar Sébastien Fievet avatar Sebastian Krohn avatar James Cloos avatar Thiago Dantas avatar Antoine Coetsier avatar Anthony Galea avatar PM Alamy avatar Loic Lambiel avatar Benoit Capitanio avatar Alessandro Ratti avatar Mathieu Corbin avatar Piotr Roterski avatar Alexandre Dubois avatar  avatar alix brunsperger avatar Victor Boglea avatar Pierre-Emmanuel Jacquier avatar  avatar Jessica Toscani avatar

zlocker's Issues

zlocker eats first command

Seems zlocker eats the first command instruction:

$ zlocker -z `cat /etc/zlocker.cluster.conf` -l /zlock-test -w 5 -- sh -c "echo start; sleep 30; echo end"
zlocker: Connected to 
zlocker: Authenticated: id=216172784299502539, timeout=40000
zlocker: Re-submitting `0` credentials after reconnect
end
command finished, sleeping

'echo start' wasn't executed. If I add it a second time:

$ zlocker -z `cat /etc/zlocker.cluster.conf` -l /zlock-test -w 5 -- sh -c "echo start; echo start; sleep 30; echo end"
zlocker: Connected to 
zlocker: Authenticated: id=144660276477914487, timeout=40000
zlocker: Re-submitting `0` credentials after reconnect
start
end
command finished, sleeping

cancel execution of a command if it fails on one host

It could be very useful to have a way to stop the execution of a command on hosts after it fails on one host.

  • don't release lock if command fails
  • add an execution timeout so if a host can't get a lock after thus duration, execution is cancelled

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.