How to start Hadoop, Accumulo, and ZooKeeper from a java program?
There isn't any specific API to start the Hadoop services or Zookeeper services in my view.Take for an instance the class org.apache.hadoop.hdfs.server.namenode.NameNode
Though you can use the main()
in the above class to start the service.
From the script, Hadoop uses something like the following to start the services calling the main() function of the different classes with arguments.
nohup $_JAVA_EXEC -Dproc_$COMMAND $JAVA_HEAP_MAX $HADOOP_OPTS -classpath "$CLASSPATH" $CLASS "$@" > "$_HADOOP_DAEMON_OUT" 2>&1 < /dev/null
Where, CLASS = org.apache.hadoop.hdfs.server.namenode.NameNodeOthers are self explanatory.