<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Spark can't connect to HBase  using Kerberos in Cluster mode in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142107#M104700</link>
    <description>&lt;P&gt;Hi Bikas, If I want to use HbaseConnection directly to access hbase, would Apache Spark 2.2 refresh token for me?  If yes, how to get connection object, just call ConnectionFactory.createConnection(conf) ?&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 18:31:36 GMT</pubDate>
    <dc:creator>xilang_yan</dc:creator>
    <dc:date>2018-04-10T18:31:36Z</dc:date>
    <item>
      <title>Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142091#M104684</link>
      <description>&lt;P&gt;
	Hi,&lt;/P&gt;&lt;P&gt;
	I am running a spark application in a Kerberos based HDP 
platform. This spark application connects to HBase, write and read data 
perfectly well in a local mode on any node in the cluster. However, when
 I run this application on the cluster by using "-master yarn and 
--deploymode client (or cluster)"  the Kerberos authentication fails. I 
have tried all sorts of things by doing Kinit outside of the application
 on each node, and doing Kerberos authentication inside the application 
as well but none of it has worked so far. In the local mode, nothing seems to have any issue and everything works: when I do kinit outside and do not perform any authentication inside the application. However, in the cluster mode nothing works whether I authenticate inside the application of outside the application. Here is an extract of the 
stack trace:&lt;/P&gt;&lt;PRE&gt;
ERROR 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:211)&lt;/PRE&gt;&lt;P&gt;Below is the code that I used for authenticating inside the application:&lt;/P&gt;&lt;PRE&gt;Configuration conf = HBaseConfiguration.create();  conf.addResource(new Path(hbaseConfDir,"hbase-site.xml")); conf.addResource(new Path(hadoopConfDir,"core-site.xml")); conf.set("hbase.client.keyvalue.maxsize", "0");conf.set("hbase.rpc.controllerfactory.class","org.apache.hadoop.hbase.ipc.RpcControllerFactory");
 &amp;lt;b&amp;gt; conf.set("hadoop.security.authentication", "kerberos");
 conf.set("hbase.security.authentication", "kerberos");
 UserGroupInformation.setConfiguration(conf);
  String keyTab="/etc/security/keytabs/somekeytab";
  UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI("name@xyz.com", keyTab);
   UserGroupInformation.setLoginUser(ugi); &amp;lt;/b&amp;gt;
        
  connection=ConnectionFactory.createConnection(conf);
    logger.debug("HBase connected"); &lt;/PRE&gt;&lt;P&gt;Adding or removing the bold lines in the above code didn't really have any effect other than the fact that when the bold lines are there kinit outside of the application is not needed.&lt;/P&gt;&lt;P&gt;Please let me know how can I solve this problem. It has been quite some time I am hitting my head on this issue.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 22:53:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142091#M104684</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-07-21T22:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142092#M104685</link>
      <description>&lt;P&gt;You should &lt;STRONG&gt;not&lt;/STRONG&gt; rely on an external ticket cache for distributed jobs. The best solution is to ship a keytab with your application or rely on a keytab being deployed on all nodes where your Spark task may be executed.&lt;/P&gt;&lt;P&gt;You likely want to replace:&lt;/P&gt;&lt;PRE&gt;UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI("name@xyz.com", keyTab);
UserGroupInformation.setLoginUser(ugi);&lt;/PRE&gt;&lt;P&gt;With:&lt;/P&gt;&lt;PRE&gt;UserGroupInformation.loginUserFromKeytab("name@xyz.com", keyTab);
connection=ConnectionFactory.createConnection(conf);&lt;/PRE&gt;&lt;P&gt;With your approach above, you would need to do something like the following after obtaining the UserGroupInformation instance:&lt;/P&gt;&lt;PRE&gt;ugi.doAs(new PrivilegedAction&amp;lt;Void&amp;gt;() {
  public Void run() {
    connection = ConnectionFactory.createConnection(conf);
    ...
    return null;
  }
});
&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jul 2016 23:02:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142092#M104685</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-07-21T23:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142093#M104686</link>
      <description>&lt;P&gt;I tried to ship keytab file using "--files" option and then read that
 file using SparkFiles.get("xyz.keytab").  I have also tried the 
