主頁(yè) > 知識(shí)庫(kù) > 解決Docker啟動(dòng)Elasticsearch7.x報(bào)錯(cuò)的問題

解決Docker啟動(dòng)Elasticsearch7.x報(bào)錯(cuò)的問題

熱門標(biāo)簽:電銷智能機(jī)器人試用 激光標(biāo)記地圖標(biāo)注 智能電銷機(jī)器人真的有用么 企業(yè)辦理400電話收費(fèi)標(biāo)準(zhǔn) 撫州市城區(qū)地圖標(biāo)注 百度地圖底圖標(biāo)注 高德地圖標(biāo)注足跡怎么打標(biāo) 中國(guó)地圖標(biāo)注上各個(gè)省 新鄉(xiāng)牧野400電話申請(qǐng)

使用Docker run 命令

docker run -d -p 9200:9200 -p 9300:9300 --name 用戶自定義名字 容器ID

會(huì)看到一串字符串,一般情況下我們會(huì)誤以為它啟動(dòng)成功

我們執(zhí)行docker ps -a是發(fā)現(xiàn)它自動(dòng)退出了

使用docker logs -f 容器ID 查看日志發(fā)現(xiàn):

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

錯(cuò)誤提示

告訴我們是ES需要jvm內(nèi)存太大了,所有我們需要改一下配置,執(zhí)行下面代碼

sysctl -w vm.max_map_count=262144

然后輸入下列命令運(yùn)行一下:

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

查看日志發(fā)現(xiàn)還是報(bào)錯(cuò):

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

解決方法如下:

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

:9300 --name ES3 8f46db60ddd6

最終就啟動(dòng)成功了!

補(bǔ)充知識(shí):docker安裝elasticsearch 6.4.3 停止

先打印日志

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 ][o.e.n.Node ] [] initializing ...
[2019-11-15T07:22:08,101][INFO ][o.e.e.NodeEnvironment ] [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 ][o.e.e.NodeEnvironment ] [d37UOiC] heap size [503.6mb], compressed ordinary object pointers [true]
[2019-11-15T07:22:08,111][INFO ][o.e.n.Node ] [d37UOiC] node name derived from node ID [d37UOiCyRQyKTBz5CfI0HQ]; set [node.name] to override
[2019-11-15T07:22:08,111][INFO ][o.e.n.Node ] [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 ][o.e.n.Node ] [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 ][o.e.p.PluginsService ] [d37UOiC] loaded module [aggs-matrix-stats]
[2019-11-15T07:22:11,944][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [analysis-common]
[2019-11-15T07:22:11,944][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [ingest-common]
[2019-11-15T07:22:11,944][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [lang-expression]
[2019-11-15T07:22:11,944][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [lang-mustache]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [lang-painless]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [mapper-extras]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [parent-join]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [percolator]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [rank-eval]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [reindex]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [repository-url]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [transport-netty4]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [tribe]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-core]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-deprecation]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-graph]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-logstash]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-ml]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-monitoring]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-rollup]
[2019-11-15T07:22:11,945][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-security]
[2019-11-15T07:22:11,946][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-sql]
[2019-11-15T07:22:11,946][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-upgrade]
[2019-11-15T07:22:11,946][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded module [x-pack-watcher]
[2019-11-15T07:22:11,946][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded plugin [ingest-geoip]
[2019-11-15T07:22:11,946][INFO ][o.e.p.PluginsService ] [d37UOiC] loaded plugin [ingest-user-agent]
[2019-11-15T07:22:17,086][WARN ][o.e.d.s.ScriptModule ] 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 ][o.e.x.s.a.s.FileRolesStore] [d37UOiC] parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]
[2019-11-15T07:22:24,507][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [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 ][o.e.d.DiscoveryModule ] [d37UOiC] using discovery type [zen]
[2019-11-15T07:22:28,041][INFO ][o.e.n.Node ] [d37UOiC] initialized
[2019-11-15T07:22:28,041][INFO ][o.e.n.Node ] [d37UOiC] starting ...
[2019-11-15T07:22:28,297][INFO ][o.e.t.TransportService ] [d37UOiC] publish_address {172.18.0.2:9300}, bound_addresses {[::]:9300}
[2019-11-15T07:22:28,350][INFO ][o.e.b.BootstrapChecks ] [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 ][o.e.n.Node ] [d37UOiC] stopping ...
[2019-11-15T07:22:28,423][INFO ][o.e.n.Node ] [d37UOiC] stopped
[2019-11-15T07:22:28,423][INFO ][o.e.n.Node ] [d37UOiC] closing ...
[2019-11-15T07:22:28,457][INFO ][o.e.n.Node ] [d37UOiC] closed
[2019-11-15T07:22:28,460][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started

感覺應(yīng)該是jvm參數(shù)配置有問題

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

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

即可解決!

以上這篇解決Docker啟動(dòng)Elasticsearch7.x報(bào)錯(cuò)的問題就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

標(biāo)簽:臨汾 南通 海西 忻州 西安 辛集 延安 邯鄲

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《解決Docker啟動(dòng)Elasticsearch7.x報(bào)錯(cuò)的問題》,本文關(guān)鍵詞  解決,Docker,啟動(dòng),Elasticsearch7.x,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《解決Docker啟動(dòng)Elasticsearch7.x報(bào)錯(cuò)的問題》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于解決Docker啟動(dòng)Elasticsearch7.x報(bào)錯(cuò)的問題的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章