Ambari User's Guide
Also available as:
PDF
loading table of contents...

How To Configure NameNode High Availability

  1. Check to make sure you have at least three hosts in your cluster and are running at least three ZooKeeper servers.

  2. Check to make sure that the HDFS and ZooKeeper services are not in Maintenance Mode.

    These services will be stopped and started when enabling NameNode HA. Maintenance Mode will prevent those start and stop operations from occurring. If the HDFS or ZooKeeper services are in Maintenance Mode the NameNode HA wizard will not complete successfully.

  3. In Ambari Web, select Services > HDFS > Summary.

  4. Select Service Actions and choose Enable NameNode HA.

  5. The Enable HA Wizard launches. This wizard describes the set of automated and manual steps you must take to set up NameNode high availability.

  6. Get Started : This step gives you an overview of the process and allows you to select a Nameservice ID. You use this Nameservice ID instead of the NameNode FQDN once HA has been set up. Click Next to proceed.

  7. Select Hosts : Select a host for the additional NameNode and the JournalNodes. The wizard suggest options that you can adjust using the drop-down lists. Click Next to proceed.

  8. Review : Confirm your host selections and click Next.

  9. Create Checkpoints : Follow the instructions in the step. You need to log in to your current NameNode host to run the commands to put your NameNode into safe mode and create a checkpoint. When Ambari detects success, the message on the bottom of the window changes. Click Next.

  10. Configure Components : The wizard configures your components, displaying progress bars to let you track the steps. Click Next to continue.

  11. Initialize JournalNodes : Follow the instructions in the step. You need to login to your current NameNode host to run the command to initialize the JournalNodes. When Ambari detects success, the message on the bottom of the window changes. Click Next.

  12. Start Components : The wizard starts the ZooKeeper servers and the NameNode, displaying progress bars to let you track the steps. Click Next to continue.

  13. Initialize Metadata : Follow the instructions in the step. For this step you must log in to both the current NameNode and the additional NameNode. Make sure you are logged in to the correct host for each command. Click Next when you have completed the two commands. A Confirmation pop-up window displays, reminding you to do both steps. Click OK to confirm.

  14. Finalize HA Setup : The wizard the setup, displaying progress bars to let you track the steps. Click Done to finish the wizard. After the Ambari Web GUI reloads, you may see some alert notifications. Wait a few minutes until the services come back up. If necessary, restart any components using Ambari Web.

  15. If you are using Hive, you must manually change the Hive Metastore FS root to point to the Nameservice URI instead of the NameNode URI. You created the Nameservice ID in the Get Started step.

    1. Find the current FS root on the Hive host:

      hive --config /etc/hive/conf/conf.server --service metatool -listFSRoot

      The output should look similar to Listing FS Roots... hdfs://<namenode-host>/apps/hive/warehouse.

    2. Change the FS root:

      $ hive --config /etc/hive/conf/conf.server --service metatool -updateLocation <new-location><old-location>

      For example, if your Nameservice ID is mycluster, you input:

      $ hive --config /etc/hive/conf/conf.server --service metatool -updateLocation hdfs://mycluster/apps/hive/warehouse hdfs://c6401.ambari.apache.org/apps/hive/warehouse.

      The output looks similar to:

      Successfully updated the following locations...Updated X records in SDS table

      [Important]Important

      The Hive configuration path for a default HDP 2.3.x or later stack is /etc/hive/conf/conf.server

      The Hive configuration path for a default HDP 2.2.x or earlier stack is /etc/hive/conf

  16. Adjust the ZooKeeper Failover Controller retries setting for your environment.

    1. Browse to Services > HDFS > Configs > Advanced core-site.

    2. Set ha.failover-controller.active-standby-elector.zk.op.retries=120