https://github.com/o19s/jackhanna
Simple CLI for Zookeeper
https://github.com/o19s/jackhanna
cli zookeeper
Last synced: 12 months ago
JSON representation
Simple CLI for Zookeeper
- Host: GitHub
- URL: https://github.com/o19s/jackhanna
- Owner: o19s
- License: apache-2.0
- Created: 2015-08-18T18:44:09.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T16:46:33.000Z (over 4 years ago)
- Last Synced: 2025-04-05T15:22:38.058Z (over 1 year ago)
- Topics: cli, zookeeper
- Language: Java
- Size: 37.1 KB
- Stars: 5
- Watchers: 6
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jackhanna
Simple CLI for Zookeeper
Why do we need another CLI for Zookeeper you ask?
I was bitten by the fact that the CLI that ships with Zookeeper, `zkCli.sh` is jsut one character different then the one that ships with Solr, `zkcli.sh`. Several hours of debugging later, I decided to write my own! I wanted to use the same commands I use in Unix, `ls`, `cat`, `rm`, `du` etc to work with data in Zookeeper.
There isn't a good one out there that is just based on Java, you need Go or Python or Scala as dependencies. I wanted to build a simple one that would allow the basic Unix style operators to work with Zookeeper.
The original version of this was based on the Solr client, and then I ported it to Curator.
## Examples of using the CLI
List out nodes:
```
java -jar jackhanna.jar localhost:2181 ls /environment
java -jar jackhanna.jar localhost:2181 ls --zkPath=/environment
```
View the contents of a node:
```
java -jar jackhanna.jar localhost:2181 cat /environment/somevalue
java -jar jackhanna.jar localhost:2181 cat --zkPath=/environment/somevalue
```
List out the disk usage in Zookeeper:
```
java -jar jackhanna.jar localhost:2181 du /environment
java -jar jackhanna.jar localhost:2181 du --zkPath=/environment
```
Delete nodes in Zookeeper:
```
java -jar jackhanna.jar localhost:2181 rm /environment/properties
java -jar jackhanna.jar localhost:2181 rm --zkPath=/environment/properties
```
Put a single file into Zookeeper:
```
java -jar jackhanna.jar localhost:2181 putfile --zkFile /configs/ecommerce/rules.txt --file ./src/main/resources/sample_rules.txt
```
or to put a single file into a directory:
```
java -jar jackhanna.jar localhost:2181 put --zkPath /environment/config/log4j.xml --path ./src/main/resources/log4j.xml
```
Put a directory of files into Zookeeper:
```
java -jar jackhanna.jar localhost:2181 put --zkPath /environment/configs/resources --path ./src/main/resources
```
Get a single file from Zookeeper:
```
java -jar jackhanna.jar localhost:2181 get --zkPath /environment/config/log4j.xml --path /tmp
```
Get a directory of files from Zookeeper:
```
java -jar jackhanna.jar localhost:2181 get --zkPath /environment/configs/resources --path /tmp
```
## How to install on your system ##
There should be a `brew install jackhanna` but I haven't figured that out! For now you need to check the code out and do:
```
mvn install
cp ./bin/jackhanna /usr/local/bin
jackhanna --help
```