看,灰机...

5.1.1 java api event executor terminated

Elasticsearch | 作者 chenbin | 发布于2017年05月16日 | 阅读数:14956

运行一段时间后,就会出现如下错误:
2017-05-16 00:00:08,668 [elasticsearch[_client_][generic][T#6]] ERROR io.netty.util.concurrent.DefaultPromise.rejectedExecution - Failed to submit a listener notification task. Event loop shut down?
java.util.concurrent.RejectedExecutionException: event executor terminated
at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:836)
at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:342)
at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:335)
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:761)
at io.netty.util.concurrent.DefaultPromise.safeExecute(DefaultPromise.java:767)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:435)
at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:120)
at io.netty.channel.DefaultChannelPromise.setFailure(DefaultChannelPromise.java:87)
at io.netty.channel.AbstractChannelHandlerContext.safeExecute(AbstractChannelHandlerContext.java:1021)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:836)
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:805)
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:842)
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032)
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296)
at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:449)
at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:91)
at org.elasticsearch.transport.TcpTransport$ScheduledPing.doRunInLifecycle(TcpTransport.java:261)
at org.elasticsearch.common.util.concurrent.AbstractLifecycleRunnable.doRun(AbstractLifecycleRunnable.java:67)
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
已邀请:

chenbin

赞同来自:

求大神解答.......

medcl - 今晚打老虎。

赞同来自:

麻烦把该问题的上下文相关信息再完善一下

chenbin

赞同来自:

 
获取TransportClient客户端
private TransportClient initClient() {
Settings settings = Settings.builder().put(_CLUSTER_NAME, clusterName)//指定集群名字
.put(_CLIENT_TRANSPORT_SNIFF, true)//启动嗅探功能
.put(_CLIENT_TRANSPORT_PING_TIMEOUT, "120s")
.build();
//es url 转换
List<Address> addresses = new ArrayList<>();
Splitter.on(";").splitToList(url).forEach(e -> {
List<String> ads = Splitter.on(":").splitToList(e);
try {
Address ad = new Address(InetAddress.getByName(ads.get(0)), Integer.parseInt(ads.get(1)));
addresses.add(ad);
} catch (UnknownHostException e1) {
}
});
if (!addresses.isEmpty()) {
//设置一个就可以了
client = new PreBuiltTransportClient(settings);
for (Address a : addresses) {
client.addTransportAddress(new InetSocketTransportAddress(a.getIP(), a.getPort()));
}
return client;
} else {
return null;
}
}

chenbin

赞同来自:

操作ES
UpdateByQueryAction.INSTANCE.newRequestBuilder(client).source(command.getIndex())
.filter(command.getQueryBuilder())
.refresh(true)
.script(command.getScriptl())
.execute(new ActionListener<BulkIndexByScrollResponse>() {
@Override
public void onResponse(BulkIndexByScrollResponse response) {

}

@Override
public void onFailure(Exception e) {

}
});

xiao

赞同来自:

你好,请问你的es日志里出现这样的错误日志时,系统的CPU会特别高吗

要回复问题请先登录注册