<?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: Unable to connect spark python with phoenix in secure in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152921#M56867</link>
    <description>&lt;P&gt;Worked. Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2017 11:55:38 GMT</pubDate>
    <dc:creator>nbalaji-elangov</dc:creator>
    <dc:date>2017-03-13T11:55:38Z</dc:date>
    <item>
      <title>Unable to connect spark python with phoenix in secure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152917#M56863</link>
      <description>&lt;PRE&gt;from pyspark import SparkContext
from pyspark.sql import SQLContext


sc = SparkContext()
sqlc = SQLContext(sc)


df = sqlc.read \
  .format("org.apache.phoenix.spark") \
  .option("table", "TABLE1") \
  .option("zkUrl", "&amp;lt;host&amp;gt;:2181:/hbase-secure") \
  .load()


print(df)
&lt;/PRE&gt;&lt;P&gt;Run using:&lt;/P&gt;&lt;P&gt;spark-submit --master local --jars /usr/hdp/current/phoenix-client/phoenix-client.jar,/usr/hdp/current/phoenix-client/lib/phoenix-spark-4.7.0.2.5.3.0-37.jar --conf "spark.executor.extraClassPath=/usr/hdp/current/phoenix-client/phoenix-client.jar" spark_phoenix.py&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;PRE&gt;17/03/11 23:20:03 INFO ZooKeeper: Initiating client connection, connectString=&amp;lt;host&amp;gt;:2181 sessionTimeout=90000 watcher=org.apache.hadoop.hbase.zookeeper.PendingWatcher@653a27b2
17/03/11 23:20:03 INFO ClientCnxn: Opening socket connection to server &amp;lt;host&amp;gt;/10.18.106.4:2181. Will not attempt to authenticate using SASL (unknown error)
17/03/11 23:20:03 INFO ClientCnxn: Socket connection established to &amp;lt;host&amp;gt;/10.18.106.4:2181, initiating session
17/03/11 23:20:03 INFO ClientCnxn: Session establishment complete on server &amp;lt;host&amp;gt;/10.18.106.4:2181, sessionid = 0x15a7b6220540b7e, negotiated timeout = 40000
Traceback (most recent call last):
  File "/d3/app/bin/spark_phoenix.py", line 10, in &amp;lt;module&amp;gt;
    .option("zkUrl", "&amp;lt;host&amp;gt;:2181:/hbase-secure") \
  File "/usr/hdp/2.5.3.0-37/spark/python/lib/pyspark.zip/pyspark/sql/readwriter.py", line 139, in load
  File "/usr/hdp/2.5.3.0-37/spark/python/lib/py4j-0.9-src.zip/py4j/java_gateway.py", line 813, in __call__
  File "/usr/hdp/2.5.3.0-37/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 45, in deco
  File "/usr/hdp/2.5.3.0-37/spark/python/lib/py4j-0.9-src.zip/py4j/protocol.py", line 308, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o43.load.
: java.sql.SQLException: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Sat Mar 11 23:20:03 EST 2017, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=68236: row 'SYSTEM:CATALOG,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=usor7dhc01w06.use.ucdp.net,16020,1488988574688, seqNum=0




        at org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2590)
        at org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2327)
        at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:78)
        at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2327)
        at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:233)
        at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:142)
        at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:202)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at org.apache.phoenix.mapreduce.util.ConnectionUtil.getConnection(ConnectionUtil.java:98)
        at org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:57)
        at org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:45)
        at org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil.getSelectColumnMetadataList(PhoenixConfigurationUtil.java:277)
        at org.apache.phoenix.spark.PhoenixRDD.toDataFrame(PhoenixRDD.scala:106)
        at org.apache.phoenix.spark.PhoenixRelation.schema(PhoenixRelation.scala:57)
        at org.apache.spark.sql.execution.datasources.LogicalRelation.&amp;lt;init&amp;gt;(LogicalRelation.scala:37)
        at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:125)
        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:498)
        at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
        at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)
        at py4j.Gateway.invoke(Gateway.java:259)
        at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)
        at py4j.commands.CallCommand.execute(CallCommand.java:79)
        at py4j.GatewayConnection.run(GatewayConnection.java:209)
        at java.lang.Thread.run(Thread.java:745)



&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Mar 2017 11:51:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152917#M56863</guid>
      <dc:creator>nbalaji-elangov</dc:creator>
      <dc:date>2017-03-12T11:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect spark python with phoenix in secure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152918#M56864</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/128/nbalaji-elangovan.html" nodeid="128"&gt;@nbalaji-elangovan&lt;/A&gt;&lt;P&gt;As you mentioned that it is secured environment. So i guess In your "spark-submit" command line argument you should pass the keytab &amp;amp; principal information:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt; --keytab /etc/security/keytabs/spark.headless.keytab --principal spark-XYZ@ABC.COM&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2017 12:04:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152918#M56864</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-12T12:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect spark python with phoenix in secure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152919#M56865</link>
      <description>&lt;P&gt;That doesnt work, I tried it &lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2017 12:12:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152919#M56865</guid>
      <dc:creator>nbalaji-elangov</dc:creator>
      <dc:date>2017-03-12T12:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect spark python with phoenix in secure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152920#M56866</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/128/nbalaji-elangovan.html" nodeid="128"&gt;@nbalaji-elangovan&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Copy/Symlink the hbase-site.xml under /etc/spark/conf as below:&lt;/P&gt;&lt;PRE&gt; ln -s /etc/hbase/conf/hbase-site.xml /etc/spark/conf/hbase-site.xml&lt;/PRE&gt;&lt;P&gt;Once done execute the spark-submit as you had done earlier and then try again &lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 11:06:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152920#M56866</guid>
      <dc:creator>skurup</dc:creator>
      <dc:date>2017-03-13T11:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect spark python with phoenix in secure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152921#M56867</link>
      <description>&lt;P&gt;Worked. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 11:55:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-spark-python-with-phoenix-in-secure/m-p/152921#M56867</guid>
      <dc:creator>nbalaji-elangov</dc:creator>
      <dc:date>2017-03-13T11:55:38Z</dc:date>
    </item>
  </channel>
</rss>

