I am trying to install services through Ambari API. I have created single node cluster, desired configs, Host roles and services through API call. I used following command to install services:
curl -u admin:admin -i -H ‘X-Requested-By: ambari’ -X PUT -d ‘{“RequestInfo”: {“context” :”Installing Services”}, “Body”: {“ServiceInfo”: {“state”: “INSTALLED”}}}’ http://hostname -f
:8080/api/v1/clusters/c1/services?ServiceInfo/state=INIT
When I check tasks status it shows as Failed with following Error:
{
“href” : “http://ambari-server-test:8080/api/v1/clusters/c1/requests/1″,
“Requests” : {
“cluster_name” : “c1″,
“id” : 1
},
“tasks” : [
{
“href” : “http://ambari-server-test:8080/api/v1/clusters/c1/requests/1/tasks/2″,
“Tasks” : {
“attempt_cnt” : 1,
“cluster_name” : “c1″,
“command” : “INSTALL”,
“command_detail” : “DATANODE INSTALL”,
“end_time” : 1421757973671,
“exit_code” : 1,
“host_name” : “ambari-server-test”,
“id” : 2,
“request_id” : 1,
“role” : “DATANODE”,
“stage_id” : 1,
“start_time” : 1421757965534,
“status” : “FAILED”,
“stderr” : “2015-01-20 07:46:13,421 – Error while executing command ‘install':\nTraceback (most recent call last):\n File \”/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py\”, line 106, in execute\n method(env)\n File \”/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py\”, line 32, in hook\n setup_users()\n File \”/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py\”, line 70, in setup_users\n gid = params.user_group)\n File \”/usr/lib/python2.6/site-packages/resource_management/core/base.py\”, line 119, in __new__\n env.resources[r_type][name] = obj\n File \”/usr/lib/python2.6/site-packages/resource_management/libraries/script/config_dictionary.py\”, line 75, in __getattr__\n raise Fail(\”Configuration parameter ‘\”+self.name+\”‘ was not found in configurations dictionary!\”)\nFail: Configuration parameter ‘yarn_user’ was not found in configurations dictionary!”,
Can someone guide me on this error?
Also, It would be great if some one has steps to Create Single/multinode custer through API calls.
Thanks,