Created 08-08-2017 09:53 AM
hi all
I am new in ambari world
I read the blog from the follwing site - https://www.ibm.com/support/knowledgecenter/en/SS4GSP_6.2.5/com.ibm.edt.api.doc/topics/rest_bpid_put...
and that because we need to update values for some services in ambari cluster
and then to deploy new version of blue print
the syntax for the new blue print update is ( from the site example )
curl -u jsmith:passwd
-H "Content-Type: application/json"
-H "Location: /landscaper/orion/file/jsmith_8a6bfff7_2c77_45db_a235_adda61ad6653-OrionContent/myTeam/myBlueprint/myBlueprint.yml"
http://myserver.example.com:8080/landscaper/rest/blueprint/MyBlueprint
-X PUT
-d @updatedBlueprint.json
but not clearly for me , ( we need to type this syntax on Linux ambari server machine )
for example: what is the .yml file
-H "Location: /landscaper/orion/file/jsmith_8a6bfff7_2c77_45db_a235_adda61ad6653-OrionContent/myTeam/myBlueprint/myBlueprint.yml"
from where we need to take the json file?
-d @updatedBlueprint.json
Created 08-08-2017 12:10 PM
Usually when you add or delete components in a cluster its advisable to download the new blueprint, to enable you reproduce the cluster like from UAT/DEV to PROD.
The other was round I have never tried though you can add components to an existing cluster using a blueprint. see
Look at this
Created 08-08-2017 10:50 AM
@Geoffrey Shelton Okot , I will run this syntax in the next 15 min
Created 08-08-2017 10:57 AM
@Geoffrey Shelton Okot nice the syntax generate the .json file , so lets say we want to work on the json file in order to change the values from the parameters , do you know on existing tool/script that know how to replace the current values in the json file with other new values ?
Created 08-08-2017 11:14 AM
I always use a json validator, I don't know any tool that can that could help but if the value don't match your json wont be accepted and the output will give you hints as to which parameter.
Also see Ambari blueprints
Created 08-08-2017 11:20 AM
@Geoffrey Shelton Okot , ok , I also ask Doroszlai, Attila about "update the ambari cluster with this new update json" is it possible I will happy to know your opinion about this ?
Created 08-08-2017 12:10 PM
Usually when you add or delete components in a cluster its advisable to download the new blueprint, to enable you reproduce the cluster like from UAT/DEV to PROD.
The other was round I have never tried though you can add components to an existing cluster using a blueprint. see
Look at this
Created 08-08-2017 12:30 PM
so according to your info upload new update json to existing ambari cluster isn't real choice , so let continue to other option , is it possible by API command to change the parameters values for the services ? , can you please give me example for that?
Created 08-08-2017 12:54 PM
In the below example I am removing and re-installing RANGER
Stop RANGER component
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop All Components"},"Body":{"ServiceComponentInfo":{"state":"INSTALLED"}}}' http://{ambari_host}:8080/api/v1/clusters/{cluster_name}/services/OOZIE/components/RANGER
Delete RANGER component
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://{ambari_host}:8080/api/v1/clusters/{cluster_name}/services/RANGER
Install RANGER component
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop Component"},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://{ambari_host}:8080/api/v1/clusters/{cluster_name}/hosts/HOSTNAME/host_components/RANGER
Hope that helps
Created 08-08-2017 01:05 PM
@Geoffrey Shelton Okot thx for the examples , but if we want to change the values , for example - in ambari cluster we click HDFS service then we click on config , and then we get list of parameters , and their values , so I just thinking if API can change the value that belong to specific parameter ?