In Ambari cluster GUI ( Version 2.5.0.3 ) , each service has the Config button
And when we click on Config button we can see the list of all relevant parameters and their values
For example YARN service have the parameter - Minimum Container Size (Memory) in MB
Of course we can change from the ambari GUI the values of the parameters …
But we want to automate the changing of the values by API commands under bash script
I searched in google to find some info about the API that change the values under parameters , but without success
I’ll appreciate to get answers about this,
Here are the steps to update service configurations using REST API.
http://<AMBARI-SERVER>:8080/api/v1/clusters/
http://<AMBARI-SERVER>:8080/api/v1/clusters/<CLUSTER_NAME>
yarn.nodemanager.resource.memory-mb
, Create a json file as below - newconfigs.json
{
"Clusters": {
"desired_config": {
"type": "yarn-site",
"tag": "version1502226523283",
"properties": {
"yarn.nodemanager.resource.memory-mb": "200000"
}
}
}
}
tag number should be unique - just give some random number, You can update this configuration in Ambari usng the below command. Below API uses REST - PUT method.
curl -H "X-Requested-By: ambari" -X PUT -u admin:admin -d @newconfigs.json http://<AMBARI-SERVER>:8080/api/v1/clusters/<CLUSTER_NAME>
Refer below ambari official REST api documentations for more details.
https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/configuration.md