背景

今天在使用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加上/后

CLIENT_0004:Unable to find valid Kerberos ticket cache (kinit)的更多相关文章

  1. Kerberos ticket lifetime及其它

    前言 之前的博文中涉及到了Kerberos的内容,这里对Kerberos ticket lifetime相关的内容做一个补充. ticket lifetime Kerberos ticket具有lif ...

  2. Kerberos Ticket管理

    Kerberos Ticket管理 本章介绍如何管理您的Kerberos Ticket,这里的Ticket是指Ticket-Granting-Ticket(TGT),是您访问集群中服务的凭证.我们假设 ...

  3. 解决PKIX:unable to find valid certification path to requested target 的问题

    这两天在twitter服务器上忽然遇到这样的异常: e: sun.security.validator.ValidatorException: PKIX path building failed: s ...

  4. 解决 java 使用ssl过程中出现"PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

    今天,封装HttpClient使用ssl时报一下错误: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExc ...

  5. 解决PKIX(PKIX path building failed) 问题 unable to find valid certification path to requested target

    最近在写java的一个服务,需要给远程服务器发送post请求,认证方式为Basic Authentication,在请求过程中出现了 PKIX path building failed: sun.se ...

  6. Pop3_解决PKIX:unable to find valid certification path to requested target 的问题

    最近有公司pop3协议接收pp邮箱出现异常,连不上服务器,错误内容: e: sun.security.validator.ValidatorException: PKIX path building ...

  7. Unable to get valid context for root

    登陆时报以下错误Unable to get valid context for rootLast login: Wed Jul 24 02:06:01 2013 from 10.64.41.3 单机模 ...

  8. unable to find valid certification path to requested target

    Error : javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path bu ...

  9. https编程遇到PKIX:unable to find valid certification path to requested target 的问题

    https编程遇到PKIX:unable to find valid certification path to requested target 的问题 2016-12-01 解决方案见:解决PKI ...

随机推荐

  1. Spring通过ApplicationContext主动获取bean

    有些场景无法通过AutoWired和compoment注解传递进来,于是希望通过Spring context主动去获取beandemo: package com.qhong.Util; import ...

  2. 用python + hadoop streaming 编写分布式程序(一) -- 原理介绍,样例程序与本地调试

    相关随笔: Hadoop-1.0.4集群搭建笔记 用python + hadoop streaming 编写分布式程序(二) -- 在集群上运行与监控 用python + hadoop streami ...

  3. cent os下搭建简单的服务器

    作为常和网络打交道的程序员,经常会遇到需要服务器的场合,比如搭建一个web服务器,一个代理服务器,又或者一个小型的游戏服务器. 我时常和朋友一起玩一款叫我的世界的游戏,为了能够长期稳定地联机玩,所以特 ...

  4. 以QQ举例 说明计算机网络中的一些概念区别(TCP与UDP,广播与单播)

    QQ 中的 广播与单播 今天简单地学习了一下 广播和多播(组播) 的知识.关于 单播和多播 的概念,可以用 QQ 中的一些例子来解释. 单播,就像 两个人聊QQ 一样,信息的接收和传递只在两个节点之间 ...

  5. ASCII 、UTF-8、Unicode都是个啥啊,为啥会乱码啊?

    因为计算机只能处理数字,如果要处理文本,就必须先把文本转换为数字才能处理.最早的计算机在设计时采用8个比特(bit)作为一个字节(byte),所以,一个字节能表示的最大的整数就是255(二进制1111 ...

  6. linux awk命令详解--转载

    awk是行处理器: 相比较屏幕处理的优点,在处理庞大文件时不会出现内存溢出或是处理缓慢的问题,通常用来格式化文本信息 awk处理过程: 依次对每一行进行处理,然后输出 awk命令形式: awk [-F ...

  7. python 二进制数相加

    def add_binary_nums(x,y): max_len = max(len(x), len(y)) x = x.zfill(max_len) y = y.zfill(max_len) re ...

  8. 《剑指offer》第二十八题(对称的二叉树)

    // 面试题28:对称的二叉树 // 题目:请实现一个函数,用来判断一棵二叉树是不是对称的.如果一棵二叉树和 // 它的镜像一样,那么它是对称的. #include <iostream> ...

  9. 在线客服 分享 qq 一键加好友 一键入群

    1.在线客服 <a href="tencent://message/?uin=qqnum&Site=&menu=yes">qq客服</a>  ...

  10. 【Golang】幽灵变量(变量覆盖)问题的一劳永逸解决方法

    背景 在我们公司,测试定位问题的能力在考核中占了一定的比例,所以我们定位问题的主动性会比较高.因为很多开发同学都是刚开始使用golang,所以bug频出,其中又以短变量声明语法导致的错误最多.所以就专 ...