A fault-tolerant architecture to achieve consensus of updates amongst replicated state machine KV-store nodes using Paxos.
It's set up to allow multiple concurrent clients to communicate with any of the servers and perform three basic operations:
- PUT(key, value)
- GET(key)
- DELETE(key)
- Open up two terminal windows and navigate to
/Project4/src - In one window, type
javac node/*.java utils/*.java main/PaxosServerCreator.java(hit ↩), followed byjava main.PaxosServerCreator(hit ↩) - The nodes are now running
- In the other window, type
javac client/*.java utils/*.java main/ClientMain.java(hit ↩), followed byjava main.ClientMain <hostname> <port>(hit ↩) - The client is now running
- The predefined protocol is:
PUT:key:value(hit ↩)GET:key(hit ↩)DELETE:key(hit ↩)
- To pre-populate the nodes, type
pp(hit ↩) - To shut down the application, type
stop(hit ↩) orshutdown(hit ↩)
SIDE NOTES
- Each node has a 10% chance of randomly failing in the prepare and accept phases.
- Other failure cases are the following:
- A client tries to delete a nonexistent key.
- A client tries to add an already existent key.
- At boot up, the user has to specify which node to connect to.