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.

After moving a NameNode, if you have a Hive or Impala service, perform the steps in NameNode Post-Migration Steps.

Moving Highly Available NameNode, Failover Controller, and JournalNode Roles Using the Migrate Roles Wizard

Minimum Required Role: Cluster Administrator (also provided by Full Administrator)

The Migrate Roles wizard allows you to move roles of a highly available HDFS service from one host to another. You can use it to move NameNode, JournalNode, and Failover Controller roles.

Requirements and Limitations

  • Nameservice federation (multiple namespaces) is not supported.
  • This procedure requires cluster downtime, not a shutdown. The services discussed in this list must be running for the migration to complete.
  • The configuration of HDFS and services that depend on it must be valid.
  • The destination host must be commissioned and healthy.
  • The NameNode must be highly available using quorum-based storage.
  • HDFS automatic failover must be enabled, and the cluster must have a running ZooKeeper service.
  • If a Hue service is present in the cluster, its HDFS Web Interface Role property must refer to an HttpFS role, not to a NameNode role.
  • A majority of configured JournalNode roles must be running.
  • The Failover Controller role that is not located on the source host must be running.

Before You Begin

Do the following before you run the wizard:
  • On hosts running active and standby NameNodes, back up the data directories.
  • On hosts running JournalNodes, back up the JournalNode edits directory.
  • If the source host is not functioning properly, or is not reliably reachable, decommission the host.
  • If CDH and HDFS metadata was recently upgraded, and the metadata upgrade was not finalized, finalize the metadata upgrade.

Running the Migrate Roles Wizard

  1. If the host to which you want to move the NameNode is not in the cluster, follow the instructions in Adding a Host to the Cluster to add the host.
  2. Go to the HDFS service.
  3. Click the Instances tab.
  4. Click the Migrate Roles button.
  5. Click the Source Host text field and specify the host running the roles to migrate. In the Search field optionally enter hostnames to filter the list of hosts and click Search.
    The following shortcuts for specifying hostname patterns are supported:
    • Range of hostnames (without the domain portion)
      Range Definition Matching Hosts
      10.1.1.[1-4] 10.1.1.1, 10.1.1.2, 10.1.1.3, 10.1.1.4
      host[1-3].company.com host1.company.com, host2.company.com, host3.company.com
      host[07-10].company.com host07.company.com, host08.company.com, host09.company.com, host10.company.com
    • IP addresses
    • Rack name
    Select the checkboxes next to the desired host. The list of available roles to migrate displays. Clear any roles you do not want to migrate. When migrating a NameNode, the co-located Failover Controller must be migrated as well.
  6. 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.
  7. Acknowledge that the migration process incurs service unavailability by selecting the Yes, I am ready to restart the cluster now checkbox.
  8. Click Continue. The Command Progress screen displays listing each step in the migration process.
  9. When the migration completes, click Finish.

Moving a NameNode to a Different Host Using Cloudera Manager

Minimum Required Role: Cluster Administrator (also provided by Full Administrator)

  1. If the host to which you want to move the NameNode is not in the cluster, follow the instructions in Adding a Host to the Cluster to add the host.
  2. Stop all cluster services.
  3. 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.
  4. 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.
  5. Go to the HDFS service.
  6. Click the Instances tab.
  7. Select the checkbox next to the NameNode role instance and then click the Delete button. Click Delete again to confirm.
  8. In the Review configuration changes page that appears, click Skip.
  9. Click Add Role Instances to add a NameNode role instance.
  10. Select the host where you want to run the NameNode and then click Continue.
  11. Specify the location of the dfs.name.dir directories where you copied the data on the new host, and then click Accept Changes.
  12. 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:
  1. Go to the Hive service.
  2. Stop the Hive service.
  3. Select Actions > Update Hive Metastore NameNodes.
  4. If you have an Impala service, restart the Impala service or run an INVALIDATE METADATA query.