Support Questions

Find answers, ask questions, and share your expertise

ambari cluster + what is the right syntax in order to upload json file

avatar

hi all

we have ambari cluster Version 2.5.0.3 , while all clients machines are Linux redhat

first I generated the json file to my Linux machine as the following: ( on ambari server machine )

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

then I update the blueprint.json file with some changes about the parameters and their values

finally my target is to upload the new blueprint.json to ambari cluster in order to take affect !

path=/root

curl -H "X-Requested-By: ambari" --data @ -X POST -u admin:admin http://130.14.6.28:8080/api/v1/blueprints/HDP01 -d @$path/blueprint.json

but I get the following errors ( seems because wrong syntax )

Warning: Couldn't read data from file "", this makes an empty POST. { "status" : 400, "message" : "Invalid Request: Malformed Request Body. An exception occurred parsing the request body: Unexpected character ('&' (code 38)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.StringReader@4a3484a6; line: 1, column: 3]"

please advice what is wrong in my syntax ? and what is the right syntax in order to upload the new update blueprint.json file

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@uri ben-ari @Jay SenSharma

This thread have been going on endlessly, and with duplicates.. I provided you the curl step mentioned above. If an answer provided solved the initial issue please do raise another thread. As jay stated you should mark the appropriate answer as "ACCEPTED" otherwise members will not attend to your questions in the future ,personally I have posted about 4 answers to your same thread .....

View solution in original post

13 REPLIES 13

avatar

how it can be if we delete the blueprint.json and upload the new one but still ambari GUI show the old values ?

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

As your original issue mentioned in this thread is resolved, Then we can mark this thread as "Accepted" (Answered) and continue on the other thread that you opened for the new issue.

Warning: Couldn't read data from file "", this makes an empty POST. { "status" : 400, "message" : "Invalid Request: Malformed Request Body. An exception occurred parsing the request body: Unexpected character ('&' (code 38)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.StringReader@4a3484a6; line: 1, column: 3]"

.

avatar
Master Mentor

@uri ben-ari @Jay SenSharma

This thread have been going on endlessly, and with duplicates.. I provided you the curl step mentioned above. If an answer provided solved the initial issue please do raise another thread. As jay stated you should mark the appropriate answer as "ACCEPTED" otherwise members will not attend to your questions in the future ,personally I have posted about 4 answers to your same thread .....

avatar

dear Geoffrey Shelton Okot you right , but during all my process I noticed about little issues that need to resolved , I am new in hadoop world , but any way I choose to work with other approach in order to configure the ambari cluster - see this https://cwiki.apache.org/confluence/display/AMBARI/Modify+configurations

Michael-Bronson