I'm using elasticsearch docker containers for my nodes.
I began experimenting with Scripts, and needed to add a volume. Here's what my docker-compose now contains
elasticsearch: build: elasticsearch/ container_name: elasticsearch volumes: - ./elasticsearch/config/elasticsearch.yml:/conf/elasticsearch.yml - ./elasticsearch/config/scripts:/conf/scripts - /data/elasticsearch:/usr/share/elasticsearch/data:rw environment: ES_JAVA_OPTS: "-Xmx4g -Xms4g" TYPE: MASTER UNICAST_HOSTS: elasticsearch,elasticsearch_3,elasticsearch_2,elasticsearch_4,elasticsearch_1 MIN_MASTERS: 1 PLUGINS: x-pack networks: - elk restart: always
Using data volumes, my belief was I could update the docker containers without losing data. After adding the scripts folder, compose re-created the containers, and now my shards have gone missing.
I can still see the data in the folder (/data/elasticsearch1/nodes/0/, 130gb), but my shards have reset and elasticsearch is not using my previous data.
Is there a way to tell elasticsearch to rescan the data directory and re-allocate those shards from before? Or am I using the data volume incorrectly?