following statement but it didn't work. &lt;/P&gt;&lt;PRE&gt;UserGroupInformation.loginUserFromKeytab("name@xyz.com", keyTab);&lt;/PRE&gt;&lt;P&gt;However, your suggestion about adding ugi.doAs function helped me resolved this issue.&lt;/P&gt;&lt;P&gt;Here is the full code, if anyone else gets into the same trouble:&lt;/P&gt;&lt;PRE&gt;       
UserGroupInformation.setConfiguration(conf);
String keyTab="/etc/security/keytabs/somekeytab"
       UserGroupInformation ugi=UserGroupInformation.loginUserFromKeytabAndReturnUGI("name@xyz.com", keyTab);
             UserGroupInformation.setLoginUser(ugi);
        ugi.doAs(new PrivilegedExceptionAction&amp;lt;Void&amp;gt;() {
@Override
          public Void run() throws IOException {
            connection=ConnectionFactory.createConnection(conf);
            return null;
         }
       });&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jul 2016 01:44:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142093#M104686</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-07-22T01:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142094#M104687</link>
      <description>&lt;P&gt;Great. Glad you got it working in the end. I'm not sure how resource localization works in Spark (can only compare it to how I know YARN works).&lt;/P&gt;&lt;P&gt;The explanation behind those two different UserGroupInformation calls is that the one you invoked does not alter the static "current user" state inside UserGroupInformation and the JAAS login system. That is why you need the doAs() call. If you use loginUserFromKeytab() instead, you can remove the doAs and just interact with HBase normally.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2016 01:51:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142094#M104687</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-07-22T01:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142095#M104688</link>
      <description>&lt;P&gt;Sorry, I just corrected the code that worked for me, loginUserFromKeytab() didn't work but  &lt;/P&gt;&lt;P&gt;loginUserFromKeytabAndReturnUGI with doAs() worked.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2016 02:25:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142095#M104688</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-07-22T02:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142096#M104689</link>
      <description>&lt;P&gt;You got the same error message?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2016 02:51:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142096#M104689</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-07-22T02:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142097#M104690</link>
      <description>&lt;P&gt;Yes, I got the same kerberos credential error that I posted above forloginUserFromKeytab()&lt;/P&gt;&lt;P&gt;When I shipped files, the error changed slightly to: can't get password from the keytab.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2016 03:25:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142097#M104690</guid>
      <dc:creator>shariyar_murtaz</dc:creator>
      <dc:date>2016-07-22T03:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142098#M104691</link>
      <description>&lt;PRE&gt;Above solution is not working for me. However I found below error in debug log. I have hbase libs present in my --driver class path and --jars. 


