Support Questions

Find answers, ask questions, and share your expertise

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
Master Mentor

@uri ben-ari

The .yml is a configuration file It's basically a human-readable structured data format "YAML stands for "YAML Ain't Markup Language" and it is used extensively in Grav for its configuration files, blueprints, and also in page settings. YAML is to configuration what markdown is to markup." In this case the your configuration file is "myBlueprint.yml"

The json file with the -d @updatedBlueprint.json should be in the current directory where you are running the curl command.

avatar

@Geoffrey thx for the answer , but from where I need to get the .yml file ? or maybe to generate this file ? about the json file I gues this files include all the current values for all services , is it true ? so the target ( let me know if I wrong ) to load the json file and generate a new json file with all update values ?

Michael-Bronson

avatar
Explorer

Hi @uri ben-ari,

Your link and example are about IBM UrbanCode Deploy, not Apache Ambari.

Blueprints in Ambari are immutable, cannot be updated. You can POST the updated blueprint with a new name and use that to deploy the cluster.

avatar

@Doroszlai, Attila can you show me how to POST anew update version so the next new ambari & blueprint will use the new version with all update values?

Michael-Bronson

avatar

I just want to explain my target , in the ambari cluster we have parameters for all services , so my target is to create a new json ( blueprint ) that include the new values , and to use this json for the next ambari installation

Michael-Bronson

avatar
Explorer

If I understand correctly, you create a cluster using some initial blueprint, change some configuration parameters for services, and would like to get a blueprint with the updated parameters?

If so, then you need to export the blueprint from the cluster, which is explained eg. in this answer.

avatar

@Doroszlai, Attila I have anew question , lets say I successfully generate a new json file , and on this json file I change few parameters ( values ) , then I want to update the ambari cluster with this new update json file , is it possible ?

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

The .yml file is specific to the OS setup you run in this case the IBM... Ambari blueprint uses the .json using curl.
1- What do you tend to achieve?

avatar
Master Mentor

@uri ben-ari,

You can generate your new blueprint.json from an existing cluster replacing the {ambari_host} and {Cluster_name} with correct values

curl -H "X-Requested-By: ambari" -X GET -u admin:admin http://{ambari_host}:8080/api/v1/clusters/{Cluster_name}\?format\=blueprint > blueprint.json

Hope that helps