2. Stopping HDP services

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

  • Nagios

  • Ganglia

  • Oozie

  • WebHCat

  • Hive Metastore

  • ZooKeeper

  • HBase

  • MapReduce

  • HDFS

  1. Stop Nagios. On the Nagios host machine, execute the following command:

    service nagios stop 

  2. Stop Ganglia.

    1. Execute this command on the Ganglia server host machine:

      /etc/init.d/hdp-gmetad stop
    2. Execute this command on all the nodes in your Hadoop cluster:

      /etc/init.d/hdp-gmond stop
  3. Stop Oozie.

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

    su -l hcat -c "/usr/lib/hcatalog/sbin/webhcat_server.sh  stop"
  5. Stop Hive. On the Hive Metastore host machine and Hive Server2 host machine, execute the following command:

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

  6. Stop ZooKeeper. On the ZooKeeper host machine, execute the following command:

    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" 

  7. Stop HBase.

    1. Execute these commands on all RegionServers:

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

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

    1. Execute these commands on all TaskTrackers:

      su -l mapred -c "/usr/lib/hadoop/bin/hadoop-daemon.sh --config /etc/hadoop/conf stop tasktracker"
    2. Execute these commands on the JobTracker host machine:

      su -l mapred -c "/usr/lib/hadoop/bin/hadoop-daemon.sh --config /etc/hadoop/conf stop historyserver"
    3. Execute theses commands on the JobTracker host machine:

      su -l mapred -c "/usr/lib/hadoop/bin/hadoop-daemon.sh --config /etc/hadoop/conf stop jobtracker"
  9. Stop HDFS

    1. Execute these commands on all DataNodes:

      su -l hdfs -c "/usr/lib/hadoop/bin/hadoop-daemon.sh --config /etc/hadoop/conf stop datanode"
    2. Execute these commands on the Secondary NameNode host machine:

      su -l hdfs -c "/usr/lib/hadoop/bin/hadoop-daemon.sh --config /etc/hadoop/conf stop secondarynamenode” 
    3. Execute these commands on the NameNode host machine:

      su -l hdfs -c "/usr/lib/hadoop/bin/hadoop-daemon.sh --config /etc/hadoop/conf stop namenode"