All Projects → svetlyak40wt → Twisted Lock

svetlyak40wt / Twisted Lock

Fault-tolerant distributed lock with REST interface.

Programming Languages

python
139335 projects - #7 most used programming language

Twisted lock

Join the chat at https://gitter.im/svetlyak40wt/twisted-lock

Fault-tolerant distributed lock with REST interface. Internaly, it uses PAXOS protocol to reach consensus on propagated values.

How to install

virtualenv --no-site-packages env
env/bin/pip install Twisted Logbook
# if you want to run unittests, do
env/bin/pip install mock

How to run

Run servers

./server.py configs.example_cluster.server1
./server.py configs.example_cluster.server2
./server.py configs.example_cluster.server3

Now you can:

  • lock:

      curl -X POST -q http://127.0.0.1:9001/blah
    
  • unlock

      curl -X POST -q http://127.0.0.1:9001/blah
    
  • get server info:

      # status
      curl -q http://127.0.0.1:9001/info/status
      # or keys
      curl -q http://127.0.0.1:9001/info/keys
    

How to run tests

There are two types of tests: unittests and stresstests. Errors could be stochastic, that is because all tests need to be run more then once, to be sure that there is no errors.

# run whole testsuite ten times
./run-unittests.sh lock 10
# and now run consistency tests
./run-consistency-tests.sh 10

Credits

Alexander Artemenko ([email protected]) — initial author.

Feel free to fork the project and send me pull requests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].