1. 程式人生 > >spark/java連線 kudu incompatible RPC? Error is: step 異常解決

spark/java連線 kudu incompatible RPC? Error is: step 異常解決

如果是新搭的CDH 叢集並使用預設的kudu設定, 使用spark /java 連線kudu時候,一般都會碰到此類異常。

程式:

  val masteraddr = "kudumasterip:7051"

//建立kudu的資料庫連結
val client = new KuduClient.KuduClientBuilder(masteraddr).build

//開啟表
val table = client.openTable("impala::testdb.PERSON")

異常資訊:

java.lang.RuntimeException: Could not deserialize the response, incompatible RPC? Error is: step
at org.apache.kudu.client.KuduRpc.readProtobuf(KuduRpc.java:383)
at org.apache.kudu.client.Negotiator.parseSaslMsgResponse(Negotiator.java:282)
at org.apache.kudu.client.Negotiator.handleResponse(Negotiator.java:235)
at org.apache.kudu.client.Negotiator.messageReceived(Negotiator.java:229)
at org.apache.kudu.client.shaded.org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.apache.kudu.client.shaded.org.jboss.netty.handler.timeout.ReadTimeoutHandler.messageReceived(ReadTimeoutHandler.java:184)
at org.apache.kudu.client.shaded.org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)

解決方法:

在CDH 頁面上設定kudu 高階配置項:

-rpc_encryption=disabled
-rpc_authentication=disabled
-trusted_subnets=0.0.0.0/0