Moving NameNode Roles

This section describes two procedures for moving NameNode roles. Both procedures require cluster downtime. If highly
availability is enabled for the NameNode, you can use a Cloudera Manager wizard to automate the migration process. Otherwise you must manually delete and add the NameNode role to a new host.

Select the checkboxes next to the desired host. The list of available roles to migrate displays. Deselect any roles you do not want to migrate. When migrating a NameNode, the co-located Failover
Controller must be migrated as well.

Click the Destination Host text field and specify the host to which the roles will be migrated. On destination hosts, indicate whether to delete data
in the NameNode data directories and JournalNode edits directory. If you choose not to delete data and such role data exists, the Migrate Roles command will not complete successfully.

Acknowledge that the migration process incurs service unavailability by selecting the Yes, I am ready to restart the cluster now checkbox.

Make a backup of the dfs.name.dir directories on the existing NameNode host. Make sure you back up the fsimage and
edits files. They should be the same across all of the directories specified by the dfs.name.dir property.

Copy the files you backed up from dfs.name.dir directories on the old NameNode host to the host where you want to run the NameNode.

Go to the HDFS service.

Click the Instances tab.

Select the checkbox next to the NameNode role instance and then click the Delete button. Click Delete again to confirm.

In the Review configuration changes page that appears, click Skip.

Click Add Role Instances to add a NameNode role instance.

Select the host where you want to run the NameNode and then click Continue.

Specify the location of the dfs.name.dir directories where you copied the data on the new host, and then click Accept
Changes.

Start cluster services. After the HDFS service has started,
Cloudera Manager distributes the new configuration files to the DataNodes, which will be configured with the IP address of the new NameNode host.

NameNode Post-Migration Steps

After moving a NameNode, if you have a Hive or Impala service, perform the following steps:

If this documentation includes code, including but not limited to, code examples, Cloudera makes this available to you under the terms of the Apache License, Version 2.0, including any required
notices. A copy of the Apache License Version 2.0 can be found here.