按照教程做,理论上说应该没有问题
看到后台日志, 这个意思是让我手工执行一下
2023-07-18 11:03:20,207 WARN [ambari-client-thread-26670] KDCKerberosOperationHandler:329 - Failed to kinit as the KDC administrator user, admin@EXAMPLE.COM:
ExitCode: 1
STDOUT:
STDERR: kinit: Client 'admin@EXAMPLE.COM' not found in Kerberos database while getting initial credentials
2023-07-18 11:03:20,209 ERROR [ambari-client-thread-26670] KerberosHelperImpl:2501 - Cannot validate credentials: org.apache.ambari.server.serveraction.kerberos.KerberosAdminAuthenticationException: Invalid KDC administrator credentials.
The 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:
{
"Credential" : {
"principal" : "(PRINCIPAL)", "key" : "(PASSWORD)", "type" : "(persisted|temporary)"}
}
}
于是我使用post man 提交了一下
curl命令如下
```
curl --location --request PUT 'http://172.16.20.21:8080/api/v1/clusters/cluster1/credentials/kdc.admin.credential' \
--header 'X-Requested-By: ambari' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data-raw '{
"Credential" : {
"principal" : "admin/admin@EXAMPLE.COM", "key" : "9L******XS", "type" : "temporary"
}
}'
```
然后再试即好了.