java.io.IOException: Connection reset by peer
一.場景:
spark透過phoenix 讀取hbase表,其實說白了先要去Zookeeper建立connection。
二.程式碼:
三.檢視SparkJob日誌:
主要錯誤是“java.io.IOException: Connection reset by peer”,其實意思很明白了Zookeeper將connection closing.
至於為什麼會被關閉connection?那麼去檢查一下hadoop40機器的zookeeper的日誌就會發現一些有用的資訊。
四.檢視Zookeeper日誌:
這個時候我們發現"Too many connections from /192.168.100.48 - max is 500",
那就說明這臺hadoop40機器的zookeeper的當前connection數已經超過配置的500了,所以新的connection必然被closed,
五.解決方法:
那麼我們只需去zookeeper的配置修改一下引數maxClientCnxns調大到1000,重啟zookeeper服務生效配置即可。
spark透過phoenix 讀取hbase表,其實說白了先要去Zookeeper建立connection。
二.程式碼:
點選(此處)摺疊或開啟
-
val zkUrl = "192.168.100.39,192.168.100.40,192.168.100.41:2181"
-
val formatStr = "org.apache.phoenix.spark"
-
val oms_orderinfoDF = spark.read.format(formatStr)
-
.options(Map("table" -> "oms_orderinfo", "zkUrl" -> zkUrl))
- .load
三.檢視SparkJob日誌:
點選(此處)摺疊或開啟
-
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)
-
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
-
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
- java.io.IOException: Connection reset by peer
-
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
-
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
-
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
-
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
-
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
-
at org.apache.phoenix.shaded.org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:68)
-
at org.apache.phoenix.shaded.org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:355)
-
at org.apache.phoenix.shaded.org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
-
17/10/24 03:25:25 INFO yarn.ApplicationMaster: Deleting staging directory hdfs://nameservice1/user/hdfs/.sparkStaging/application_1507703377455_4854
- 17/10/24 03:25:25 INFO util.ShutdownHookManager: Shutdown hook called
至於為什麼會被關閉connection?那麼去檢查一下hadoop40機器的zookeeper的日誌就會發現一些有用的資訊。
四.檢視Zookeeper日誌:
點選(此處)摺疊或開啟
-
2017-10-24 03:25:22,498 WARN org.apache.zookeeper.server.NIOServerCnxnFactory: Too many connections from /192.168.100.40 - max is 500
-
2017-10-24 03:25:25,588 WARN org.apache.zookeeper.server.NIOServerCnxnFactory: Too many connections from /192.168.100.40 - max is 500
-
2017-10-24 03:25:25,819 WARN org.apache.zookeeper.server.NIOServerCnxnFactory: Too many connections from /192.168.100.40 - max is 500
-
2017-10-24 03:25:26,092 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
-
EndOfStreamException: Unable to read additional data from client sessionid 0x15ed091ee09897d, likely client has closed socket
-
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:231)
-
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
-
at java.lang.Thread.run(Thread.java:745)
-
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
-
2017-10-24 03:25:26,092 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
-
EndOfStreamException: Unable to read additional data from client sessionid 0x15ed091ee098981, likely client has closed socket
-
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:231)
-
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
-
at java.lang.Thread.run(Thread.java:745)
-
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
- 2017-10-24 03:25:26,093 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
那就說明這臺hadoop40機器的zookeeper的當前connection數已經超過配置的500了,所以新的connection必然被closed,
五.解決方法:
那麼我們只需去zookeeper的配置修改一下引數maxClientCnxns調大到1000,重啟zookeeper服務生效配置即可。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2146302/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Connection reset by peer: socket write errorError
- go grpc: connection reset by peer 的一種解決方案GoRPC
- TNS-12547,Linux Error: 104: Connection reset by peerLinuxError
- TNS-12547 Linux Error: 104: Connection reset by peerLinuxError
- 連線華為雲的Redis服務報錯“Error: Connection reset by peer”RedisError
- Kubelet 錯誤日誌 broken pipe 和 connection reset by peer 的原因分析
- 免密scp解決ssh_exchange_identification:read connection reset by peer 原因IDE
- 阿里雲站點升級提示:OpenSSL SSL_connect: Connection reset by peer in connection to www.pbootcms.com:443阿里boot
- 【Azure Cache for Redis】Python Djange-Redis連線Azure Redis服務遇上(104, 'Connection reset by peer')RedisPython
- TNS-12547TNS-12560 TNS-00517 Linux Error: 104: Connection reset by peerLinuxError
- 【Azure Redis 快取】 Python連線Azure Redis, 使用redis.ConnectionPool 出現 "ConnectionResetError: [Errno 104] Connection reset by peer"Redis快取PythonError
- HttpClient遭遇Connection Reset異常,如何正確配置?HTTPclient
- Sqoop從Oracle抽數錯:IO Error: Connection resetOOPOracleError
- Java中處理SocketException: Connection reset”異常的方法JavaException
- JMETER java.net.SocketException: Connection reset 報錯解決方案JMeterJavaException
- SecureCRT連線CentOS不間斷出現“Connection was reset.”SecurecrtCentOS
- 從Connection Reset問題淺談DBCP的使用技巧薦
- weblogic連線池重置(Connection reset)問題解決方案Web
- 錯誤 101 (net::ERR_CONNECTION_RESET):連線已重置
- tomcat連線池不夠-java.sql.SQLException: Io 異常: Connection resetTomcatJavaSQLException
- tomcat 啟動應用報錯:java.sql.SQLException: Io 異常: Connection resetTomcatJavaSQLException
- warning:reset()[function.reset]:passedvariableisnotanarrayorobjectFunctionObject
- oracle OGG-01232 Receive TCP params error:TCP/IP error 232(connection reset)OracleTCPError
- Fabric 1.0原始碼分析(32) Peer #peer node start命令實現原始碼
- jQuery :resetjQuery
- css resetCSS
- Fabric 1.0原始碼分析(33) Peer #peer channel命令及子命令實現原始碼
- Fabric 1.0原始碼分析(32)Peer #peer根命令入口及載入子命令原始碼
- Fabric 1.0原始碼分析(34) Peer #peer chaincode命令及子命令實現原始碼AI
- JavaScript reset 事件JavaScript事件
- git reset 用法Git
- css-resetCSS
- RESET MASTER和RESET SLAVE使用場景和說明AST
- Fabric 1.0原始碼分析(31) Peer原始碼
- Reset and Checkout Files in GitGit
- gc/Agent passwd resetGC
- win10系統下瀏覽器打不開網頁提示err_connection_reset錯誤怎麼辦Win10瀏覽器網頁
- java踩坑之java.io.IOException: No space left on deviceJavaExceptiondev