The elasticsearch docker image is wiping my index when I stop and start the docker container

This is supposed to be a single instance, not a cluster. I've installed the
icu-analyzer and head plugin.
I run the container like this:

sudo docker run -it -p 9200:9200 -p 9300:9300 -v /esdata:/data --name
my_elasticsearch olavgg/elasticsearch /elasticsearch/bin/elasticsearch
-Des.config=/elasticsearch/config/elasticsearch.yml

The elasticsearch.yml looks like this

path:
data: /data/data
logs: /data/log
plugins: /data/plugins
work: /data/work

cluster:
name: olav

node:
name: thenode

http.cors.allow-origin: "/.*/"
http.cors.enabled: true

Then I create a new index with following settings:

settingsBuilder.put("number_of_shards", 20);
settingsBuilder.put("number_of_replicas", 0);
settingsBuilder.put("refresh_interval", "1s");
settingsBuilder.put("store.type", "niofs");
settingsBuilder.put("store.compress.stored", true);
settingsBuilder.put("store.compress.tv", true);
settingsBuilder.put("gateway.type", "none");
settingsBuilder.put(
"analysis.analyzer.norwegianAnalyzer.type",
"custom");
settingsBuilder.put(
"analysis.analyzer.norwegianAnalyzer.tokenizer",
"keyword");
settingsBuilder.put(
"analysis.analyzer.norwegianAnalyzer.filter",
"norwegian");
settingsBuilder.put(
"analysis.filter.norwegian.type",
"icu_collation");
settingsBuilder.put(
"analysis.filter.norwegian.language",
"nb");

Then I fill the index with data and see that /esdata folder grows in size.

If I stop the elasticsearch container(sudo docker stop my_elasticsearch),
the size in the /esdata folder is still the same.

But when I start the container again (sudo docker start my_elasticsearch)
it wipes all the data in my index and the /esdata folder size decreases to
almost 0

And I only find this in the log:
[2015-01-31 15:07:17,655][INFO ][discovery ] [thenode]
olav/NbcqLoztTV2GWsat8hLXeQ
[2015-01-31 15:07:21,457][INFO ][cluster.service ] [thenode]
new_master
[thenode][NbcqLoztTV2GWsat8hLXeQ][8a166697b5d5][inet[/172.17.0.22:9300]],
reason: zen-disco-join (elected_as_master)
[2015-01-31 15:07:21,510][INFO ][http ] [thenode]
bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address
{inet[/172.17.0.22:9200]}
[2015-01-31 15:07:21,511][INFO ][node ] [thenode]
started
[2015-01-31 15:07:22,611][INFO ][discovery.zen ] [thenode]
updating discovery.zen.minimum_master_nodes from [-1] to [1]
[2015-01-31 15:07:22,692][INFO ][gateway ] [thenode]
recovered [1] indices into cluster_state

I guess I've misconfigured something? Is the new_master in the log causing
this?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/981dd976-8c82-4460-a9be-7da022c98ac2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ES does not wipe anything on restart, I'd say it's something in your Docker
config.

On 1 February 2015 at 02:34, Olav Grønås Gjerde olavgg@gmail.com wrote:

This is supposed to be a single instance, not a cluster. I've installed
the icu-analyzer and head plugin.
I run the container like this:

sudo docker run -it -p 9200:9200 -p 9300:9300 -v /esdata:/data --name
my_elasticsearch olavgg/elasticsearch /elasticsearch/bin/elasticsearch
-Des.config=/elasticsearch/config/elasticsearch.yml

The elasticsearch.yml looks like this

path:
data: /data/data
logs: /data/log
plugins: /data/plugins
work: /data/work

cluster:
name: olav

node:
name: thenode

http.cors.allow-origin: "/.*/"
http.cors.enabled: true

Then I create a new index with following settings:

settingsBuilder.put("number_of_shards", 20);
settingsBuilder.put("number_of_replicas", 0);
settingsBuilder.put("refresh_interval", "1s");
settingsBuilder.put("store.type", "niofs");
settingsBuilder.put("store.compress.stored", true);
settingsBuilder.put("store.compress.tv", true);
settingsBuilder.put("gateway.type", "none");
settingsBuilder.put(
"analysis.analyzer.norwegianAnalyzer.type",
"custom");
settingsBuilder.put(
"analysis.analyzer.norwegianAnalyzer.tokenizer",
"keyword");
settingsBuilder.put(
"analysis.analyzer.norwegianAnalyzer.filter",
"norwegian");
settingsBuilder.put(
"analysis.filter.norwegian.type",
"icu_collation");
settingsBuilder.put(
"analysis.filter.norwegian.language",
"nb");

Then I fill the index with data and see that /esdata folder grows in size.

If I stop the elasticsearch container(sudo docker stop my_elasticsearch),
the size in the /esdata folder is still the same.

But when I start the container again (sudo docker start my_elasticsearch)
it wipes all the data in my index and the /esdata folder size decreases to
almost 0

And I only find this in the log:
[2015-01-31 15:07:17,655][INFO ][discovery ] [thenode]
olav/NbcqLoztTV2GWsat8hLXeQ
[2015-01-31 15:07:21,457][INFO ][cluster.service ] [thenode]
new_master
[thenode][NbcqLoztTV2GWsat8hLXeQ][8a166697b5d5][inet[/172.17.0.22:9300]],
reason: zen-disco-join (elected_as_master)
[2015-01-31 15:07:21,510][INFO ][http ] [thenode]
bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/
172.17.0.22:9200]}
[2015-01-31 15:07:21,511][INFO ][node ] [thenode]
started
[2015-01-31 15:07:22,611][INFO ][discovery.zen ] [thenode]
updating discovery.zen.minimum_master_nodes from [-1] to [1]
[2015-01-31 15:07:22,692][INFO ][gateway ] [thenode]
recovered [1] indices into cluster_state

I guess I've misconfigured something? Is the new_master in the log
causing this?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/981dd976-8c82-4460-a9be-7da022c98ac2%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/981dd976-8c82-4460-a9be-7da022c98ac2%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-hvq_5mdEp8WogTV7P5EAs%3DAQProfvhiCc0byXroAcvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I found the problem

settingsBuilder.put("gateway.type", "none");

This should be set to local:

settingsBuilder.put("gateway.type", "local");

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/508f0b42-bfc2-4d58-a19f-0e7e3201f26f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Please mark as completed.

On Sunday, 1 February 2015 06:16:16 UTC, Olav Grønås Gjerde wrote:

I found the problem

settingsBuilder.put("gateway.type", "none");

This should be set to local:

settingsBuilder.put("gateway.type", "local");

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/42c4a6fa-c016-419c-86a0-aafb27369932%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.