16/09/14 16:56:26 INFO YarnSparkHadoopUtil: HBase class not found java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration
16/09/14 16:56:26 DEBUG YarnSparkHadoopUtil: HBase class not found
java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.apache.spark.deploy.yarn.YarnSparkHadoopUtil.obtainTokenForHBaseInner(YarnSparkHadoopUtil.scala:381)
        at org.apache.spark.deploy.yarn.YarnSparkHadoopUtil.obtainTokenForHBase(YarnSparkHadoopUtil.scala:362)
        at org.apache.spark.deploy.yarn.YarnSparkHadoopUtil.obtainTokenForHBase(YarnSparkHadoopUtil.scala:165)
        at org.apache.spark.deploy.yarn.Client.prepareLocalResources(Client.scala:349)
        at org.apache.spark.deploy.yarn.Client.createContainerLaunchContext(Client.scala:733)
        at org.apache.spark.deploy.yarn.Client.submitApplication(Client.scala:143)
        at org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.start(YarnClientSchedulerBackend.scala:56)
        at org.apache.spark.scheduler.TaskSchedulerImpl.start(TaskSchedulerImpl.scala:144)
        at org.apache.spark.SparkContext.&amp;lt;init&amp;gt;(SparkContext.scala:530)
        at com.xyz.demo.dq.util.ContextBuilder$.getSparkContext(DQUtils.scala:118)
        at com.xyz.demo.dq.DataQualityApplicationHandler$delayedInit$body.apply(DataQualityApplicationHandler.scala:62)
        at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
        at scala.App$anonfun$main$1.apply(App.scala:71)
        at scala.App$anonfun$main$1.apply(App.scala:71)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
        at scala.App$class.main(App.scala:71)
        at com.xyz.demo.dq.DataQualityApplicationHandler$.main(DataQualityApplicationHandler.scala:52)
        at com.xyz.demo.dq.DataQualityApplicationHandler.main(DataQualityApplicationHandler.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$runMain(SparkSubmit.scala:731)
        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
16/09/14 16:56:26 WARN Token: Cannot find class for token kind HIVE_DELEGATION_TOKEN
16/09/14 16:56:26 WARN Token: Cannot find class for token kind HIVE_DELEGATION_TOKEN
16/09/14 16:56:26 DEBUG Client: Kind: HDFS_DELEGATION_TOKEN, Service: 10.60.70.10:8020, Ident: (HDFS_DELEGATION_TOKEN token 9045 for ctadmin); HDFS_DELEGATION_TOKEN token 9045 for ctadmin; Renewer: yarn; Issued: 9/14/16 4:56 PM; Max Date: 9/21/16 4:56 PM
Kind: HIVE_DELEGATION_TOKEN, Service: , Ident: 00 12 63 74 61 64 6d 69 6e 40 48 53 43 41 4c 45 2e 43 4f 4d 04 68 69 76 65 00 8a 01 57 28 72 aa ff 8a 01 57 4c 7f 2e ff 2a 40; null



&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 19:35:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142098#M104691</guid>
      <dc:creator>ashish_gupta1</dc:creator>
      <dc:date>2016-09-14T19:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142099#M104692</link>
      <description>&lt;P&gt;You have a completely different error, &lt;A rel="user" href="https://community.cloudera.com/users/3569/ashishgupta.html" nodeid="3569"&gt;@Ashish Gupta&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please create your own question for this issue. It is related to your classpath.
 &lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 22:49:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142099#M104692</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-09-14T22:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142100#M104693</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt; You are correct. My issue was different, it was related to classpath. I resolved that and now while connecting to secure cluster with above solution I am getting below error. Could you please help me out.&lt;/P&gt;&lt;PRE&gt;Caused by: org.apache.hadoop.hbase.MasterNotRunningException: com.google.protobuf.ServiceException: org.apache.hadoop.hbase.ipc.FailedServerException: This server is in the failed servers list: demo-dev1-nn/10.60.70.10:16000
        at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1540)
        at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionManager.java:1560)
        at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.getKeepAliveMasterService(ConnectionManager.java:1711)
        at org.apache.hadoop.hbase.client.MasterCallable.prepare(MasterCallable.java:38)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:124)
        ... 54 more
Caused by: com.google.protobuf.ServiceException: org.apache.hadoop.hbase.ipc.FailedServerException: This server is in the failed servers list: demo-dev1-nn/10.60.70.10:16000
        at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:223)
        at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:287)
        at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$BlockingStub.isMasterRunning(MasterProtos.java:58152)
        at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.isMasterRunning(ConnectionManager.java:1571)
        at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStubNoRetries(ConnectionManager.java:1509)
        at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1531)
        ... 58 more
Caused by: org.apache.hadoop.hbase.ipc.FailedServerException: This server is in the failed servers list: demo-dev1-nn/10.60.70.10:16000
        at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:701)
        at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.writeRequest(RpcClientImpl.java:887)
        at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.tracedWriteRequest(RpcClientImpl.java:856)
        at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1200)
        at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:213)
        ... 63 more
