中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

spark怎么讀取hbase表

發布時間:2022-01-17 09:38:52 來源:億速云 閱讀:199 作者:iii 欄目:開發技術

這篇文章主要介紹了spark怎么讀取hbase表的相關知識,內容詳細易懂,操作簡單快捷,具有一定借鑒價值,相信大家閱讀完這篇spark怎么讀取hbase表文章都會有所收獲,下面我們一起來看看吧。

一.場景:
    spark通過phoenix 讀取hbase表,其實說白了先要去Zookeeper建立connection。

二.代碼:

  1. val zkUrl = "192.168.100.39,192.168.100.40,192.168.100.41:2181"

  2. val formatStr = "org.apache.phoenix.spark"

  3. val oms_orderinfoDF = spark.read.format(formatStr)

  4.   .options(Map("table" -> "oms_orderinfo", "zkUrl" -> zkUrl))

  5.   .load


三.查看SparkJob日志:

  1. 17/10/24 03:25:25 INFO zookeeper.ClientCnxn: Opening socket connection to server hadoop40/192.168.100.40:2181. Will not attempt to authenticate using SASL (unknown error)

  2. 17/10/24 03:25:25 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /192.168.100.48:35952, server: hadoop40/192.168.100.40:2181

  3. 17/10/24 03:25:25 WARN zookeeper.ClientCnxn: Session 0x0 for server hadoop40/192.168.100.40:2181, unexpected error, closing socket connection and attempting reconnect

  4. java.io.IOException: Connection reset by peer

  5.     at sun.nio.ch.FileDispatcherImpl.read0(Native Method)

  6.     at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)

  7.     at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)

  8.     at sun.nio.ch.IOUtil.read(IOUtil.java:192)

  9.     at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)

  10.     at org.apache.phoenix.shaded.org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:68)

  11.     at org.apache.phoenix.shaded.org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:355)

  12.     at org.apache.phoenix.shaded.org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)

  13. 17/10/24 03:25:25 INFO yarn.ApplicationMaster: Deleting staging directory hdfs://nameservice1/user/hdfs/.sparkStaging/application_1507703377455_4854

  14. 17/10/24 03:25:25 INFO util.ShutdownHookManager: Shutdown hook called


四.查看Zookeeper日志:
  1. 2017-10-24 03:25:22,498 WARN org.apache.zookeeper.server.NIOServerCnxnFactory: Too many connections from /192.168.100.40 - max is 500

  2. 2017-10-24 03:25:25,588 WARN org.apache.zookeeper.server.NIOServerCnxnFactory: Too many connections from /192.168.100.40 - max is 500

  3. 2017-10-24 03:25:25,819 WARN org.apache.zookeeper.server.NIOServerCnxnFactory: Too many connections from /192.168.100.40 - max is 500

  4. 2017-10-24 03:25:26,092 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception

  5. EndOfStreamException: Unable to read additional data from client sessionid 0x15ed091ee09897d, likely client has closed socket

  6.     at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:231)

  7.     at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)

  8.     at java.lang.Thread.run(Thread.java:745)

  9. 2017-10-24 03:25:26,092 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /192.168.100.40:47084 which had sessionid 0x15ed091ee09897d

  10. 2017-10-24 03:25:26,092 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception

  11. EndOfStreamException: Unable to read additional data from client sessionid 0x15ed091ee098981, likely client has closed socket

  12.     at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:231)

  13.     at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)

  14.     at java.lang.Thread.run(Thread.java:745)

  15. 2017-10-24 03:25:26,093 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /192.168.100.40:47304 which had sessionid 0x15ed091ee098981

  16. 2017-10-24 03:25:26,093 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception


五.解決方法:
undefinedmaxClientCnxns調大到1000,重啟zookeeper服務生效配置即可。
spark怎么讀取hbase表

關于“spark怎么讀取hbase表”這篇文章的內容就介紹到這里,感謝各位的閱讀!相信大家對“spark怎么讀取hbase表”知識都有一定的了解,大家如果還想學習更多知識,歡迎關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

姜堰市| 慈利县| 九龙城区| 咸宁市| 永修县| 韩城市| 江油市| 乌拉特中旗| 历史| 上高县| 剑阁县| 饶阳县| 潼南县| 渭源县| 农安县| 云和县| 永春县| 达州市| 大新县| 溆浦县| 黄平县| 隆昌县| 浪卡子县| 海原县| 普安县| 板桥市| 金沙县| 新邵县| 尚义县| 松滋市| 始兴县| 肥城市| 紫阳县| 唐河县| 本溪市| 公安县| 永康市| 东丽区| 宕昌县| 双鸭山市| 湛江市|