I'm not sure, if running elastic on Docker on Windows Server 2019 is a recommended setup.
But that's what I have and so far it was working very stable.
Today, I upgraded Docker to 2.2.0, and Elastic fails to start. Here is an error:
"stacktrace": ["org.apache.lucene.store.AlreadyClosedException: Underlying file changed by an external force at 1970-01-01T00:00:00Z, (lock=NativeFSLock(path=/usr/share/elasticsearch/data/nodes/0/indices/5NN-qYSZSCyohxYdnoZTXg/0/index/write.l ock,impl=sun.nio.ch.FileLockImpl...
Looks like Docker changed, how it mounts storage in Windows:
And that breaks existing Elastic installation.
I uninstalled Docker 2.2.0, installed 2.1.0 and got my elastic back. No data loss.
If you install elastic from scratch, may be it will work with Docker 2.2.0. Looks like upgrade is breaking it for sure.
Here is my Elastic Docker definition:
version: '3.4'
services:
elasticsearch:
build:
context: elasticsearch/
args:
ELK_VERSION: 7.5.0
volumes:
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- C:\Users\slavik\code\elk-docker\storage:/usr/share/elasticsearch/data
ports:
- "9200:9200"
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
bootstrap.memory_lock: "true"
ulimits:
memlock:
soft: -1
hard: -1