&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Sep 2016 17:52:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142100#M104693</guid>
      <dc:creator>ashish_gupta1</dc:creator>
      <dc:date>2016-09-15T17:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142101#M104694</link>
      <description>&lt;P&gt;Again, your issue is unrelated to this one. Please stop piggy-backing on other issues and create one for yourself.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 21:47:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142101#M104694</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-09-15T21:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142102#M104695</link>
      <description>&lt;P&gt;In addition to Josh's recommendations, the configuration details in this &lt;A href="https://community.hortonworks.com/content/supportkb/48988/how-to-run-spark-job-to-interact-with-secured-hbas.html"&gt;KB article&lt;/A&gt; are also relevant to setting up Spark-to-HBase connectivity in a secure environment.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 02:59:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142102#M104695</guid>
      <dc:creator>rtempleton</dc:creator>
      <dc:date>2017-01-17T02:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142103#M104696</link>
      <description>&lt;P&gt;First of all, which Spark version are you using. Apache Spark 2.0 has support for automatically acquiring HBase security tokens correctly for that job and all its executors. Apache Spark 1.6 does not have that feature but in HDP Spark 1.6 we have backported that feature and it can acquire the HBase tokens for the jobs. The tokens are automatically acquired if 1) security is enabled and 2) hbase-site.xml is present on the client classpath 3) that hbase-site.xml has kerberos security configured. Then hbase tokens for the hbase master specified in that hbase-site.xml are acquired and used in the job.&lt;/P&gt;&lt;P&gt;In order to obtain the tokens spark client needs to use hbase code and so specific hbase jars need to be present in the client classpath. This is documented in &lt;A target="_blank" href="https://github.com/hortonworks-spark/shc"&gt;here&lt;/A&gt; on the SHC github page. Search for "secure" on that page.&lt;/P&gt;&lt;P&gt;To access hbase inside the spark jobs the job obviously needs hbase jars to be present for the driver and/or executors. That would be part of your existing job submission for non-secure clusters, which I assume already works.&lt;/P&gt;&lt;P&gt;If this job is going to be long running and run beyond the token expire time (typically 7 days) then you need to submit the Spark job with the --keytab and --principal option such that Spark can use that keytab to re-acquire tokens before the current ones expire.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 04:33:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142103#M104696</guid>
      <dc:creator>bikas</dc:creator>
      <dc:date>2017-01-18T04:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142104#M104697</link>
      <description>&lt;P&gt;Hi Josh,

Should it also work when we use the function saveAsNewAPIHadoopDataset over a rdd of "JavaPairRDD&amp;lt;ImmutableBytesWritable, Put&amp;gt;"? I tried with an without the doas and I was not able to make it work. I don't get any errors just nothing happen. 
Any idea?

Thanks,
Michel&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 15:54:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142104#M104697</guid>
      <dc:creator>michelsumbul</dc:creator>
      <dc:date>2017-04-24T15:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142105#M104698</link>
      <description>&lt;P&gt;I have tried both approaches, and end up getting the same error message -&amp;gt;&lt;/P&gt;&lt;PRE&gt;Caused by: javax.security.auth.login.LoginException: Unable to obtain password from user
&lt;/PRE&gt;&lt;P&gt;The same keytab file works just fine when attempting interactive login to hbase. Also, the same code works just fine when i submit the job with "local[*]" as master instead of yarn.&lt;/P&gt;&lt;P&gt;Any pointers ?&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 21:42:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142105#M104698</guid>
      <dc:creator>me2</dc:creator>
      <dc:date>2017-05-30T21:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142106#M104699</link>
      <description>&lt;OL&gt;&lt;LI&gt;Hi Josh, i have a question about connect hbase with kerberos on yarn cluster. I use UserGroupInformation.loginUserFromKeytab("name@xyz.com", keyTab) connect to hbase. on yarn cilent mode. That"s OK. but on cluster mode , still have same issue as above.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:56:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142106#M104699</guid>
      <dc:creator>yan-ting_hu</dc:creator>
      <dc:date>2017-09-07T14:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142107#M104700</link>
      <description>&lt;P&gt;Hi Bikas, If I want to use HbaseConnection directly to access hbase, would Apache Spark 2.2 refresh token for me?  If yes, how to get connection object, just call ConnectionFactory.createConnection(conf) ?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 18:31:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142107#M104700</guid>
      <dc:creator>xilang_yan</dc:creator>
      <dc:date>2018-04-10T18:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Spark can't connect to HBase  using Kerberos in Cluster mode</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142108#M104701</link>
      <description>&lt;P&gt;in hbase-site.xml hbase.coprocessor.region.classes should contain also&lt;/P&gt;&lt;P&gt;org.apache.hadoop.hbase.security.token.TokenProvider&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 18:59:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-can-t-connect-to-HBase-using-Kerberos-in-Cluster-mode/m-p/142108#M104701</guid>
      <dc:creator>indrek_maestu</dc:creator>
      <dc:date>2018-08-14T18:59:49Z</dc:date>
    </item>
  </channel>
</rss>

