简体   繁体   English

在Docker中将Elasticsearch集群从2.x升级到5.x时表示红色/悬空

[英]Indices Red/Dangling when upgrading Elasticsearch cluster from 2.x to 5.x in docker

I manage a small ELK stack which resides on one docker host with a 3 node elasticsearch cluster, a master, a client node, and a data node each running elasticsearch 2.4.x. 我管理一个小的ELK堆栈,该堆栈位于一个Docker主机上,该主机具有3个节点的Elasticsearch群集,一个主节点,一个客户端节点和一个数据节点,每个节点都运行Elasticsearch2.4.x。 Each of these nodes had the same host directory bind mounted as the elasticsearch data directory even though only the data node needed it. 这些节点中的每个节点都安装了与elasticsearch数据目录相同的主机目录绑定,即使只有数据节点也需要它。

While testing the upgrade path to 5.x I was running into a very strange issue. 在测试到5.x的升级路径时,我遇到了一个非常奇怪的问题。 The cluster would come back up, but would not initialize any of the 2.x created indices, throwing errors: 群集将恢复,但不会初始化任何2.x创建的索引,从而引发错误:

[oegDanglingIndicesState] [elastic-data] [[logstash-2017.02.01/pBco8d7dQAqmZoI37vUIOQ]] dangling index exists on local file system, but not in cluster metadata, auto import to cluster state

The indices would never initialize and remain red. 索引永远不会初始化并保持红色。 The stack would create new indices fine and if I deleted these indices the system would work perfectly fine, but that data loss is definitely sub-optimal if I was going to do this on a production system. 堆栈可以很好地创建新索引,如果删除这些索引,则系统可以正常运行,但是如果我要在生产系统上执行此操作,则数据丢失肯定不是最佳选择。

The fact the the master and client nodes had been mounting the data directory turned out to be the cause of this issue. 主节点和客户端节点已装入数据目录的事实原来是导致此问题的原因。 Elasticsearch 5.x enforces a default limit of 1 node to a data directory and while the master and client 2.x nodes had not been actively data managing, they had affected the folder structuring. Elasticsearch 5.x对数据目录强制默认限制为1个节点,而主节点和客户端2.x节点尚未进行主动数据管理,但它们影响了文件夹的结构。 I was able to get a clean upgrade with all green indices by first removing the bind mounts from master and client on the 2.x cluster and letting that sort itself out, then upgrading to 5.x. 通过首先从2.x群集上的主服务器和客户端上删除绑定安装并自行进行排序,然后再升级到5.x,我能够对所有绿色索引进行干净的升级。 Hope this helps anybody else who runs into this issue. 希望这对遇到此问题的其他人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM