Hi Rob: Problem solved. Thank you!
在 2019-07-10 20:18:19,"Robert Levas" <[email protected]> 写道: Hi Zhang... The latest docs for Ambari's Kerberos-release REST API can be found at https://github.com/apache/ambari/blob/trunk/ambari-server/docs/security/kerberos/enabling_kerberos.md#the-rest-api. In particular, to set the KDC administrator credentials, have a look at https://github.com/apache/ambari/blob/trunk/ambari-server/docs/security/kerberos/enabling_kerberos.md#set-the-kdc-administrator-credentials. I hope this helps. Rob On Wed, Jul 10, 2019 at 5:54 AM Zhang Ruiqiang <[email protected]> wrote: Hi ambari team: My ambari version is 2.7.3. Now, I want to install service using rest api, my command is: curl -u admin:admin -i -H 'X-Requested-By:ambari' -X PUT http://localhost:8080/api/v1/clusters/test/services/SOLR -d '{"RequestInfo": { "context": "Install SOLR"},"Body": { "ServiceInfo": { "state": "INSTALLED"} }}' When kerberos was not enabled, it is OK. But after I enabled Kerberos, I will get the error message as below: { "status" : 400, "message" : "java.lang.IllegalArgumentException: Invalid KDC administrator credentials.\nThe KDC administrator credentials must be set as a persisted or temporary credential resource.This may be done by issuing a POST (or PUT for updating) to the /api/v1/clusters/:clusterName/credentials/kdc.admin.credential API entry point with the following payload:\n{\n \"Credential\" : {\n \"principal\" : \"(PRINCIPAL)\", \"key\" : \"(PASSWORD)\", \"type\" : \"(persisted|temporary)\"}\n }\n}" I refered the doc https://developer.ibm.com/hadoop/2016/06/07/ambari-rest-calls-for-kerberos-enabled-clusters/ to resolve my problem, but maybe its version is old, it doesn't work for me. So, what is the easies way to invoke this API? Any suggestions are appreciated ! Thanks!
