Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Getting only skeletal configuration data from Ambari Blueprint

Getting only skeletal configuration data from Ambari Blueprint

Explorer

I'm trying to obtain configuration information from an existing Ambari 2.1.5 cluster (preparatory to an upgrade.) Rather than go through the GUI I dumped a blueprint a follows:

curl -H "X-Requested-By: ambari" -X GET -u admin:admin http://my.fqdn.net:8080/api/v1/clusters/mycluster?format=blueprint

But the result yields only the bare lists of the services that go in each of host_group_1 through host_group_6. It does not contain any of the configuration information that I expected find, similar to say, the sandbox blueprint. Only 253 lines and zero configuration settings. In comparison I get 2218 lines of JSON from the sandbox which includes many specifics for each listed service. Why am I not seeing them and how can I get them?

7 REPLIES 7

Re: Getting only skeletal configuration data from Ambari Blueprint

@Peter Coates

How about running this from a browser? Does it report the same as well?

Re: Getting only skeletal configuration data from Ambari Blueprint

Explorer

Browser is normal, with all configurations are as expected. Here's what a host group looks like. As you see, it just names the services, but nothing else. Am I missing a parameter in the cURL call? It's a 1.6/2.1.5 cluster.

{ "name" : "host_group_3", "components" : [ { "name" : "HBASE_REGIONSERVER" }, { "name" : "SUPERVISOR" }, { "name" : "NODEMANAGER" }, { "name" : "DATANODE" }, { "name" : "GANGLIA_MONITOR" } ], "cardinality" : "10" },

Re: Getting only skeletal configuration data from Ambari Blueprint

Explorer

I got the following answer to this from another source so I'll post it here. The expected behavior is for Ambari to dump all the configurations into the blueprint, so the result I'm getting is indeed not what it should normally be expected. However, this is such an old Ambari version that blueprints were not well supported yet, and the recommended solution (at least the one I recommended to me was "you're going to have to upgrade.")

This is a really old cluster---the blueprints functionality seems fine in more recent Ambari versions.

Re: Getting only skeletal configuration data from Ambari Blueprint

Mentor

@Peter Coates

I believe ambari blueprints was just introduced in Ambari 1.6 and further enhanced in Ambari 1.7. I don't think you can get farther than you already have with the API. http://hortonworks.com/blog/announcing-apache-ambari-1-7-0/

here's the roadmap, 1.6 only introduced blueprints, further enhanced in 1.7, etc.

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30755705

Re: Getting only skeletal configuration data from Ambari Blueprint

Mentor

perhaps you can upgrade ambari server and agents and then do what you were planning? @Peter Coates

Highlighted

Re: Getting only skeletal configuration data from Ambari Blueprint

You can retrieve individual configurations as follows.

I guess you are only interested in the latest configurations

1.Get a list of current configurations

curl -H "X-Requested-By:ambari" -u admin -X GET  http://example.com:8080/api/v1/clusters/bigdata?fields=Clusters/desired_configs

Result:

....
"provisioning_state" : "INSTALLED",
    "security_type" : "NONE",
    "total_hosts" : 6,
    "version" : "HDP-2.3",
    "desired_configs" : {
      "admin-properties" : {
        "tag" : "version1454834038932",
        "user" : "admin",
        "version" : 1
      },
      "capacity-scheduler" : {
        "tag" : "version1455710459816",
        "user" : "admin",
        "version" : 3
      },
      "cluster-env" : {
        "tag" : "version1455710460245",
        "user" : "admin",
        "version" : 3
      },
      "core-site" : {
        "tag" : "version1455710465648",
        "user" : "admin",
        "version" : 6
      },
....

Note: The "tag"-field is the most important information here.

2) Retrieve individual configurations (e.g. cluster-env)

curl -H "X-Requested-By:ambari" -u admin -X GET  http://example.com:8080/api/v1/clusters/bigdata/configurations?type=cluster-env&tag=version145571046...

Result:

{
  "href" : "http://example.com:8080/api/v1/clusters/bigdata/configurations?type=cluster-env&tag=version1455710460245",
  "items" : [
    {
      .......
      "properties" : {
        "ignore_groupsusers_create" : "false",
        "kerberos_domain" : "EXAMPLE.COM",
        "override_uid" : "true",
        "repo_suse_rhel_template" : "[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0",
        "repo_ubuntu_template" : "{{package_type}} {{base_url}} {{components}}",
        "security_enabled" : "false",
        "smokeuser" : "ambari-qa",
        "smokeuser_keytab" : "/etc/security/keytabs/smokeuser.headless.keytab",
        "smokeuser_principal_name" : "ambari-qa-bigdata@EXAMPLE.COM",
        "user_group" : "hadoop"
      }
    }
  ]
}

Hope it helps

Re: Getting only skeletal configuration data from Ambari Blueprint

Explorer

This might be a good workaround. All we want is the information--it doesn't have to be a blueprint per se. Thanks!

Don't have an account?
Coming from Hortonworks? Activate your account here