Solve the problem of Docker starting Elasticsearch7.x and reporting an error

Solve the problem of Docker starting Elasticsearch7.x and reporting an error

Using the Docker run command

docker run -d -p 9200:9200 -p 9300:9300 --name User-defined name container ID

You will see a string of characters. Generally, we will mistakenly think that it has started successfully.

We executed docker ps -a and found that it exited automatically

Use docker logs -f container ID to view the logs and find:

ERROR: [1] bootstrap checks failed

[1]: max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

Error message

It tells us that ES requires too much jvm memory, so we need to change the configuration and execute the following code

sysctl -w vm.max_map_count=262144

Then enter the following command to run it:

docker run -d -e ES_JAVA_POTS="-Xms256m -Xmx256m" -p 9200:9200 -p 9300:9300 --name ES3 8f46db60ddd6

Check the log and find that there is still an error:

ERROR: [1] bootstrap checks failed

[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

The solution is as follows:

docker run -d -e ES_JAVA_POTS="-Xms256m -Xmx256m" -e "discovery.type=single-node" -p 9200:9200 -p

:9300 --name ES3 8f46db60ddd6

Finally it started successfully!

Additional knowledge: Docker installation of elasticsearch 6.4.3 stop

Print the log first

docker logs 9dcea100677b

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-11-15T07:22:07,906][INFO ][oenNode ] [] initializing ...
[2019-11-15T07:22:08,101][INFO ][oeeNodeEnvironment ] [d37UOiC] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [33.4gb], net total_space [39.2gb], types [rootfs]
[2019-11-15T07:22:08,102][INFO ][oeeNodeEnvironment ] [d37UOiC] heap size [503.6mb], compressed ordinary object pointers [true]
[2019-11-15T07:22:08,111][INFO ][oenNode ] [d37UOiC] node name derived from node ID [d37UOiCyRQyKTBz5CfI0HQ]; set [node.name] to override
[2019-11-15T07:22:08,111][INFO ][oenNode ] [d37UOiC] version[6.4.3], pid[1], build[default/tar/fe40335/2018-10-30T23:17:19.084789Z], OS[Linux/3.10.0-1062.1.2.el7.x86_64/amd64], JVM["Oracle Corporation"/OpenJDK 64-Bit Server VM/10.0.2/10.0.2+13]
[2019-11-15T07:22:08,111][INFO ][oenNode ] [d37UOiC] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -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, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.e3MyuoEc, -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, -Djava.locale.providers=COMPAT, -XX:UseAVX=2, -Des.cgroups.hierarchy.override=/, -Xms512m, -Xmx512m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2019-11-15T07:22:11,943][INFO ][oepPluginsService ] [d37UOiC] loaded module [aggs-matrix-stats]
[2019-11-15T07:22:11,944][INFO ][oepPluginsService ] [d37UOiC] loaded module [analysis-common]
[2019-11-15T07:22:11,944][INFO ][oepPluginsService ] [d37UOiC] loaded module [ingest-common]
[2019-11-15T07:22:11,944][INFO ][oepPluginsService ] [d37UOiC] loaded module [lang-expression]
[2019-11-15T07:22:11,944][INFO ][oepPluginsService ] [d37UOiC] loaded module [lang-mustache]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [lang-painless]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [mapper-extras]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [parent-join]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [percolator]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [rank-eval]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [reindex]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [repository-url]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [transport-netty4]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [tribe]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-core]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-deprecation]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-graph]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-logstash]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-ml]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-monitoring]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-rollup]
[2019-11-15T07:22:11,945][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-security]
[2019-11-15T07:22:11,946][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-sql]
[2019-11-15T07:22:11,946][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-upgrade]
[2019-11-15T07:22:11,946][INFO ][oepPluginsService ] [d37UOiC] loaded module [x-pack-watcher]
[2019-11-15T07:22:11,946][INFO ][oepPluginsService ] [d37UOiC] loaded plugin [ingest-geoip]
[2019-11-15T07:22:11,946][INFO ][oepPluginsService ] [d37UOiC] loaded plugin [ingest-user-agent]
[2019-11-15T07:22:17,086][WARN ][oedsScriptModule ] Script: returning default values ​​for missing document values ​​is deprecated. Set system property '-Des.scripting.exception_for_missing_value=true' to make behaviour compatible with future major versions.
[2019-11-15T07:22:23,590][INFO ][oexsasFileRolesStore] [d37UOiC] parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]
[2019-11-15T07:22:24,507][INFO ][oexmjplCppLogMessageHandler] [controller/62] [Main.cc@109] controller (64 bit): Version 6.4.3 (Build 7a0781676dd492) Copyright (c) 2018 Elasticsearch BV
[2019-11-15T07:22:26,142][INFO ][oedDiscoveryModule ] [d37UOiC] using discovery type [zen]
[2019-11-15T07:22:28,041][INFO ][oenNode ] [d37UOiC] initialized
[2019-11-15T07:22:28,041][INFO ][oenNode ] [d37UOiC] starting ...
[2019-11-15T07:22:28,297][INFO ][oetTransportService ] [d37UOiC] publish_address {172.18.0.2:9300}, bound_addresses {[::]:9300}
[2019-11-15T07:22:28,350][INFO ][oebBootstrapChecks ] [d37UOiC] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-11-15T07:22:28,406][INFO ][oenNode ] [d37UOiC] stopping ...
[2019-11-15T07:22:28,423][INFO ][oenNode ] [d37UOiC] stopped
[2019-11-15T07:22:28,423][INFO ][oenNode ] [d37UOiC] closing ...
[2019-11-15T07:22:28,457][INFO ][oenNode ] [d37UOiC] closed
[2019-11-15T07:22:28,460][INFO ][oexmjpNativeController] Native controller process has stopped - no new native processes can be started

