Created 08-11-2017 06:46 AM
How to know the configuration type for parameter in ambari cluster by API
examples of configuration type - core-site, hdfs-site, mapred-queue-acls
lets say I want to find the configuration type for the parameter - "mapreduce.map.memory.mb” , in this case configuration type is mapred-site
Created 08-11-2017 06:54 AM
Using Amabri API you can try the following:
curl -iv -u admin:admin -H "X-Requested-By: ambari" -X GET http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/configurations?type=hdfs-site
Then get the latest version tag from the above call and then use that version in the API call.
curl -iv -u admin:admin -H "X-Requested-By: ambari" -X GET http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/configurations?type=hdfs-site&tag=vers...
.
Created 08-11-2017 06:51 AM
Something like this we can try using "config.sh" script. (one approach)
# /var/lib/ambari-server/resources/scripts//configs.sh -u admin -p admin -port 8080 get localhost test_cluster hdfs-site
.
Created 08-11-2017 06:57 AM
thank you Jay SenSharma your example print all parameters that belong to he configuration type , but we need to know the configuration type for the parameter , I mean lets say we have some parameter how to know under which configuration type parameter is belong ?
Created 08-11-2017 08:59 AM
Jay - any suggestion?
Created 08-17-2017 05:58 PM
There is no reverse mapping ... i mean if you know a parameter then there is no direct way to find which XML file that parameter will go. Usually the admin or the component owner knows which configuration parameter will impact which service and component. And which configuration file (config_type) should have the mapping for that parameter.
.
The best way is to find more information about the parameter and then we will know where that parameter should get applied.
Created 08-17-2017 06:01 PM
Example: If i want to add a parameter "hadoop.security.auth_to_local" to some config ... then i will need to know about it.
I found in the following link that it can be applied to "core-site" , So i will need to add it to that config in ambari.
https://hadoop.apache.org/docs/r2.8.0/hadoop-project-dist/hadoop-common/core-default.xml
Created 08-11-2017 06:54 AM
Using Amabri API you can try the following:
curl -iv -u admin:admin -H "X-Requested-By: ambari" -X GET http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/configurations?type=hdfs-site
Then get the latest version tag from the above call and then use that version in the API call.
curl -iv -u admin:admin -H "X-Requested-By: ambari" -X GET http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/configurations?type=hdfs-site&tag=vers...
.
Created 08-11-2017 07:00 AM
just to clear my question , we have parameter but we not know to which configyuration type this parameter is belong
Created 08-11-2017 07:06 AM
When we make a call to /clusterName API then we should be able to find the right config that has this property.
curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://amb25101.example.com:8080/api/v1/clusters/plain_ambari
and then we can grep 'mapreduce.map.memory.mb' to find which config has thie entry.
Created 08-11-2017 07:17 AM
"plain_cluster" is the Name of my ambari cluster. You will need to replace it with your cluster name. You can find the clustername using the following call.
curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://$AMBARI_HOST:8080/api/v1/clusters/