Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following snippet from the example demonstrates the required properties in hdfs-site to enable HDFS NameNode HA:


Code Block

{
  "configurations" : [
    {
      "hdfs-site" : {
        ...
        "properties" : {
         ...          
         "dfs.client.failover.proxy.provider.mycluster" : "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider",
          "dfs.ha.automatic-failover.enabled" : "true",
          "dfs.ha.fencing.methods" : "shell(/bin/true)",
          "dfs.ha.namenodes.mycluster" : "nn1,nn2",
          "dfs.journalnode.edits.dir" : "/hadoop/hdfs/journal",
         "dfs.namenode.http-address.mycluster.nn1" : "%HOSTGROUP::host_group_1%:50070",
          "dfs.namenode.http-address.mycluster.nn2" : "%HOSTGROUP::host_group_3%:50070",
          "dfs.namenode.https-address" : "%HOSTGROUP::host_group_1%:50470",
          "dfs.namenode.https-address.mycluster.nn1" : "%HOSTGROUP::host_group_1%:50470",
          "dfs.namenode.https-address.mycluster.nn2" : "%HOSTGROUP::host_group_3%:50470",
          "dfs.namenode.name.dir" : "/hadoop/hdfs/namenode",
          "dfs.namenode.rpc-address.mycluster.nn1" : "%HOSTGROUP::host_group_1%:8020",
          "dfs.namenode.rpc-address.mycluster.nn2" : "%HOSTGROUP::host_group_3%:8020",
          "dfs.namenode.safemode.threshold-pct" : "0.99f",
          "dfs.namenode.shared.edits.dir" : "qjournal://%HOSTGROUP::host_group_1%:8485;%HOSTGROUP::host_group_2%:8485;%HOSTGROUP::host_group_3%:8485/mycluster",
          "dfs.nameservices" : "mycluster",
          "dfs.replication" : "3",
          "dfs.replication.max" : "50",
        }
      }
    }
  }
}

...

Please refer to the link below for the full Blueprint example for HDFS NameNode HA:

hdfs_ha_blueprint.json 


Register Blueprint with Ambari Server  

Will use the same text from John’s earlier Blueprint examples here, since the APIs used for deploying an HA Blueprint are identical to any other Blueprint.  

  1. Example Cluster Creation Template

 

{

 "blueprint" : "blueprint-ha",

 "default_password" : "default",

 "host_groups" :[

   {

...

Post the blueprint to the "blueprint-hdfs-ha" resource to the Ambari Server.

Code Block
POST /api/v1/blueprints/blueprint-hdfs-ha
 
...
[ Request Body is the example blueprint defined above ]
...
 
201 - Created


Example Cluster Creation Template

 

 

Code Block
{
  "blueprint" : "blueprint-hdfs-ha",
  "default_password" : "default",
  "host_groups" :[
    {
      "name" : "host_group_1",

...

 
      "hosts" :

...

       {

...

 [         
        {
          "fqdn" : "c6401.ambari.apache.org"

...

       }

     ]

   },

   {

...


        }
      ]
    },
    {
      "name" : "host_group_2",

...

 
      "hosts" :

...

       {

...

 [         
        {
          "fqdn" : "c6402.ambari.apache.org"

...

       }

     ]

   },

  {

...


        }
      ]
    },
   {
      "name" : "host_group_3",

...

 
      "hosts" :

...

       {

...

 [         
        {
          "fqdn" : "c6403.ambari.apache.org"

...


        }
      ]
    } 
  ]
}





 

       }

     ]

   }

 ]

...

 

Create Cluster Instance

Post the cluster to the Ambari Server to provision the cluster.

 

Code Block
POST /api/v1/clusters/my-hdfs-ha-cluster
 
...
[ Request Body is above Cluster Creation Template ]
...
 
202 - Accepted
{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/my-hdfs-ha-cluster/requests/1",
  "Requests" : {
    "id" : 1,
    "status" : "InProgress"
  }
}
 
...
[ Client can then monitor the URL in the 202 response to check the status of the cluster deployment. ]
...
 

Will use the same text from John’s earlier Blueprint examples here, since the APIs used for deploying an HA Blueprint are identical to any other Blueprint.  

Blueprint Example: Yarn ResourceManager HA Cluster

...