浅墨散人 浅墨散人
  • 基础
  • 设计模式
  • JVM
  • Maven
  • SpringBoot
  • 基础
  • Flask
  • Diango
  • Pandas
  • SqlAlchemy
  • Sqoop
  • Flume
  • Flink
  • Hadoop
  • Hbase
  • Hive
  • Kafka
  • Kylin
  • Zookeeper
  • Tez
  • MySQL
  • Doris
  • Chrome
  • Eclipse
  • IDEA
  • iTerm2
  • Markdown
  • SublimeText
  • VirtualBox
  • WebStrom
  • Linux
  • Mac
  • Hexo
  • Git
  • Vue
  • VuePress
  • 区块链
  • 金融
数据仓库
数据治理
读书笔记
关于我
GitHub (opens new window)
  • 基础
  • 设计模式
  • JVM
  • Maven
  • SpringBoot
  • 基础
  • Flask
  • Diango
  • Pandas
  • SqlAlchemy
  • Sqoop
  • Flume
  • Flink
  • Hadoop
  • Hbase
  • Hive
  • Kafka
  • Kylin
  • Zookeeper
  • Tez
  • MySQL
  • Doris
  • Chrome
  • Eclipse
  • IDEA
  • iTerm2
  • Markdown
  • SublimeText
  • VirtualBox
  • WebStrom
  • Linux
  • Mac
  • Hexo
  • Git
  • Vue
  • VuePress
  • 区块链
  • 金融
数据仓库
数据治理
读书笔记
关于我
GitHub (opens new window)
  • Sqoop

    • Sqoop
    • Sqoop错误:CLIENT_0004:Unable to find valid Kerberos ticket cache (kinit)
      • 背景
      • 解决方案
    • Sqoop1.99.7将mysql数据导入到hdfs
    • Sqoop2安装
  • BigData
  • Sqoop
2019-01-15
目录

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

# 背景

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

[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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

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

  1. 网上找了查了很多都没发现解决方案。

  2. 从官网security Authentication章节也没看到好的解决方案,想要配置Kerberos相关的Authentication,一看太麻烦感觉也不太靠谱 http://sqoop.apache.org/docs/1.99.7/security/AuthenticationAndAuthorization.html (opens new window)

# 解决方案

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

img

所以,我试着在url后面加上/,果然好使了。 我的代码如下:

没加/之前

img

url加上/后

img

#Hadoop#Sqoop
最后更新时间: 2022/7/23 10:17:11
Sqoop
Sqoop1.99.7将mysql数据导入到hdfs

← Sqoop Sqoop1.99.7将mysql数据导入到hdfs→

最近更新
01
分区分桶
08-21
02
数据模型(重要)
08-21
03
安装和编译
08-21
更多文章>
Theme by Vdoing
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式