CLIENT_0004:Unable to find valid Kerberos ticket cache (kinit)

背景

今天在使用JavaAPI来连接sqoop1.99.7的时候,遇到了个错误。
错误信息如下:

0    [main] WARN  org.apache.hadoop.util.NativeCodeLoader  - Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
Exception in thread "main" org.apache.sqoop.common.SqoopException: CLIENT_0004:Unable to find valid Kerberos ticket cache (kinit)
at org.apache.sqoop.client.request.ResourceRequest.doHttpRequest(ResourceRequest.java:159)
at org.apache.sqoop.client.request.ResourceRequest.doHttpRequest(ResourceRequest.java:69)
at org.apache.sqoop.client.request.ResourceRequest.get(ResourceRequest.java:179)
at org.apache.sqoop.client.request.JobResourceRequest.read(JobResourceRequest.java:65)
at org.apache.sqoop.client.request.SqoopResourceRequests.readJob(SqoopResourceRequests.java:146)
at org.apache.sqoop.client.SqoopClient.getJobs(SqoopClient.java:403)
at com.fz.hadoop.sqoop.SqoopTest.main(SqoopTest.java:18)
Caused by: org.apache.hadoop.security.authentication.client.AuthenticationException: Authentication failed, status: 404, message: Not Found
at org.apache.hadoop.security.authentication.client.AuthenticatedURL.extractToken(AuthenticatedURL.java:275)
at org.apache.hadoop.security.authentication.client.PseudoAuthenticator.authenticate(PseudoAuthenticator.java:77)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:131)
at org.apache.hadoop.security.authentication.client.KerberosAuthenticator.authenticate(KerberosAuthenticator.java:214)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:131)
at org.apache.hadoop.security.authentication.client.AuthenticatedURL.openConnection(AuthenticatedURL.java:215)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.openConnection(DelegationTokenAuthenticatedURL.java:322)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.openConnection(DelegationTokenAuthenticatedURL.java:245)
at org.apache.sqoop.client.request.ResourceRequest.doHttpRequest(ResourceRequest.java:79)
… 6 more

问题分析:
从报错信息上看貌似是Authentication认证的一些错误

  1. 网上找了查了很多都没发现解决方案。
  2. 从官网security Authentication章节也没看到好的解决方案,想要配置Kerberos相关的Authentication,一看太麻烦感觉也不太靠谱
    http://sqoop.apache.org/docs/1.99.7/security/AuthenticationAndAuthorization.html

解决方案

无意中在http://blog.csdn.net/jiacai2050/article/details/59117645这篇文章中发现了希望

所以,我试着在url后面加上/,果然好使了。

我的代码如下:
没加/之前

url加上/后

 

转载于:https://www.cnblogs.com/meet/p/7686798.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值