ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fay Wang <faywang...@yahoo.com>
Subject Re: Failed to put kerberos descriptor via REST API
Date Fri, 08 Jan 2016 03:30:21 GMT
Thanks, Rob. Changing to POST works fine! 
I am now able to kerberize the cluster using the REST API. However. starting services fails:
curl -H "X-Requested-By:ambari" -u admin:admin -i -X PUT -d '{"ServiceInfo": {"state" : "STARTED"}}'
http://localhost:8080/api/v1/clusters/MyCluster/services
HTTP/1.1 400 Bad Request
User: admin
Set-Cookie: AMBARISESSIONID=n1bo172w5po26xndrqfg95z9;Path=/;Secure;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/plain
Content-Length: 460
Server: Jetty(8.1.17.v20150415)

{
  "status" : 400,
  "message" : "java.lang.IllegalArgumentException: Missing KDC administrator credentials.\nThe
KDC administrator credentials must be set in session by updating the relevant Cluster resource.This
may be done by issuing a PUT to the api/v1/clusters/(cluster name) API entry point with the
following payload:\n{\n  \"session_attributes\" : {\n    \"kerberos_admin\" : {\"principal\"
: \"(PRINCIPAL)\", \"password\" : \"(PASSWORD)\"}\n  }\n}"
}
I then issued the command as suggested by the above message:curl -H "X-Requested-By:ambari"
-u admin:admin -i -X PUT -d '{"session_attributes" : {"kerberos_admin" : {"principal" : "fay/admin@EXAMPLE.COM",
"password" : "passw0rd"}}}' http://localhost:8080/api/v1/clusters/MyCluster

and then re-issued the start-service command. Still the start failed with the same error message.
Many thanks for your patience and help!
-fay

    On Thursday, January 7, 2016 5:28 PM, Robert Levas <rlevas@hortonworks.com> wrote:
 

 Hi Fay...Instead of PUT, you should do a POST.  To create a new kerberos_descriptor artifact. 
If a kerberos_descriptor artifact already existed, then you out PUT to update it.I'll have
to check, is the documentation I correct or confusing?RobOn Jan 7, 2016, at 6:50 PM, Fay Wang
<faywang300@yahoo.com> wrote:
Thanks, Rob, for the info!

I am able to get the default kerberos descriptor via REST api, but
get an error when issuing the following command to update the descriptor:
curl -H "X-Requested-By:ambari" -u admin:admin -i -X PUT -d @/tmp/descriptor_update.json http://localhost:8080/api/v1/clusters/MyCluster/artifacts/kerberos_descriptor

HTTP/1.1 100 Continue

HTTP/1.1 404 Not Found
User: admin
Set-Cookie: AMBARISESSIONID=ia3j9lvqclb6fytb01x5c2vl;Path=/;Secure;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/plain
Content-Length: 244
Server: Jetty(8.1.17.v20150415)

{
  "status" : 404,
  "message" : "org.apache.ambari.server.controller.spi.NoSuchResourceException: The requested
resource doesn't exist: Artifact not found, Artifacts/cluster_name=MyCluster AND Artifacts/artifact_name=kerberos_descriptor"
}

The content of /tmp/descriptor_update.json:
{
  "artifact_data" : {
    "services" : [
      {
        "configurations" : [
          {
            "core-site" : {
              "hadoop.proxyuser.HTTP.hosts" : "*"
            }
          }
        ],
        "name" : "HIVE"
      }
    ]
  }
}

Thanks in advance for the help!
-fay




  
Mime
View raw message