2.1. Decommission DataNodes

Use the following instructions to decommission DataNodes in your cluster:

  1. On the NameNode host machine, edit the $HADOOP_CONF_DIR/dfs.exclude file and add the list of DataNodes hostnames (separated by newline character).

    where $HADOOP_CONF_DIR is the directory for storing the Hadoop configuration files. For example, /etc/hadoop/conf.

  2. Update the NameNode with the new set of permitted DataNodes. On the NameNode host machine, execute the following command:

    su - $HDFS_USER
    % hadoop dfsadmin –refreshNodes

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

  3. Open the NameNode web UI (http://$NameNode_FQDN:50070) and navigate to Decommissioning Nodes page.

    Check whether the admin state has changed to Decommission In Progress for the DataNodes being decommissioned.

  4. When all the DataNodes report their state as Decommissioned then all the blocks have been replicated. Shut down the decommissioned nodes.

  5. On the NameNode host machine, remove the decommissioned nodes from the $HADOOP_CONF_DIR/dfs.include file and execute the following command:

    su - $HDFS_USER
    % hadoop dfsadmin –refreshNodes


loading table of contents...