Scaling Namespaces and Optimizing Data Storage
Also available as:
loading table of contents...

Configure an HDFS federation

All the nodes in a federation share a common set of configuration files. To support the common configuration, you must configure a NameService ID for all the NameNodes that you want to include in the federation.

  • Ensure that you configure the federation during a cluster maintenance window.
  • Verify that you have configured HA for all the NameNodes that you want to include in the federation. In addition, ensure that you have configured the value of dfs.nameservices for the NameNodes in hdfs-site.xml.

A federation allows you to add new NameService IDs to a cluster. Each NameService denotes a new filesystem namespace. You can configure a maximum of four namespaces in a federated environment.

An active NameNode and its standby belong to the NameService ID. To support the common configuration, you must suffix the parameters for the various NameNodes in a federation with the NameService ID.

For example, if you define ns2 as the NameService ID for a federation, then you must add ns2 as a suffix to parameters such as dfs.namenode.rpc-address, dfs.namenode.http-address, and dfs.namenode.secondaryhttp-address.
This task explains how you can configure an HDFS federation using the command line interface. For information about using Ambari to configure a federation, see the topic Configure HDFS Federation in the Ambari documentation.
  1. Verify whether the newly added namespaces are added to the dfs.internal.nameservices parameter in hdfs-site.xml.
    The particular parameter lists all the namespaces that belong to the local cluster.
  2. Add the following configuration parameters suffixed with the correct NameService ID for the active and standby NameNodes in the hdfs-site.xml.
    Daemon Configuration Parameter
    • dfs.namenode.rpc-address
    • dfs.namenode.http-address
    • dfs.namenode.https-address
    • dfs.namenode.servicerpc-address
    • dfs.namenode.keytab.file
    • dfs.namenode.checkpoint.dir
    • dfs.namenode.checkpoint.edits.dir
    The parameters dfs.namenode.http-address and dfs.namenode.https-address are optional depending on the http policy configured. In addition, the parameters dfs.namenode.checkpoint.dir and dfs.namenode.checkpoint.edits.dir are optional.
  3. Propagate the configuration file updates to all the nodes in the cluster.

The following example shows the configuration for two NameNodes in a federation:


  .... Other common configuration ...
Format every new NameNode that you want to include in the federation.