How to restart Hadoop services

Hadoop service restarts apply configuration changes but can interrupt HDFS access, YARN scheduling, or running application logs. Restart the smallest daemon set that needs the change instead of bouncing the entire cluster by habit.

Apache archive installs commonly use hdfs –daemon, yarn –daemon, and the start-* or stop-* scripts. Packaged distributions may wrap those daemons in systemd units, so confirm the local service model first.

For configuration changes, stop or restart services only after the XML files are distributed to the hosts that load them. Verify HDFS and YARN state after the restart.

Steps to restart Hadoop services:

  1. Check whether archive daemon scripts are in use.
    $ command -v hdfs
    /opt/hadoop/bin/hdfs
  2. Restart a single HDFS daemon when only one role changed.
    $ hdfs --daemon stop datanode
    Stopping datanode
  3. Start the HDFS daemon again.
    $ hdfs --daemon start datanode
  4. Restart YARN daemons when scheduler or NodeManager settings changed.
    $ stop-yarn.sh
    Stopping resourcemanager
    Stopping nodemanagers
  5. Start YARN daemons.
    $ start-yarn.sh
    Starting resourcemanager
    Starting nodemanagers
  6. Verify HDFS daemon health.
    $ hdfs dfsadmin -report
    Live datanodes (3):
    Dead datanodes (0):
  7. Verify YARN accepts client requests.
    $ yarn application -list
    Total number of applications (application-types: [] and states: [SUBMITTED, ACCEPTED, RUNNING]):0