Hi, I am trying to write java code snippet to authenticate hbase using Kerberos, But I am getting attached exception. I tried all kind of config through code but no luck.
-Saurabh ---Java Code HbaseGetPropertyValues properties = new HbaseGetPropertyValues(); properties.getPropValues(); Configuration hBaseConfig = HBaseConfiguration.create(); hBaseConfig.setInt("timeout", Integer.parseInt(properties.TIMEOUT)); hBaseConfig.set("hbase.zookeeper.quorum", properties.HBASE_ZOOKEEPER_QUORUM); //hBaseConfig.set("hbase.master", "hdfs-hbase-m1.insight-test-1:60000"); hBaseConfig.set("hbase.zookeeper.property.clientport", properties.HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT); hBaseConfig.set("zookeeper.znode.parent", properties.ZOOKEEPER_ZNODE_PARENT); //hBaseConfig.set("hadoop.security.authentication", "kerberos"); hBaseConfig.set("hbase.security.authentication", "kerberos"); hBaseConfig.set("hbase.master.kerberos.principal", "test/INSIGHT@INSIGHT"); hBaseConfig.set("hbase.regionserver.kerberos.principal", "test/INSIGHT@INSIGHT"); hBaseConfig.set("hbase.master.keytab.file", "/root/test.keytab"); hBaseConfig.set("hbase.regionserver.keytab.file", "/root/test.keytab"); //runLoginAndRenewalThread(hBaseConfig, "/root/test.keytab", "test/INSIGHT@INSIGHT"); UserGroupInformation.setConfiguration(hBaseConfig); User.login(hBaseConfig,"hbase.master.keytab.file", "hbase.regionserver.kerberos.principal", null); //UserGroupInformation.loginUserFromKeytab("test/INSIGHT@INSIGHT","/root/test.keytab"); UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI("test/INSIGHT@INSIGHT","/root/samalviy.keytab"); UserGroupInformation.setLoginUser(ugi); System.out.println("getLoginUser :: "+ugi.getLoginUser()); System.out.println(hBaseConfig); HBaseAdmin.checkHBaseAvailable(hBaseConfig); Connection connection = ConnectionFactory.createConnection(hBaseConfig);
Config values loaded SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/root/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/local/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 16/03/17 20:22:52 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable getLoginUser :: root (auth:SIMPLE) Configuration: core-default.xml, core-site.xml, mapred-default.xml, mapred-site.xml, hbase-default.xml, hbase-site.xml 16/03/17 20:22:53 INFO zookeeper.RecoverableZooKeeper: Process identifier=hconnection-0x7cc6f83d connecting to ZooKeeper ensemble=zookeeper-cdh1.insight-test-1:2181 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:host.name=dev-pia-dev-1.cisco.com 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_79 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:java.home=/workspace/emms/jdk1.7.0_79/jre 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/workspace/emms/tenant_onboarding/bin:/root/hbase-client-1.0.0-cdh5.5.1.jar:/root/hadoop-common-2.6.0-cdh5.5.1.jar:/root/hbase-common-1.0.0-cdh5.5.1.jar:/root/commons-logging-1.1.3.jar:/root/commons-collections.jar:/root/hadoop-core-2.6.0-mr1-cdh5.5.1.jar:/root/slf4j-log4j12.jar:/root/log4j-1.2.17.jar:/usr/local/hbase/lib/hbase-protocol-1.1.2.jar:/usr/local/hbase/lib/activation-1.1.jar:/usr/local/hbase/lib/aopalliance-1.0.jar:/usr/local/hbase/lib/apacheds-i18n-2.0.0-M15.jar:/usr/local/hbase/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/usr/local/hbase/lib/api-asn1-api-1.0.0-M20.jar:/usr/local/hbase/lib/api-util-1.0.0-M20.jar:/usr/local/hbase/lib/commons-beanutils-1.7.0.jar:/usr/local/hbase/lib/commons-beanutils-core-1.8.0.jar:/usr/local/hbase/lib/commons-cli-1.2.jar:/usr/local/hbase/lib/commons-codec-1.4.jar:/usr/local/hbase/lib/commons-codec-1.9.jar:/usr/local/hbase/lib/commons-collections-3.2.1.jar:/usr/local/hbase/lib/commons-compress-1.4.1.jar:/usr/local/hbase/lib/commons-configuration-1.6.jar:/usr/local/hbase/lib/commons-daemon-1.0.13.jar:/usr/local/hbase/lib/commons-digester-1.8.jar:/usr/local/hbase/lib/commons-el-1.0.jar:/usr/local/hbase/lib/commons-httpclient-3.1.jar:/usr/local/hbase/lib/commons-io-2.4.jar:/usr/local/hbase/lib/commons-lang-2.6.jar:/usr/local/hbase/lib/commons-logging-1.1.3.jar:/usr/local/hbase/lib/commons-logging-1.2.jar:/usr/local/hbase/lib/commons-math3-3.1.1.jar:/usr/local/hbase/lib/commons-math-2.2.jar:/usr/local/hbase/lib/commons-net-3.1.jar:/usr/local/hbase/lib/disruptor-3.3.0.jar:/usr/local/hbase/lib/findbugs-annotations-1.3.9-1.jar:/usr/local/hbase/lib/guava-11.0.2.jar:/usr/local/hbase/lib/guava-12.0.1.jar:/usr/local/hbase/lib/guava-14.0.1.jar:/usr/local/hbase/lib/guice-3.0.jar:/usr/local/hbase/lib/guice-servlet-3.0.jar:/usr/local/hbase/lib/hadoop-annotations-2.5.1.jar:/usr/local/hbase/lib/hadoop-annotations-2.5.2.jar:/usr/local/hbase/lib/hadoop-archives-2.5.2.jar:/usr/local/hbase/lib/hadoop-auth-2.5.1.jar:/usr/local/hbase/lib/hadoop-auth-2.5.2.jar:/usr/local/hbase/lib/hadoop-client-2.5.1.jar:/usr/local/hbase/lib/hadoop-common-2.5.2.jar:/usr/local/hbase/lib/hadoop-datajoin-2.5.2.jar:/usr/local/hbase/lib/hadoop-distcp-2.5.2.jar:/usr/local/hbase/lib/hadoop-extras-2.5.2.jar:/usr/local/hbase/lib/hadoop-gridmix-2.5.2.jar:/usr/local/hbase/lib/hadoop-hdfs-2.5.2.jar:/usr/local/hbase/lib/hadoop-mapreduce-client-app-2.5.1.jar:/usr/local/hbase/lib/hadoop-mapreduce-client-common-2.5.1.jar:/usr/local/hbase/lib/hadoop-mapreduce-client-core-2.5.1.jar:/usr/local/hbase/lib/hadoop-mapreduce-client-jobclient-2.5.1.jar:/usr/local/hbase/lib/hadoop-mapreduce-client-shuffle-2.5.1.jar:/usr/local/hbase/lib/hadoop-openstack-2.5.2.jar:/usr/local/hbase/lib/hadoop-rumen-2.5.2.jar:/usr/local/hbase/lib/hadoop-sls-2.5.2.jar:/usr/local/hbase/lib/hadoop-streaming-2.5.2.jar:/usr/local/hbase/lib/hadoop-yarn-api-2.5.1.jar:/usr/local/hbase/lib/hadoop-yarn-client-2.5.1.jar:/usr/local/hbase/lib/hadoop-yarn-common-2.5.1.jar:/usr/local/hbase/lib/hadoop-yarn-server-common-2.5.1.jar:/usr/local/hbase/lib/hamcrest-core-1.3.jar:/usr/local/hbase/lib/hbase-annotations-1.1.2.jar:/usr/local/hbase/lib/hbase-annotations-1.1.2-tests.jar:/usr/local/hbase/lib/hbase-client-1.1.2.jar:/usr/local/hbase/lib/hbase-common-1.1.2.jar:/usr/local/hbase/lib/hbase-common-1.1.2-tests.jar:/usr/local/hbase/lib/hbase-examples-1.1.2.jar:/usr/local/hbase/lib/hbase-hadoop2-compat-1.1.2.jar:/usr/local/hbase/lib/hbase-hadoop-compat-1.1.2.jar:/usr/local/hbase/lib/hbase-it-1.1.2.jar:/usr/local/hbase/lib/hbase-it-1.1.2-tests.jar:/usr/local/hbase/lib/hbase-prefix-tree-1.1.2.jar:/usr/local/hbase/lib/hbase-procedure-1.1.2.jar:/usr/local/hbase/lib/hbase-resource-bundle-1.1.2.jar:/usr/local/hbase/lib/hbase-rest-1.1.2.jar:/usr/local/hbase/lib/hbase-server-1.1.2.jar:/usr/local/hbase/lib/hbase-server-1.1.2-tests.jar:/usr/local/hbase/lib/hbase-shell-1.1.2.jar:/usr/local/hbase/lib/hbase-thrift-1.1.2.jar:/usr/local/hbase/lib/htrace-core-3.1.0-incubating.jar:/usr/local/hbase/lib/httpclient-4.2.5.jar:/usr/local/hbase/lib/httpcore-4.1.3.jar:/usr/local/hbase/lib/httpcore-4.2.5.jar:/usr/local/hbase/lib/jackson-core-asl-1.9.13.jar:/usr/local/hbase/lib/jackson-jaxrs-1.9.13.jar:/usr/local/hbase/lib/jackson-mapper-asl-1.9.13.jar:/usr/local/hbase/lib/jackson-xc-1.9.13.jar:/usr/local/hbase/lib/jamon-runtime-2.3.1.jar:/usr/local/hbase/lib/jasper-compiler-5.5.23.jar:/usr/local/hbase/lib/jasper-runtime-5.5.23.jar:/usr/local/hbase/lib/javax.inject-1.jar:/usr/local/hbase/lib/java-xmlbuilder-0.4.jar:/usr/local/hbase/lib/jaxb-api-2.2.2.jar:/usr/local/hbase/lib/jaxb-impl-2.2.3-1.jar:/usr/local/hbase/lib/jcodings-1.0.8.jar:/usr/local/hbase/lib/jersey-client-1.9.jar:/usr/local/hbase/lib/jersey-core-1.9.jar:/usr/local/hbase/lib/jersey-guice-1.9.jar:/usr/local/hbase/lib/jersey-json-1.9.jar:/usr/local/hbase/lib/jersey-server-1.9.jar:/usr/local/hbase/lib/jets3t-0.9.0.jar:/usr/local/hbase/lib/jettison-1.1.jar:/usr/local/hbase/lib/jettison-1.3.3.jar:/usr/local/hbase/lib/jetty-6.1.26.jar:/usr/local/hbase/lib/jetty-sslengine-6.1.26.jar:/usr/local/hbase/lib/jetty-util-6.1.26.jar:/usr/local/hbase/lib/joni-2.1.2.jar:/usr/local/hbase/lib/jruby-complete-1.6.8.jar:/usr/local/hbase/lib/jsch-0.1.42.jar:/usr/local/hbase/lib/jsp-2.1-6.1.14.jar:/usr/local/hbase/lib/jsp-api-2.1.jar:/usr/local/hbase/lib/jsp-api-2.1-6.1.14.jar:/usr/local/hbase/lib/jsr305-1.3.9.jar:/usr/local/hbase/lib/junit-4.11.jar:/usr/local/hbase/lib/leveldbjni-all-1.8.jar:/usr/local/hbase/lib/libthrift-0.9.0.jar:/usr/local/hbase/lib/log4j-1.2.17.jar:/usr/local/hbase/lib/metrics-core-2.2.0.jar:/usr/local/hbase/lib/mockito-all-1.8.5.jar:/usr/local/hbase/lib/netty-3.2.4.Final.jar:/usr/local/hbase/lib/netty-3.6.2.Final.jar:/usr/local/hbase/lib/netty-all-4.0.23.Final.jar:/usr/local/hbase/lib/paranamer-2.3.jar:/usr/local/hbase/lib/phoenix-4.6.0-HBase-1.1-server.jar:/usr/local/hbase/lib/protobuf-java-2.5.0.jar:/usr/local/hbase/lib/servlet-api-2.5.jar:/usr/local/hbase/lib/servlet-api-2.5-6.1.14.jar:/usr/local/hbase/lib/slf4j-api-1.7.5.jar:/usr/local/hbase/lib/slf4j-api-1.7.7.jar:/usr/local/hbase/lib/slf4j-log4j12-1.7.5.jar:/usr/local/hbase/lib/snappy-java-1.0.4.1.jar:/usr/local/hbase/lib/spymemcached-2.11.6.jar:/usr/local/hbase/lib/stax-api-1.0-2.jar:/usr/local/hbase/lib/xmlenc-0.52.jar:/usr/local/hbase/lib/xz-1.0.jar:/usr/local/hbase/lib/zookeeper-3.4.6.jar:/root/hadoop_jars/htrace-core4-4.0.1-incubating.jar:/opt/eclipse/jee-luna-4.4/configuration/org.eclipse.osgi/359/0/.cp/:/opt/eclipse/jee-luna-4.4/configuration/org.eclipse.osgi/358/0/.cp/ 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/opt/R/lib64/R/lib:/opt/R/lib64/R/bin:/opt/R/lib64/R/library/rJava/jri:/workspace/emms/xmp/decap/lib::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA> 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:os.version=4.1.1-1.el6.elrepo.x86_64 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:user.name=root 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:user.home=/root 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Client environment:user.dir=/workspace/emms/tenant_onboarding 16/03/17 20:22:53 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=zookeeper-cdh1.insight-test-1:2181 sessionTimeout=90000 watcher=hconnection-0x7cc6f83d0x0, quorum=zookeeper-cdh1.insight-test-1:2181, baseZNode=/hbase-new 16/03/17 20:22:53 INFO zookeeper.ClientCnxn: Opening socket connection to server hdfs-hbase-m1.insight-test-1/192.168.24.253:2181. Will not attempt to authenticate using SASL (unknown error) 16/03/17 20:22:53 INFO zookeeper.ClientCnxn: Socket connection established to hdfs-hbase-m1.insight-test-1/192.168.24.253:2181, initiating session 16/03/17 20:22:53 INFO zookeeper.ClientCnxn: Session establishment complete on server hdfs-hbase-m1.insight-test-1/192.168.24.253:2181, sessionid = 0x1530a88ea51f1fc, negotiated timeout = 60000 16/03/17 20:22:54 WARN security.UserGroupInformation: PriviledgedActionException as:root (auth:SIMPLE) cause:javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] 16/03/17 20:22:54 WARN ipc.AbstractRpcClient: Exception encountered while connecting to the server : javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] 16/03/17 20:22:54 FATAL ipc.AbstractRpcClient: SASL authentication failed. The most likely cause is missing or invalid credentials. Consider 'kinit'. javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:212) at org.apache.hadoop.hbase.security.HBaseSaslRpcClient.saslConnect(HBaseSaslRpcClient.java:179) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupSaslConnection(RpcClientImpl.java:605) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.access$600(RpcClientImpl.java:154) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection$2.run(RpcClientImpl.java:731) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection$2.run(RpcClientImpl.java:728) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:728) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.writeRequest(RpcClientImpl.java:890) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.tracedWriteRequest(RpcClientImpl.java:859) at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1193) at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:216) at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:300) at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$BlockingStub.isMasterRunning(MasterProtos.java:50918) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.isMasterRunning(ConnectionManager.java:1604) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStubNoRetries(ConnectionManager.java:1542) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1564) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionManager.java:1593) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.getKeepAliveMasterService(ConnectionManager.java:1733) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.isMasterRunning(ConnectionManager.java:892) at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2580) at schema.HbaseConnection.getConnection(HbaseConnection.java:66) at UnitTest.TestNameSpace.testHbaseConnection(TestNameSpace.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt) at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:147) at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:121) at sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:187) at sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:223) at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:212) at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:179) at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:193) ... 47 more 16/03/17 20:22:54 INFO client.ConnectionManager$HConnectionImplementation: Closing zookeeper sessionid=0x1530a88ea51f1fc 16/03/17 20:22:54 INFO zookeeper.ClientCnxn: EventThread shut down 16/03/17 20:22:54 INFO zookeeper.ZooKeeper: Session: 0x1530a88ea51f1fc closed org.apache.hadoop.hbase.MasterNotRunningException: com.google.protobuf.ServiceException: java.io.IOException: Could not set up IO Streams to hdfs-hbase-m1.insight-test-1/192.168.24.253:60000 at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1573) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionManager.java:1593) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.getKeepAliveMasterService(ConnectionManager.java:1733) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.isMasterRunning(ConnectionManager.java:892) at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2580) at schema.HbaseConnection.getConnection(HbaseConnection.java:66) at UnitTest.TestNameSpace.testHbaseConnection(TestNameSpace.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: com.google.protobuf.ServiceException: java.io.IOException: Could not set up IO Streams to hdfs-hbase-m1.insight-test-1/192.168.24.253:60000 at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:231) at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:300) at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$BlockingStub.isMasterRunning(MasterProtos.java:50918) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.isMasterRunning(ConnectionManager.java:1604) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStubNoRetries(ConnectionManager.java:1542) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1564) ... 29 more Caused by: java.io.IOException: Could not set up IO Streams to hdfs-hbase-m1.insight-test-1/192.168.24.253:60000 at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:773) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.writeRequest(RpcClientImpl.java:890) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.tracedWriteRequest(RpcClientImpl.java:859) at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1193) at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:216) ... 34 more Caused by: java.lang.RuntimeException: SASL authentication failed. The most likely cause is missing or invalid credentials. Consider 'kinit'. at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection$1.run(RpcClientImpl.java:673) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.handleSaslConnectionFailure(RpcClientImpl.java:631) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:739) ... 38 more Caused by: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:212) at org.apache.hadoop.hbase.security.HBaseSaslRpcClient.saslConnect(HBaseSaslRpcClient.java:179) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupSaslConnection(RpcClientImpl.java:605) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.access$600(RpcClientImpl.java:154) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection$2.run(RpcClientImpl.java:731) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection$2.run(RpcClientImpl.java:728) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:728) ... 38 more Caused by: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt) at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:147) at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:121) at sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:187) at sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:223) at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:212) at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:179) at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:193) ... 47 more Config values loaded getLoginUser :: root (auth:SIMPLE) Configuration: core-default.xml, core-site.xml, mapred-default.xml, mapred-site.xml, hdfs-default.xml, hdfs-site.xml, hbase-default.xml, hbase-site.xml 16/03/17 20:22:54 INFO zookeeper.RecoverableZooKeeper: Process identifier=hconnection-0x64ba0274 connecting to ZooKeeper ensemble=zookeeper-cdh1.insight-test-1:2181 16/03/17 20:22:54 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=zookeeper-cdh1.insight-test-1:2181 sessionTimeout=90000 watcher=hconnection-0x64ba02740x0, quorum=zookeeper-cdh1.insight-test-1:2181, baseZNode=/hbase-new 16/03/17 20:22:54 INFO zookeeper.ClientCnxn: Opening socket connection to server hdfs-hbase-m1.insight-test-1/192.168.24.253:2181. Will not attempt to authenticate using SASL (unknown error) 16/03/17 20:22:54 INFO zookeeper.ClientCnxn: Socket connection established to hdfs-hbase-m1.insight-test-1/192.168.24.253:2181, initiating session 16/03/17 20:22:54 INFO zookeeper.ClientCnxn: Session establishment complete on server hdfs-hbase-m1.insight-test-1/192.168.24.253:2181, sessionid = 0x1530a88ea51f1fd, negotiated timeout = 60000 16/03/17 20:22:55 WARN security.UserGroupInformation: PriviledgedActionException as:root (auth:SIMPLE) cause:javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] 16/03/17 20:22:55 WARN ipc.AbstractRpcClient: Exception encountered while connecting to the server : javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] 16/03/17 20:22:55 FATAL ipc.AbstractRpcClient: SASL authentication failed. The most likely cause is missing or invalid credentials. Consider 'kinit'. javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:212) at org.apache.hadoop.hbase.security.HBaseSaslRpcClient.saslConnect(HBaseSaslRpcClient.java:179) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupSaslConnection(RpcClientImpl.java:605) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.access$600(RpcClientImpl.java:154) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection$2.run(RpcClientImpl.java:731) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection$2.run(RpcClientImpl.java:728) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:728) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.writeRequest(RpcClientImpl.java:890) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.tracedWriteRequest(RpcClientImpl.java:859) at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1193) at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:216) at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:300) at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$BlockingStub.isMasterRunning(MasterProtos.java:50918) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.isMasterRunning(ConnectionManager.java:1604) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStubNoRetries(ConnectionManager.java:1542) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1564) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionManager.java:1593) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.getKeepAliveMasterService(ConnectionManager.java:1733) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.isMasterRunning(ConnectionManager.java:892) at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2580) at schema.HbaseConnection.getConnection(HbaseConnection.java:66) at UnitTest.TestNameSpace.testCreateNameSpace(TestNameSpace.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt) at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:147) at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:121) at sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:187) at sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:223) at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:212) at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:179) at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:193) ... 47 more 16/03/17 20:22:55 INFO client.ConnectionManager$HConnectionImplementation: Closing zookeeper sessionid=0x1530a88ea51f1fd 16/03/17 20:22:55 INFO zookeeper.ClientCnxn: EventThread shut down 16/03/17 20:22:55 INFO zookeeper.ZooKeeper: Session: 0x1530a88ea51f1fd closed