有个人长的像洋葱,走着走着就哭了…….

每20分钟节点会掉线一次。

Elasticsearch | 作者 famoss | 发布于2018年05月07日 | 阅读数:4977

我用k8s部署了es,今天发现不同集群都有节点在规律得掉线。
都是每20分钟掉线一次,然后瞬间又加进集群,其中没任何报错。
各个节点都没做gc,没有大任务,没触发gc掉线。
 
k8s集群已运行半年,使用的flannel组建的内网。
es5.2.2
docker 17.04.0-ce
使用的https://github.com/fabric8io/e ... netes插件去发现集群
日志已截图。
 
不同集群掉线节点都是每20分钟一次,请问es或者某个组件有每20分钟触发一次的任务么。
 
EDIT:
监控了一次,master left 的时候,其实能ping通。如图。

 
k8s掉线.png masterleft.png ping.png
已邀请:

famoss

赞同来自: rockybean ybtsdst

最后原因是因为我k8s flannel搭建的内网选用的ip xxx.xx 跟真实线上的ip段冲突了。当天改过iptables策略,正好触发了问题。

排查步骤:
翻看es源码,尝试查找原因。
    org.elasticsearch.discovery.zen.MasterFaultDetection

int retryCount = ++MasterFaultDetection.this.retryCount;
logger.trace(
(Supplier<?>) () -> new ParameterizedMessage(
"[master] failed to ping [{}], retry [{}] out of [{}]",
masterNode,
retryCount,
pingRetryCount),
exp);
if (retryCount >= pingRetryCount) {
logger.debug("[master] failed to ping [{}], tried [{}] times, each with maximum [{}] timeout",
masterNode, pingRetryCount, pingRetryTimeout);
// not good, failure
notifyMasterFailure(masterToPing, null, "failed to ping, tried [" + pingRetryCount
+ "] times, each with maximum [" + pingRetryTimeout + "] timeout");
} else {
// resend the request, not reschedule, rely on send timeout
transportService.sendRequest(masterToPing, MASTER_PING_ACTION_NAME, request, options, this);
}

没能看出什么猫腻,不过,发现了这段,记录了一段trace日志
    logger.trace(
(Supplier<?>) () -> new ParameterizedMessage(
"[master] failed to ping [{}], retry [{}] out of [{}]",
masterNode,
retryCount,
pingRetryCount),
exp);
所以调用es的接口更改日志级别,改为trace
{
"transient": {
"logger.org.elasticsearch.discovery": "trace"
}
}

正好20分钟后打印出了日志
[internal:discovery/zen/fd/master_ping] Caused by: java.lang.IllegalStateException
 
找到一个类似的issue,然后猜测到时防火墙问题,最后搞定。

rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk

赞同来自:

据我所知是没有这种每20分钟1次的任务的,es 集群有加监控吗?可以观察下 heap 等是否有规律性的增长

zqc0512 - andy zhou

赞同来自:

ES docker就是坑  按照我了解快不了多少,有机器的话建议直接搞……

要回复问题请先登录注册