Caused by: org.apache.kudu.client.NoLeaderFoundException

寫在前面

在我使用spark對接kudu的過程中,出現如下錯誤:

Caused by: org.apache.kudu.client.NoLeaderFoundException: Master config (192.168.1.117:7051) has no leader.
Exceptions received: org.apache.kudu.client.RecoverableException:
[peer master-192.168.1.117:7051(192.168.1.117:7051)] encountered a read timeout; closing the channel\

重點分析:

Master config (192.168.1.117:7051) has no leader : 客戶端找不到master的leader
encountered a read timeout : 遭遇讀取超時

因爲kudu客戶端連接kudu服務器時,服務器返回master的主機名

要想知道master返回的主機名是什麼,可以直接到web-ui上去查看。
注意是master的web-ui,即8051端口頁面:
在這裏插入圖片描述

查看自己master 返回的leader:
http://192.168.1.117:8051/masters

rpc_addresses { host: "spark003" port: 7051 } 
http_addresses { host: "spark003" port: 8051 } 
software_version: "kudu 1.7.0-cdh5.15.0 (rev 7dd4889729bb5ee0b331a5a6c3cd4427dbf79308)" 
https_enabled: false

這個rpc_addresses 的 spark003 會返回給你的客戶端,這個時候你的客戶端就得能夠解析才行

問題就是出在這兒。我本地的hosts 文件並沒有這個解析

我是windows ,hosts文件位置在:

C:\Windows\System32\drivers\etc

# add a record
192.168.1.117 spark003

最後,問題,完美解決~~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章