Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set hbase host & port with code #321

Open
mohitgargk opened this issue Sep 25, 2019 · 1 comment
Open

Set hbase host & port with code #321

mohitgargk opened this issue Sep 25, 2019 · 1 comment

Comments

@mohitgargk
Copy link

Is it possible to provide spark.hbase.host and spark.hbase.port in code? I tried following

`val sparkConf = new SparkConf().setAppName("Spark-HBase").setMaster("local[4]")

sparkConf.set("spark.hbase.host", "hbase_dev.myorg.net");

val spark: SparkSession = SparkSession.builder()
  .config(sparkConf)
  .getOrCreate()`

but getting error as shc tries to connect to localhost:

19/09/25 21:16:34 INFO ClientCnxn: Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error) 19/09/25 21:16:34 WARN ReadOnlyZKClient: 0x1a785fd5 to localhost:2181 failed for get of /hbase/hbaseid, code = CONNECTIONLOSS, retries = 3 19/09/25 21:16:34 WARN ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1125)

@injulkarnilesh
Copy link

I know it is a long shot, but did you ever solve it, and how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants