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

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" }

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

Ah. Schoolboy error.

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

1 Like

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

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

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.

Oh ok. How would I have done that?

It's not clear how you're starting Elasticsearch, but the instructions 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.

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