1. Setting Up NameNode High Availability

On Ambari Web, go to the Admin view. Select High Availability in the left navigation bar.

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

  2. Click Enable NameNode HA and follow the Enable NameNode HA Wizard. The wizard describes a set of automated and manual steps you must take to set up NameNode high availability.

  3.  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.

  4. Select Hosts: Select a host for the additional NameNode and the JournalNodes. The wizard suggests options that you can adjust using the dropdown lists. Click Next to proceed.

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

  6. Create Checkpoints: Follow the instructions in the step. You need to login 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.

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

  8. 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.

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

  10. Initialize Metadata: Follow the instructions in the step. For this step you must login to both the current NameNode and the additional NameNode. Make sure you are logged into the correct host for each command. Click Next when you have completed the two commands. A Confirmation popup appears to remind you that you must do both steps. Click OK to confirm.

  11. 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.

    [Note]Note

    Choose Services, then start Nagios, after completing all steps in the HA wizard.

  12. 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. Check the current FS root. On the Hive host:

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

      The output might look like this:

      Listing FS Roots..
      hdfs://<namenode-host>/apps/hive/warehouse
    2. Use this command to change the FS root:

      $ hive --config /etc/hive/conf.server --service metatool -updateLocation <new-location> <old-location>
       
      For example, where the Nameservice ID is mycluster:
       $ hive --config /etc/hive/conf.server --service metatool -updateLocation hdfs://mycluster/apps/hive/warehouse hdfs://c6401.ambari.apache.org/apps/hive/warehouse

      The output might look like this:

      Successfully updated the following locations..
      Updated X records in SDS table
  13. If you are using Oozie, you must use the Nameservice URI instead of the NameNode URI in your workflow files. For example, where the Nameservice ID is mycluster:

    <workflow-app xmlns="uri:oozie:workflow:0.2" name="map-reduce-wf">
        <start to="mr-node"/>
        <action name="mr-node">
            <map-reduce>
                <job-tracker>${jobTracker}</job-tracker>
                <name-node>hdfs://mycluster</name-node>
  14. If you are using Hue, to enable NameNode High Availability, you must use httpfs instead of webhdfs to communicate with name nodes inside the cluster. After successfully setting up NameNode High Availability:

    1. Install an httpfs server on any node in the cluster:

      yum install hadoop-httpfs
    2. Ensure that Hue hosts and groups use the httpfs server.

      For example, on the httpfs server host, add to httpfs-site.xml the following lines:

      <property>  <name>httpfs.proxyuser.hue.hosts</name> <value>*</value> </property>
      <property> <name>httpfs.proxyuser.hue.groups</name> <value>*</value> </property>
    3. Ensure that groups and hosts in the cluster use the httpfs server. For example, Using Ambari, in Services > HDFS > Configs add to core-site.xml the following properties and values:

      Table 8.1. Core-site.xml properties and values for NameNode HA on a cluster using Hue
      Property Value
      hadoop.proxyuser.httpfs.groups *
      hadoop.proxyuser.httpfs.hosts *
    4. Using Ambari, in Services > HDFS restart the HDFS service in your cluster.

    5. On the Hue host, configure Hue to use the httpfs server by editing hue.ini to include the following lines:

      fs_defaultfs=hdfs://mycluster 
      webhdfs_url=http://{fqdn of httpfs server}:14000/webhdfs/v1/
    6. Restart the Hue service.


loading table of contents...