On all nodes:
For RHEL/CentOS:
yum upgrade hadoop*
For SLES:
zypper update hadoop*
Start HDFS.
Start NameNode. On the NameNode host machine, execute the following command:
sudo su -l $HDFS_USER -c "/usr/lib/hadoop/bin/hadoop-daemon.sh start namenode -upgrade"Start Secondary NameNode. On the Secondary NameNode host machine, execute the following command:
sudo su -l $HDFS_USER -c "/usr/lib/hadoop/bin/hadoop-daemon.sh start secondarynamenode"Start DataNodes. On all the DataNodes, execute the following command:
sudo su -l $HDFS_USER -c "/usr/lib/hadoop/bin/hadoop-daemon.sh start datanode"where
$HDFS_USERis the HDFS Service user. For example,hdfs.Execute the following command on the NameNode machine:
hadoop dfsadmin -safemode wait
Track the status of the upgrade:
hadoop dfsadmin -upgradeProgress status
Continue tracking until you see:
Upgrade for version -44 has been completed. Upgrade is not finalized.
![[Note]](../common/images/admon/note.png)
Note You finalize the upgrade later.
The upgrade is now fully functional but not yet finalized. Using the
finalizecomand removes the previous version of the NameNode and DataNode's storage directories.![[Important]](../common/images/admon/important.png)
Important Once the upgrade is finalized, the system cannot be rolled back. Usually this step is not taken until a thorough testing of the upgrade has been performed.
The upgrade must be finalized, however, before another upgrade can be performed.
To finalize the upgrade:
su $HDFS_USER hadoop dfsadmin -finalizeUpgrade
where
$HDFS_USERis the HDFS Service user. For example,hdfs.Start MapReduce.
Start JobTracker. On the JobTracker host machine, execute the following command:
sudo su -l $MAPRED_USER -c "/usr/lib/hadoop/bin/hadoop-daemon.sh start jobtracker"Start JobHistory Server. On the JobHistory Server host machine, execute the following command:
sudo su -l $MAPRED_USER -c "/usr/lib/hadoop/bin/hadoop-daemon.sh start historyserver"Start all TaskTrackers. On all the TaskTrackers, execute the following command:
sudo su -l $MAPRED_USER -c \"/usr/lib/hadoop/bin/hadoop-daemon.sh start tasktracker\"where
$MAPRED_USERis the MapReduce Service user. For example,mapred.

