在我使用spark對接kudu的過程中,出現如下錯誤:
坑1: Caused by: org.apache.kudu.client.NoLeaderFoundException
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
最后,問題,完美解決~~
坑2: Caused by: java.lang.IllegalArgumentException: cannot import authentication data from a different user: old=’’, new=‘liuge’
最終解決:
[root@spark001 conf]# vim master.gflagfile
-rpc_encryption=disabled
-rpc_authentication=disabled
-trusted_subnets=0.0.0.0/0
# 重啟master server
[root@spark001 conf]# /etc/init.d/kudu-master restart
Stopped Kudu Master Server: [ OK ]
Started Kudu Master Server (kudu-master): [ OK ]
[root@spark001 conf]#
坑3:Exception in thread “main” org.apache.kudu.client.NonRecoverableException: can not complete before timeout: KuduRpc
我一開始對於這個錯誤,還真的是很納悶。各種搜索解決,都無果,
后來,我嘗試把tserver.gflagfile 也添加如上配置就可以了
[root@spark001 conf]# vim tserver.gflagfile
-rpc_encryption=disabled
-rpc_authentication=disabled
-trusted_subnets=0.0.0.0/0
# 重啟master server
[root@spark001 conf]# /etc/init.d/kudu-master restart
Stopped Kudu Master Server: [ OK ]
Started Kudu Master Server (kudu-master): [ OK ]
[root@spark001 conf]#