我试图在docker swarm上部署ELK堆栈。
如果我将弹性数据目录绑定到Docker卷,则没有问题。
一旦我尝试将elstastic数据目录绑定到glusterFS卷,就会出现问题。 我使用glusterFS来同步集群中所有swarm节点之间的数据。 我使用以下代码部署ELK:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.3
# container_name: elasticsearch
environment:
- "http.host=0.0.0.0"
- "transport.host=127.0.0.1"
- "ELASTIC_PASSWORD=changeme"
- "TAKE_FILE_OWNERSHIP=1"
ports: ['127.0.0.1:9200:9200']
volumes:
- /opt/dockershared/stack-elk/elk:/usr/share/elasticsearch/data
networks: ['stack']
dir' / opt / dockershared /'是一个glusterFS卷:
myhost:/ opt / dockershared类型的/ gvol0类型fuse.glusterfs(rw,relatime,user_id = 0,group_id = 0,default_permissions,allow_other,max_read = 131072,_netdev)
ELK堆栈启动没有问题,但是在30/60分钟后,分片的分配失败。 在ELK日志中,我看到以下例外情况:
[2018-04-13T08:58:16,749] [WARN] [o.e..e.e.Engine] [MPxFOvC] [metricbeat-6.2.3-2018.04.13] [0]引擎失败[刷新失败的来源[schedule]] org.apache.lucene.index.CorruptIndexException:从商店读取索引的问题(MMapDirectory @ / usr / share / elasticsearch / data / nodes / 0 / indices / fRcersH4RjecZ8AKb3WZTQ / 0 / index lockFactory = org.apache.lucene.store.NativeFSLockFactory @ 73620ce7)(resource = store(MMapDirectory @ / usr / share / elasticsearch / data / nodes / 0 / indices / fRcersH4RjecZ8AKb3WZTQ / 0 / index lockFactory=org.apache.lucene.store.NativeFSLockFactory@73620ce7)) 在org.apache.lucene.index.SegmentCoreReaders。(SegmentCoreReaders.java:140)〜[lucene-core-7.2.1.jar:7.2.1 b2b6438b37073bee1fca40374e85bf91aa457c0b - ubuntu - 2018-01-10 00:48:43] ...... 引起:java.io.EOFException:读取过去的EOF:MMapIndexInput(path =" /usr/share/elasticsearch/data/nodes/0/indices/fRcersH4RjecZ8AKb3WZTQ/0/index/_47.cfe") 在org.apache.lucene.store.ByteBufferIndexInput.readByte(ByteBufferIndexInput.java:75)〜[lucene-core-7.2.1.jar:7.2.1 b2b6438b37073bee1fca40374e85bf91aa457c0b - ubuntu - 2018-01-10 00:48:43] ...... 抑制:org.apache.lucene.index.CorruptIndexException:checksum status indeterminate:remaining = 0,请运行checkindex以获取更多详细信息(resource = BufferedChecksumIndexInput(MMapIndexInput(path =" / usr / share / elasticsearch / data / nodes / 0 /索引/ fRcersH4RjecZ8AKb3WZTQ / 0 /索引/ _47.cfe"))) .....
可能是什么问题? 在所有群集节点之间共享弹性数据目录的最佳解决方案是什么?
谢谢