Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

ambari + Update a blueprint

avatar

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
Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@uri ben-ari

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

View solution in original post

17 REPLIES 17

avatar

@Geoffrey Shelton Okot , I will run this syntax in the next 15 min

Michael-Bronson

avatar

@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 ?

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

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

avatar

@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 ?

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

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

avatar

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?

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

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

avatar

@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 ?

Michael-Bronson