从 Oracle JDK 8 迁移到 Cloudera 集群中的 Open JDK 8 后的模拟问题

Impersonation issue after migrating from Oracle JDK 8 to Open JDK 8 in Cloudera cluster

最近我从 Oracle JDK 8 迁移到 Open JDK 8(版本:openjdk-1.8.0.242.b08)for Cloudera。 Cloudera 版本为 5.16.2。我启用了 Kerberos 和 TLS。当我使用 Oracle JDK 时,不会出现以下问题,但是当我切换到 Open JDK 时,我会收到以下错误。请注意,代理用户已从 CM -> HDFS -> 配置中启用。

JobHistoryServer    
Error starting JobHistoryServer
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Error creating done directory: [hdfs://XXXX.YYY.COM:8020/user/history/done]
    at org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.tryCreatingHistoryDirs(HistoryFileManager.java:680)
    at org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.createHistoryDirs(HistoryFileManager.java:616)
    at org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.serviceInit(HistoryFileManager.java:577)
    at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
    at org.apache.hadoop.mapreduce.v2.hs.JobHistory.serviceInit(JobHistory.java:95)
    at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
    at org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)
    at org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer.serviceInit(JobHistoryServer.java:154)
    at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
    at org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer.launchJobHistoryServer(JobHistoryServer.java:229)
    at org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer.main(JobHistoryServer.java:239)
Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: RZgWaGioVf@YYY.COM is not allowed to impersonate mapred/XXXX.YYY.COM@YYY.COM
    at org.apache.hadoop.ipc.Client.call(Client.java:1504)
    at org.apache.hadoop.ipc.Client.call(Client.java:1441)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:231)
    at com.sun.proxy.$Proxy16.getFileInfo(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:788)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:258)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:104)
    at com.sun.proxy.$Proxy17.getFileInfo(Unknown Source)
    at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:2168)
    at org.apache.hadoop.fs.Hdfs.getFileStatus(Hdfs.java:133)
    at org.apache.hadoop.fs.FileContext.next(FileContext.java:1143)
    at org.apache.hadoop.fs.FileContext.next(FileContext.java:1139)
    at org.apache.hadoop.fs.FSLinkResolver.resolve(FSLinkResolver.java:90)
    at org.apache.hadoop.fs.FileContext.getFileStatus(FileContext.java:1139)
    at org.apache.hadoop.fs.FileContext$Util.exists(FileContext.java:1604)
    at org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.mkdir(HistoryFileManager.java:733)
    at org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.tryCreatingHistoryDirs(HistoryFileManager.java:663)

可能与我的问题有关:https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1861883

我也向 OpenJDK 错误报告站点报告了此问题(两次),但到目前为止没有任何反应。

如果您的问题在降级到 OpenJDK 1.8.0 232 后消失,我们遇到了同样的错误。

此问题已解决。问题是由于对 Kerberos (JDK-8215032) 的跨领域引用支持。您需要设置 -Dsun.security.krb5.disableReferrals=true 属性 服务或设置此为 java.security 文件。

这是我用 openJDK 提交的一个已知错误。

"KerberosTicket client name refers wrongly to sAMAccountName in AD",主要功能丧失。

跟踪到这里:https://bugs.openjdk.java.net/browse/JDK-8239385