Shut down the current DataNode:
su – hdfs -c "hdfs dfsadmin -shutdownDatanode <DATANODE_HOST:IPC_PORT> upgrade"
For example:
su - hdfs -c "hdfs dfsadmin -shutdownDatanode hdp1.lcl:8010 upgrade" Submitted a shutdown request to datanode hdp1.lcl:8010
Check to make sure the DataNode has stopped:
su - hdfs -c "hdfs dfsadmin -getDatanodeInfo <DATANODE_HOST:IPC_PORT> upgrade"
If the DataNode stopped successfully you’ll see a series of retry messages, followed by "Datanode unreachable."
Switch to the new version and start the DataNode:
hdp-select set hadoop-hdfs-datanode 2.2.6.0-2800
su - hdfs -c "/usr/hdp/current/hadoop-hdfs-datanode/../hadoop/sbin/hadoop-daemon.sh start datanode"
To verify that the new DataNode joined the HDFS cluster, list live HDFS processes:
su - hdfs -c "hdfs dfsadmin -report -live"
The report should list the upgraded DataNode as a live node.
Type Control-C to exit the utility.