2. Stopping HDP services

Before performing any upgrades or uninstalling software, stop all of the Hadoop services in the following order:

  • Knox

  • Oozie

  • WebHCat

  • HiveServer2

  • Hive Metastore

  • HBase

  • YARN

  • HDFS

  • Zookeeper

Instructions

  1. Stop Knox. Execute this command on the Knox host machine.

    cd $GATEWAY_HOME su -l knox -c "bin/gateway.sh stop"

    where $GATEWAY_HOME is the is the directory where Knox is installed. For example, /usr/lib/knox.

  2. Stop Oozie. Execute these commands on the Oozie host machine.

    su $OOZIE_USER
    /usr/lib/oozie/bin/oozie-stop.sh 

    where $OOZIE_USER is the Oozie user. For example, oozie.

  3. Stop WebHCat. On the WebHCat host machine, execute the following command:

    su -l hcat -c "/usr/lib/hcatalog/sbin/webhcat_server.sh stop"

  4. Stop Hive. Execute this command on the Hive Metastore and Hive Server2 host machine.

    ps aux | awk '{print $1,$2}' | grep hive | awk '{print $2}' | xargs kill >/dev/null 2>&1  
  5. Stop HBase

    1. Execute this command on all RegionServers:

      su -l hbase -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf stop regionserver"
    2. Execute this command on the HBase Master host machine:

      su -l hbase -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf stop master"
  6. Stop YARN

    1. 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 stop nodemanager"
    2. 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 stop historyserver"
    3. 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 stop resourcemanager"
  7. Stop HDFS

    1. Execute this command on all DataNodes:

      su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop datanode"
    2. If you are not running NameNode HA (High Availability), stop the Secondary NameNode by executing this command on the Secondary NameNode host machine:

      su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop secondarynamenode”
    3. Execute this command on the NameNode host machine(s):

      su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop namenode"
    4. If you are running NameNode HA, stop the Zookeeper Failover Controllers (ZKFC) by executing this command on the NameNode host machines:

      su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf stop zkfc"
    5. If you are running NameNode HA, stop 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 stop journalnode

      where $HDFS_USER is the HDFS user. For example, hdfs.

  8. Stop 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 stop" 


loading table of contents...