# Setting up Elasticsearch with Docker on local machine - Container stops and throws error

**URL:** https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954
**Category:** Elasticsearch
**Tags:** docker
**Created:** [February 19, 2020, 11:44am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954 "2020-02-19T11:44:39Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![bvelastic](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvelastic](https://discuss.elastic.co/u/bvelastic)
#### Post date: [February 19, 2020, 11:44am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/1 "2020-02-19T11:44:39Z")

</div>

Hello,

I am new to elastic search and docker and I want to setup up ELK using Docker on my laptop only to play around.  
I am followed the instructions on the Elastic documentation but I am receiving an error when I try and start the Elasticsearch container.

Can you please help me in where I am going wrong.

Thanks

"... 6 more"] }  
uncaught exception in thread [main]  
java.lang.IllegalArgumentException: Unknown discovery type [singlenode]  
at org.elasticsearch.discovery.DiscoveryModule.(DiscoveryModule.java:161)  
at org.elasticsearch.node.Node.(Node.java:514)  
at org.elasticsearch.node.Node.(Node.java:257)  
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:221)  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221)  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349)  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)  
at org.elasticsearch.cli.Command.main(Command.java:90)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)  
For complete error details, refer to the log at /usr/share/elasticsearch/logs/docker-cluster.log  
{"type": "server", "timestamp": "2020-02-19T10:35:40,059Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "Native controller process has stopped - no new native processes can be started" }  
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.  
{"type": "server", "timestamp": "2020-02-19T11:04:59,449Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "using [1] data paths, mounts [[/ (overlay)]], net usable\_space [50.4gb], net total\_space [58.4gb], types [overlay]" }  
{"type": "server", "timestamp": "2020-02-19T11:04:59,459Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "heap size [1007.3mb], compressed ordinary object pointers [true]" }  
{"type": "server", "timestamp": "2020-02-19T11:04:59,587Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "node name [abc9cbcb63fa], node ID [l0pt-Q1rSZCBjj4VFVgIaw], cluster name [docker-cluster]" }  
{"type": "server", "timestamp": "2020-02-19T11:04:59,588Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "version[7.6.0], pid[1], build[default/docker/7f634e9f44834fbc12724506cc1da681b0c3b1e3/2020-02-06T00:09:00.449973Z], OS[Linux/4.19.76-linuxkit/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/13.0.2/13.0.2+8]" }  
{"type": "server", "timestamp": "2020-02-19T11:04:59,588Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "JVM home [/usr/share/elasticsearch/jdk]" }  
{"type": "server", "timestamp": "2020-02-19T11:04:59,588Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=COMPAT, -Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/elasticsearch-11982210769806827367, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs\_err\_pid%p.log, -Xlog:gc\*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Des.cgroups.hierarchy.override=/, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=docker, -Des.bundled\_jdk=true]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,097Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [aggs-matrix-stats]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,100Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [analysis-common]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,100Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [flattened]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,100Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [frozen-indices]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,101Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [ingest-common]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,101Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [ingest-geoip]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,101Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [ingest-user-agent]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,101Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [lang-expression]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,101Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [lang-mustache]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,101Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [lang-painless]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,102Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [mapper-extras]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,102Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [parent-join]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,102Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [percolator]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,102Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [rank-eval]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,102Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [reindex]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,105Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [repository-url]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,105Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [search-business-rules]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,105Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [spatial]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,105Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [transform]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,106Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [transport-netty4]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,106Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [vectors]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,106Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-analytics]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,106Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-ccr]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,106Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-core]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,108Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-deprecation]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,108Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-enrich]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,108Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-graph]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,109Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-ilm]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,109Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-logstash]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,109Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-ml]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,109Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-monitoring]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,109Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-rollup]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,109Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-security]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,112Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-sql]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,112Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-voting-only-node]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,112Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "loaded module [x-pack-watcher]" }  
{"type": "server", "timestamp": "2020-02-19T11:05:03,112Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "abc9cbcb63fa", "message": "no plugins loaded" }

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [February 19, 2020, 11:50am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/2 "2020-02-19T11:50:16Z")

</div>

> [@bvelastic](#):
>
> `Unknown discovery type [singlenode]`

It's spelled `single-node`, with a hyphen.

---

<div class="post-metadata">

### Author: ![bvelastic](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvelastic](https://discuss.elastic.co/u/bvelastic)
#### Post date: [February 19, 2020, 11:51am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/3 "2020-02-19T11:51:31Z")

</div>

Ah. Schoolboy error.

Can I change that or do I have to rebuild the container?

---

<div class="post-metadata">

### Author: ![bvelastic](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvelastic](https://discuss.elastic.co/u/bvelastic)
#### Post date: [February 19, 2020, 11:57am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/4 "2020-02-19T11:57:50Z")

</div>

No worries. I have deleted the container and rebuilding it again.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [February 19, 2020, 12:03pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/5 "2020-02-19T12:03:50Z")

</div>

Glad to hear it was just that - an easy thing to do 🙂

You should have been able to change it without deleting everything. IIRC for Docker it's passed in using an environment variable at startup, but in other circumstances it's read from a config file. In general you'll want to be able to change settings like this without starting again from scratch.

---

<div class="post-metadata">

### Author: ![bvelastic](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvelastic](https://discuss.elastic.co/u/bvelastic)
#### Post date: [February 19, 2020, 12:30pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/6 "2020-02-19T12:30:35Z")

</div>

Oh ok. How would I have done that?

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [February 19, 2020, 12:50pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/7 "2020-02-19T12:50:38Z")

</div>

It's not clear how you're starting Elasticsearch, but the [instructions](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-dev-mode) either pass `discovery.type` in on the command line to `docker run` or else include it in the `docker-compose.yml` file. You should be able to change either of these with a simple restart.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 18, 2020, 12:50pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-with-docker-on-local-machine-container-stops-and-throws-error/219954/8 "2020-03-18T12:50:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
