我创建了一个包含2个节点的ES群集。其中一个节点配置为主节点,另一个节点配置为客户端节点。主节点具有完全构建的索引。
当我在其余客户端上运行以下内容时
http://localhost:9200/_cluster/health
,
我收到以下回复
{
"cluster_name": "827d89539ac6ae688c1a84b9a7076b33",
"status": "green",
"timed_out": false,
"number_of_nodes": 2,
"number_of_data_nodes": 1,
"active_primary_shards": 4,
"active_shards": 4,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0
}
这表明客户端节点已加入群集。
我能够从主节点进行搜索和索引。但是在尝试从客户端节点搜索时,我得到以下异常。
Caused by: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query_fetch], all shards failed; shardFailures {[FI4lBsqZSne3MzDY5QLDvw][rule][0]: RemoteTransportException[Failed to deserialize response of type [org.elasticsearch.search.fetch.QueryFetchSearchResult]]; nested: TransportSerializationException[Failed to deserialize response of type [org.elasticsearch.search.fetch.QueryFetchSearchResult]]; nested: IOException[Expected handle header, got [90]]; }
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:272)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:224)
at org.elasticsearch.search.action.SearchServiceTransportAction$7.handleException(SearchServiceTransportAction.java:324)
at org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:181)
at org.elasticsearch.transport.netty.MessageChannelHandler.handleResponse(MessageChannelHandler.java:148)
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我用来连接主节点的设置是
ImmutableSettings.Builder settingsBuilder = ImmutableSettings.settingsBuilder()
//.classLoader(getClass().getClassLoader()) // set the class loader to PRAppLoader
.put("cluster.name", "827d89539ac6ae688c1a84b9a7076b33")
.put("node.name", "wkoduyw7hyd")
.put("node.master", false)
.put("node.data", false)
.put("action.auto_create_index", false) // disable automatic index creation
.put("script.disable_dynamic", true) // disable dynamic scripts
.put("script.auto_reload_enabled" , false) // disable script reloading
.put("path.data", "H:\\WorkSpace\\LunaSprintWorks_Trunc\\miniboot-embedded\\local_8084\\Tomcat\\work\\Catalina\\localhost\\prweb\\PegaSearchIndex")
;
settingsBuilder.put("discovery.zen.ping.multicast.enabled", true);
settingsBuilder.put("threadpool.index.size", 1);
settingsBuilder.put("threadpool.search.size", 1);
settingsBuilder.put("threadpool.bulk.size", 1);
settingsBuilder.put("threadpool.suggest.size", 1);
settingsBuilder.put("threadpool.get.size", 1);
settingsBuilder.put("threadpool.percolate.size", 1);
settingsBuilder.put("transport.netty.worker_count", 2);
settingsBuilder.put("http.netty.worker_count", 1);
我在客户端节点中执行的搜索查询在其余客户端上正常工作。
我从queryBuilders构造的查询是
{
"query" : {
"filtered" : {
"query" : {
"query_string" : {
"query" : "pxRetrieveReportData",
"default_field" : "_instancename",
"default_operator" : "and",
"allow_leading_wildcard" : true,
"analyze_wildcard" : true
}
},
"filter" : {
"fquery" : {
"query" : {
"query_string" : {
"query" : "NOT _isexternal:true",
"default_field" : "_instancename",
"default_operator" : "and",
"allow_leading_wildcard" : true
}
},
"_cache" : false
}
}
}
},
"fields" : "*"
}

您能告诉我们在哪些情况下我们会遇到此异常吗?
我在两个节点中使用相同版本的elasticsearch jar。
答案 0 :(得分:0)
该异常是可能在客户端和群集之间使用混合Elasticsearch版本的标志。