Start the Hadoop services in the following order:
Knox
ZooKeeper
HDFS
YARN
HBase
Hive Metastore
HiveServer2
WebHCat
Oozie
Instructions
Start Knox. When starting the gateway with the script below, the process runs in the background. The log output is written to
/var/log/knox
and a PID (process ID) is written to/var/run/knox
. Execute this command on the Knox host machine.cd $GATEWAY_HOME su -l knox -c "bin/gateway.sh start"
where
$GATEWAY_HOME
is the is the directory where Knox is installed. For example,/usr/lib/knox
.Note If Knox has been stopped without using
gateway.sh stop
, you must start the service usinggateway.sh clean
. The clean option removes all log files in/var/log/knox
.Start ZooKeeper. Execute this command on the ZooKeeper host machine(s):
su - zookeeper -c "export ZOOCFGDIR=/etc/zookeeper/conf ; export ZOOCFG=zoo.cfg ; source /etc/zookeeper/conf/zookeeper-env.sh ; /usr/lib/zookeeper/bin/zkServer.sh start"
Start HDFS
If you are running NameNode HA (High Availability), start the JournalNodes by executing these commands on the JournalNode host machines:
su $HDFS_USER /usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf start journalnode
where
$HDFS_USER
is the HDFS user. For example, hdfs.Execute this command on the NameNode host machine(s):
su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf start namenode"
If you are running NameNode HA, start the Zookeeper Failover Controller (ZKFC) by executing the following command on all NameNode machines. The starting sequence of the ZKFCs determines which NameNode will become Active.
su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf start zkfc"
If you are not running NameNode HA, execute the following command on the Secondary NameNode host machine. If you are running NameNode HA, the Standby NameNode takes on the role of the Secondary NameNode.
su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf start secondarynamenode”
Execute these commands on all DataNodes:
su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf start datanode"
Start YARN
Execute this command on the ResourceManager host machine(s):
su -l yarn -c "export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec && /usr/lib/hadoop-yarn/sbin/yarn-daemon.sh --config /etc/hadoop/conf start resourcemanager"
Execute this command on the History Server host machine:
su -l mapred -c "export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec && /usr/lib/hadoop-mapreduce/sbin/mr-jobhistory-daemon.sh --config /etc/hadoop/conf start historyserver"
Execute this command on all NodeManagers:
su -l yarn -c "export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec && /usr/lib/hadoop-yarn/sbin/yarn-daemon.sh --config /etc/hadoop/conf start nodemanager"
Start HBase
Execute this command on the HBase Master host machine:
su -l hbase -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf start master; sleep 25"
Execute this command on all RegionServers:
su -l hbase -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf start regionserver"
Start the Hive Metastore. On the Hive Metastore host machine, execute the following command:
su $HIVE_USER nohup hive --service metastore>/var/log/hive/hive.out 2>/var/log/hive/hive.log &
where,
$HIVE_USER
is the Hive user. For example,hive
.Start HiveServer2. On the Hive Server2 host machine, execute the following command:
su $HIVE_USER nohup /usr/lib/hive/bin/hiveserver2 -hiveconf hive.metastore.uris=" " >>/tmp/hiveserver2HD.out 2>> /tmp/hiveserver2HD.log &
where,
$HIVE_USER
is the Hive user. For example,hive
.Start WebHCat. On the WebHCat host machine, execute the following command:
su -l hcat -c "/usr/lib/hcatalog/sbin/webhcat_server.sh start"
Start Oozie. Execute these commands on the Oozie host machine.
su $OOZIE_USER /usr/lib/oozie/bin/oozie-start.sh
where
$OOZIE_USER
is the Oozie user. For example,oozie
.