Friday, 13 September 2013

How to start Hadoop, Accumulo, and ZooKeeper from a java program?

How to start Hadoop, Accumulo, and ZooKeeper from a java program?

I am attempting to convert a bash script to a java program. Within this
script I run the start scripts for Hadoop, Zookeeper, and Accumulo:
/hadoop/bin/start_all.sh
/zookeeper/bin/zkServer.sh start
/accumulo/bin/start_all.sh
This is simple to do in a script. And if the programs are already running
I can call these startup scripts again no issue and the programs will
simply output that they are already running and their pids.
I'm trying to figure out if there is a way to do this within a java
program. Is there some hidden command in the Hadoop/ZooKeeper/Accumulo API
where I can run Class.run(configs) and it'll start or try to start
Hadoop/ZooKeeper/Accumulo?
My next step is that I can probably use jsch to run ssh commands, but that
seems like I'm not really leaving the bash script behind.

No comments:

Post a Comment