Before you start HDFS on a highly available HDFS cluster, you must start the ZooKeeper
service. If you do not start the ZKFC, there can be failures.

To start HDFS, run commands as the $HDFS_USER.

Note

The su commands in this section use keywords to represent the Service
user. For example, "hdfs" is used to represent the HDFS Service user. If you are using
another name for your Service users, you need to substitute your Service user name in each
of the su commands.

Replace your configuration after upgrading on all the HDFS nodes. Replace the HDFS
template configuration in /etc/hdfs/conf.

If you are upgrading from a highly available HDFS cluster configuration, start all
JournalNodes. On each JournalNode host, run the following commands:

Run this command with the -upgrade option only once. After you have completed this
step, you can bring up the NameNode using this command without including the -upgrade
option.

To check if the Upgrade is in progress, check that the "\previous" directory has been
created in the \NameNode and \JournalNode directories. The "\previous" directory contains
a snapshot of the data before upgrade.

In a highly available HDFS cluster configuration, this NameNode does not enter the
standby state as usual. Rather, this NameNode immediately enters the active state, perform
an upgrade of its local storage directories, and also perform an upgrade of the shared
edit log. At this point, the standby NameNode in the HA pair is still down. It is out of
sync with the upgraded active NameNode.

To synchronize the active and standby NameNode, re-establishing HA, re-bootstrap the
standby NameNode by running the NameNode with the '-bootstrapStandby' flag. Do NOT start
this standby NameNode with the '-upgrade' flag.

su - hdfs -c "hdfs namenode -bootstrapStandby -force"

The bootstrapStandby command downloads the most recent fsimage from the active
NameNode into the $dfs.name.dir directory of the standby NameNode. You can enter that
directory to make sure the fsimage has been successfully downloaded. After verifying,
start the ZKFailoverController, then start the standby NameNode. You can check the status
of both NameNodes using the Web UI.

Verify that the NameNode is up and running:

ps -ef|grep -i NameNode

If you do not have a highly available HDFS cluster configuration (non_HA namenode),
start the Secondary NameNode.

Note

Do not perform this step if you have a highly available HDFS cluster
configuration.