Background
Today, when using JAVAAPI to connect sqoop1.99.7, I encountered an error.
The error message is as follows:
0 [main] WARN org.apache.hadoop.util.nativecodeloader-unable to load Native-hadoop library for your platform ... using Builtin-java classes where applicableexception 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 :) 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 foundat 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
Problem Analysis:
From the error message appears to be authentication certification of some errors
- I looked up the net and found a lot of solutions.
- From the official Website Security Authentication Chapter also did not see the good solution, wants to configure the Kerberos related authentication, looks too troublesome to feel also is not very reliable
Http://sqoop.apache.org/docs/1.99.7/security/AuthenticationAndAuthorization.html
Solution Solutions
Inadvertently found hope in http://blog.csdn.net/jiacai2050/article/details/59117645 this article
So, I tried to add a/to the URL behind it.
My code is as follows:
No Add/before
URL Plus/post
Client_0004:unable to find valid Kerberos ticket cache (kinit)