Federated Nameservices

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

Cloudera Manager supports the configuration of multiple nameservices managing separate HDFS namespaces, all of which share the storage available on the set of DataNodes. These nameservices are federated, meaning each nameservice is independent and does not require coordination with other nameservices. See HDFS Federation for more information.

It is simplest to add a second nameservice if high availability is already enabled. The process of enabling high availability creates a nameservice as part of the enable high availability workflow.

Converting a non-Federated HDFS Service to a Federated HDFS Service

You must have one nameservice in place before you can add a second (or additional) nameservices. Follow the instructions below to convert your current NameNode/SecondaryNameNode setup to a Federated Setup with a single nameservice.

  1. Go to the HDFS service.
  2. Click the Configuration tab.
  3. Search for "nameservice". This will show you the nameservice properties for your NameNode and SecondaryNameNode.
  4. In the NameNode Nameservice field, type a name for the nameservice. The name must be unique and can contain only alphanumeric characters.
  5. In the Mountpoints field, change the mount point from "/" to a list of mount points that are in the namespace that this nameservice will manage. (You can enter this as a comma-separated list — for example, "/hbase, /tmp, /user" or by clicking the plus icon to add each mount point in its own field.) You can determine the list of mount points by running the command hadoop fs -ls / from the CLI on the NameNode host.
  6. In the SecondaryNameNode Nameservice field, type the name of the nameservice. This must be the same as you provided for the NameNode Nameservice property.
  7. Save your changes.
  8. Click the Instances tab. You should now see the Federation and High Availability section with your nameservice listed.
  9. You can use the Edit command under the Actions menu to edit the list of mount points for this nameservice. In the Mountpoints field, change the mount point from "/" to a list of mount points that are in the namespace that this nameservice will manage.

Adding a Nameservice

The instructions below for adding a nameservice assume that a nameservice is already set up. The first nameservice cam be set up either by converting a simple HDFS service as described above (see Converting a non-Federated HDFS Service to a Federated HDFS Service or by enabling HDFS High Availability.

  1. Go to the HDFS service.
  2. Click the Instances tab. At the top of this page you should see the Federation and High Availability section.
  3. Click the Add Nameservice button.
    1. Enter a name for the new nameservice. The name must be unique and can contain only alphanumeric characters.
    2. Enter at least one mount point for the nameservice. This defines the portion of HDFS that will be managed under the new nameservice. (Click the + to the right of the Mount Point field to add a new mount point). You cannot use "/" as a mount point; you must specify HDFS directories by name.
      • The mount points must be unique for this nameservice; you cannot specify any of the same mount points you have used for other nameservices.
      • You can specify mount points that do not yet exist, and create the corresponding directories in a later step in this procedure.
      • If you want to use a mount point previously associated with another nameservice you must first remove that mount point from that service. You can do this using the Edit command from the Actions menu for that nameservice, and later add the mount point to the new nameservice.
      • After you have brought up the new nameservice, you must create the directories that correspond with the mount points you specified in the new namespace.
      • If a mount point corresponds to a directory that formerly was under a different nameservice, you must also move any contents of that directory, if appropriate as described in step 8.
      • If an HBase service is set to depend on the federated HDFS service, edit the mount points of the existing nameservice to reference:
        • HBase root directory (default /hbase)
        • MapReduce system directory (default /tmp/mapred/system)
        • MapReduce JobTracker staging root directory (default value /user).
    3. If you want to configure high availability for the nameservice, leave the Highly Available checkbox checked.
    4. Click Continue.
  4. Select the hosts on which the new NameNode and Secondary NameNodes will be created. (These must be hosts that are not already running other NameNode or SecondaryNameNode instances, and their /dfs/nn and /dfs/snn directories should be empty if they exist. Click Continue.
  5. Enter or confirm the directory property values (these will differ depending on whether you are enabling high availability for this nameservice, or not).
  6. Uncheck the Start Dependent Services checkbox if you need to create directories or move data onto the new nameservice. Leave this checked if you want the workflow to restart services and redeploy the client configurations as the last steps in the workflow.
  7. Click Continue. If the process finished successfully, click Finish. You should now see your new nameservice in the Federation and High Availability section in the Instances tab of the HDFS service.
  8. Create the directories you want under the new nameservice using the CLI:
    1. To create a directory in the new namespace, use the command hadoop fs -mkdir /nameservices/nameservice/directory where nameservice is the new nameservice you just created and directory is the directory that corresponds to a mount point you specified.
    2. To move data from one nameservice to another, use distcp or manual export/import. dfs -cp and dfs -mv will not work.
    3. Verify that the directories and data are where you expect them to be.
  9. Restart the dependent services.

Nameservice and Quorum-based Storage

With Quorum-based Storage, JournalNodes are shared across nameservices. So, if JournalNodes are present in an HDFS service, all nameservices will have Quorum-based Storage enabled. To override this:

  • The dfs.namenode.shared.edits.dir configuration of the two NameNodes of a high availability nameservice should be configured to include the value of the dfs.namenode.name.dirs setting, or
  • The dfs.namenode.edits.dir configuration of the one NameNode of a non-high availability nameservice should be configured to include the value of the dfs.namenode.name.dirs setting.