2

we have many Ambari LAB clusters - Apache Ambari Version 2.5.0.3 , while ambari agent installed on Linux redhat machines

my target is to find a way to update the values of services , on all the Ambari clusters , by automate the process

what we do until now , is take each ambari cluster and change the services values - but this take a lot of time

so if we have diff 25 ambari LAB clusters , then we need access each ambari cluster and change the values , this is very exhausting because we have a lot of values to change ...

but we have a new idea to automate the process

what we thinking is to generate a new blueprint.json from some ambari cluster file as the following:

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

then update/change the values in the new blueprint.json file

and finally upload/push the json file on all clusters

the big question is:

how to upload the new blueprint.json file on ambari cluster ?

is it possible scenario ?

King David
  • 500
  • 1
  • 7
  • 20

1 Answers1

1

To upload blueprint file in the new cluster, below command can be used.

curl -H "X-Requested-By: ambari" --data @blueprint.json -X POST -u admin:admin http://<HOSTNAME>:8080/api/v1/blueprints/<BLUEPRINT_NAME>

update <blueprintfile.json> and <BLUEPRINT_NAME> in the command.

SachinJose
  • 8,462
  • 4
  • 42
  • 63
  • I intend to run the syntax in few min , but can you advice please how to find the BLUEPRINT_NAME ? or maybe BLUEPRINT_NAME is the blueprintfile.json file? – King David Aug 09 '17 at 07:35
  • I successes to find the blue_printname , but when I run - curl -H "X-Requested-By: ambari" --data @ -X POST -u admin:admin http://160.14.36.28:8080/api/v1/blueprints/HDP01 blueprint.json , its fail on Warning: Couldn't read data from file "", this makes an empty POST. – King David Aug 09 '17 at 08:07
  • I've updated the command, filename after --data @ was missing due to stackoverflow formatting, blueprint filename was missing in the command I shared. You can use any name for blueprint. blueprint.json is the name of the json file u created from the stable cluster. – SachinJose Aug 09 '17 at 17:11
  • @KingDavid , Were you able to go through the above comment ? – SachinJose Aug 10 '17 at 20:26