本文主要介绍如何解决Docker启动Elasticsearch7.x错误的问题,有很好的参考价值。希望对你有帮助。来和边肖一起看看吧。
使用Docker运行命令
码头运行-D-p9200:9200-p9300:9300-名称用户定义的名称集装箱ID
你会看到一串一串的,一般情况下,我们会误以为它启动成功了。
当我们执行dockerps-a时,发现它自动退出。
使用dockerlogs-f容器ID查看日志发现:
错误:[1]引导检查失败
[1]:最大虚拟内存区域vm.max_map_count[65530]可能太低,至少增加到[262144]
[2]:默认发现设置不适合生产使用;必须至少配置[discovery.seed_hosts,discovery.seed_providers,cluster.initial_master_nodes]之一
错误提示
告诉我们ES需要太多的jvm内存,所以我们需要更改配置并执行下面的代码。
sysctl-wVM.max_map_count=262144
然后输入以下命令来运行它:
dockerrun-d-eES_JAVA_POTS="-xms256m-xmx256m"-p9200:9200-p9300:9300-nameES38f46db60DDD6
检查日志以查找或报告错误:
错误:[1]引导检查失败
[1]:默认发现设置不适合生产使用;必须至少配置[discovery.seed_hosts,discovery.seed_providers,cluster.initial_master_nodes]之一
解决方案如下:
dockerrun-d-eES_JAVA_POTS="-xms256m-xmx256m"-e"discovery.type=单节点"-p9200:9200-p
:9300-名称ES38f46db60ddd6
终于成功启动了!
补充知识:docker安装elasticsearch6.4.3并停止
首先打印日志。
dockerlogs9dcea100677b OpenJDK64-BitServerVMwarning:OptionUseConcMarkSweepGCwasdeprecatedinversion9.0andwilllikelyberemovedinafuturerelease. [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]datapaths,mounts[[/(rootfs)]],netusable_space[33.4gb],nettotal_space[39.2gb],types[rootfs] [2019-11-15T07:22:08,102][INFO][o.e.e.NodeEnvironment][d37UOiC]heapsize[503.6mb],compressedordinaryobjectpointers[true] [2019-11-15T07:22:08,111][INFO][o.e.n.Node][d37UOiC]nodenamederivedfromnodeID[d37UOiCyRQyKTBz5CfI0HQ];set[node.name]tooverride [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["OracleCorporation"/OpenJDK64-BitServerVM/10.0.2/10.0.2+13] [2019-11-15T07:22:08,111][INFO][o.e.n.Node][d37UOiC]JVMarguments[-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]loadedmodule[aggs-matrix-stats] [2019-11-15T07:22:11,944][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[analysis-common] [2019-11-15T07:22:11,944][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[ingest-common] [2019-11-15T07:22:11,944][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[lang-expression] [2019-11-15T07:22:11,944][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[lang-mustache] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[lang-painless] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[mapper-extras] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[parent-join] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[percolator] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[rank-eval] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[reindex] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[repository-url] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[transport-netty4] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[tribe] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-core] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-deprecation] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-graph] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-logstash] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-ml] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-monitoring] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-rollup] [2019-11-15T07:22:11,945][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-security] [2019-11-15T07:22:11,946][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-sql] [2019-11-15T07:22:11,946][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-upgrade] [2019-11-15T07:22:11,946][INFO][o.e.p.PluginsService][d37UOiC]loadedmodule[x-pack-watcher] [2019-11-15T07:22:11,946][INFO][o.e.p.PluginsService][d37UOiC]loadedplugin[ingest-geoip] [2019-11-15T07:22:11,946][INFO][o.e.p.PluginsService][d37UOiC]loadedplugin[ingest-user-agent] [2019-11-15T07:22:17,086][WARN][o.e.d.s.ScriptModule]Script:returningdefaultvaluesformissingdocumentvaluesisdeprecated.Setsystemproperty'-Des.scripting.exception_for_missing_value=true'tomakebehaviourcompatiblewithfuturemajorversions. [2019-11-15T07:22:23,590][INFO][o.e.x.s.a.s.FileRolesStore][d37UOiC]parsed[0]rolesfromfile[/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(64bit):Version6.4.3(Build7a0781676dd492)Copyright(c)2018ElasticsearchBV [2019-11-15T07:22:26,142][INFO][o.e.d.DiscoveryModule][d37UOiC]usingdiscoverytype[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]boundorpublishingtoanon-loopbackaddress,enforcingbootstrapchecks ERROR:[1]bootstrapchecksfailed [1]:maxvirtualmemoryareasvm.max_map_count[65530]istoolow,increasetoatleast[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]Nativecontrollerprocesshasstopped-nonewnativeprocessescanbestarted我觉得jvm参数配置有问题。
第一
[root@iz2ze9GNA8ev4h0rme8ph0z~]#sudosysctl-wVM.max_map_count=262144
又
dockerrun-d-p9200:9200-p9300:9300-eES_JAVA_OPTS="-xms512m-xmx512m"-e-des.scripting.exception_for_missing_value=true-nameelasticsearchdocker.io/elasticsearch:6.4.3
就能解决!
以上解决Docker推出Elasticsearch7.x错误的问题,就是边肖分享的全部内容。希望能给大家一个参考,多多支持我们。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)