This is the documentation for Cloudera Enterprise 5.8.x. Documentation for other versions is available at Cloudera Documentation.

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

  Important: Configuring a new nameservice shut downs the services that depend upon HDFS. Once the new nameservice has been started, the services that depend upon HDFS must be restarted, and the client configurations must be redeployed. (This can be done as part of the Add Nameservice workflow, as an option.)

Configuring the First Nameservice Using Cloudera Manager

Follow the instructions below to define the first nameservice.

  1. Go to the HDFS service.
  2. Click the Configuration tab.
  3. Type nameservice in the Search field. The nameservice properties for the NameNode and SecondaryNameNode display.
  4. In the NameNode Nameservice field, type a name for the nameservice. The name must be unique and can contain only alphanumeric characters.

    If more than one role group applies to this configuration, edit the value for the appropriate role group. See Modifying Configuration Properties Using Cloudera Manager.

  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 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 nameservice name that you provided for the NameNode Nameservice property.

    If more than one role group applies to this configuration, edit the value for the appropriate role group. See Modifying Configuration Properties Using Cloudera Manager.

  7. Click Save Changes to commit the changes.
  8. Click the Instances tab. The Federation and High Availability section displays with the nameservice listed.

Editing the List of Mountpoints for a Nameservice Using Cloudera Manager

  1. Go to the HDFS service.
  2. Click the Instances tab. The Federation and High Availability section displays with the nameservices listed.
  3. Select Actions > Edit. In the Mount Points field, change the mount point to a list of mount points in the namespace that the nameservice will manage.
  4. Click OK.

Adding a Nameservice Using Cloudera Manager

The instructions below for adding a nameservice assume that one nameservice is already set up. The first nameservice cam be set up either by configuring the first nameservice 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. If this section does not appear, it means you do not have any nameservices configured. You must have one nameservice already configured to add a nameservice.
  3. Click the Add Nameservice button.
    1. In the Nameservice Name field, enter a name for the new nameservice. The name must be unique and can contain only alphanumeric characters.
    2. In the Mount Points field, 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 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. Select 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. The new nameservice displays 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.
  Note: The monitoring configurations at the HDFS level apply to all nameservices. If you have two nameservices, it is not possible to disable a check on one but not the other. Likewise, it's not possible to have different event thresholds for the two nameservices.

Also see Changing a Nameservice Name for Highly Available HDFS Using Cloudera Manager.

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.
Page generated July 8, 2016.