I think there should be something wrong with the jvm parameter configuration.

First

[root@iZ2ze9gna8ev4h0rme8ph0Z ~]# sudo sysctl -w vm.max_map_count=262144

Again

docker run -d -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e -Des.scripting.exception_for_missing_value=true --name elasticsearch docker.io/elasticsearch:6.4.3

It can be solved!

The above article on solving the problem of Docker starting Elasticsearch7.x reporting an error is all the content that the editor shares with you. I hope it can give you a reference, and I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Solve the problem that Elasticsearch fails to start due to jdk version problems
  • Docker starts the elasticsearch image and solves the error after mounting the directory
  • Insufficient memory problem and solution when docker starts elasticsearch
  • elasticsearch startup warning unable to lock JVM memory
  • Elasticsearch injects Node assembly startup process through guice

<<:  Pure CSS implementation (no script) Html command-style tooltip text prompt effect

>>:  Detailed description of the life cycle of React components

Recommend

In-depth explanation of Vue multi-select list component

A Multi-Select is a UI element that lists all opt...

MySQL database master-slave configuration tutorial under Windows

The detailed process of configuring the MySQL dat...

Sample code for displaying a scroll bar after the HTML page is zoomed out

Here is a record of how to make a scroll bar appe...

Solve the problem of black screen when starting VMware virtual machine

# Adjust VMware hard disk boot priority Step 1: E...

Detailed explanation of Vue's keyboard events

Table of contents Common key aliases Key without ...

Steps to package and release the Vue project

Table of contents 1. Transition from development ...

How to execute Linux shell commands in Docker

To execute a shell command in Docker, you need to...

CSS and HTML and front-end technology layer diagram

Front-end technology layer (The picture is a bit e...

MySQL database deletes duplicate data and only retains one method instance

1. Problem introduction Assume a scenario where a...

Summary of the differences between get and post requests in Vue

The operating environment of this tutorial: Windo...

The meaning of the 5 types of spaces in HTML

HTML provides five space entities with different ...

Idea configures tomcat to start a web project graphic tutorial

Configure tomcat 1. Click run configuration 2. Se...

How to check if the firewall is turned off in Linux

1. Service method Check the firewall status: [roo...