Eri*_*ton 5 hadoop cloudera hadoop-yarn kerberos-delegation
我正在使用 YarnClient 以编程方式启动作业。我正在运行的集群已进行 Kerberos 化。
通过“yarn jar Examples.jar wordcount...”提交的法线贴图缩减作业工作。
我尝试以编程方式提交的作业却没有。我收到此错误:
14/09/04 21:14:29 错误 client.ClientService:应用程序提交期间发生错误:应用程序 application_1409863263326_0002 由于 appattempt_1409863263326_0002_000002 的 AM 容器退出,退出代码:-1000,原因是:本地异常失败:java.io。 IOException:org.apache.hadoop.security.AccessControlException:客户端无法通过以下方式进行身份验证:[TOKEN,KERBEROS];主机详细信息:本地主机为:“yarn-c1-n1.clouddev.snaplogic.com/10.184.28.108”;目标主机是:“yarn-c1-cdh.clouddev.snaplogic.com”:8020;.这次尝试失败..申请失败。14/09/04 21:14:29 错误 client.YClient:应用程序提交失败
代码看起来像这样:
ClientContext context = createContextFrom(args);
YarnConfiguration configuration = new YarnConfiguration();
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(configuration);
ClientService client = new ClientService(context, yarnClient, new InstallManager(FileSystem.get(configuration)));
LOG.info(Messages.RUNNING_CLIENT_SERVICE);
boolean result = client.execute();
Run Code Online (Sandbox Code Playgroud)
我原以为也许添加一些东西可以达到以下效果:
yarnClient.getRMDelegationToken(new Text(InetAddress.getLocalHost().getHostAddress()));
Run Code Online (Sandbox Code Playgroud)
也许可以减轻我的痛苦,但这似乎也没有帮助。任何帮助将不胜感激。
好吧,经过几个小时、几个小时、几个小时后,我们已经解决了这个问题。对于所有后代的编码员来说,永远受到 hadoop 缺乏文档的困扰:
您必须通过调用获取凭证来从 UserGroupInformation 对象中获取令牌。然后,您必须在 ContainerLaunchContext 上设置令牌。
| 归档时间: |
|
| 查看次数: |
27609 次 |
| 最近记录: |