This is an inventory system built using apache zookeeper to demonstrate a mini distributed system with two phase commit.
-
Make sure whether zookeeper is running.
In Zookeeper directory you can,
./bin/zkServer.sh start conf/zoo_sample.cfg
To check whether Zookeeper is running (On windows)
netstat -ano | findStr "2181"
To stop the zookeeper, in zookeeper directory,
./bin/zkServer.sh stop conf/zoo_sample.cfg
-
To run each node, in
inventory-control-server
directory.java -jar target/inventory-control-server-1.0.0-jar-with-dependencies.jar <port>
-
Then you can invoke client commands through
inventory-control-client
directory.java -jar target/inventory-control-client-1.0.0-jar-with-dependencies.jar <host> <port> <command>