32 位 CentOS 6.7 安装 Elasticsearch 7(单机)
  6DOeteBHjp6w 2023年11月02日 65 0


CentOS 版本:

[root@MiWiFi-R4CM-srv elasticsearch]# lsb_release -a           
LSB Version: :base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.7 (Final)
Release: 6.7
Codename: Fina

系统位数:

[root@MiWiFi-R4CM-srv elasticsearch]# file /sbin/init 
/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

注意的是,我这里使用的就是 root 用户。

Elasticsearch 对 JDK 也是有要求的,所以需要提前安装好 JDK 环境。

下载及安装

Elasticsearch 下载地址:​​https://www.elastic.co/cn/downloads/elasticsearch​

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_elasticsearch

解压:

[root@MiWiFi-R4CM-srv elasticsearch]# ls
elasticsearch-7.9.2 elasticsearch-7.9.2-linux-x86_64.tar.gz

启动:

[root@MiWiFi-R4CM-srv elasticsearch]# cd elasticsearch-7.9.2
[root@MiWiFi-R4CM-srv elasticsearch-7.9.2]# ls
bin jdk LICENSE.txt modules plugins
config lib logs NOTICE.txt README.asciidoc
[root@MiWiFi-R4CM-srv elasticsearch-7.9.2]# cd bin/
[root@MiWiFi-R4CM-srv bin]# ./elasticsearch

出现了一个异常:

[2020-10-13T01:26:34,361][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [MiWiFi-R4CM-srv] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[X-Pack is not supported and Machine Learning is not available for [linux-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.9.2.jar:7.9.2]
Caused by: org.elasticsearch.ElasticsearchException: X-Pack is not supported and Machine Learning is not available for [linux-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml
at org.elasticsearch.xpack.ml.MachineLearningFeatureSet.isRunningOnMlPlatform(MachineLearningFeatureSet.java:124) ~[?:?]
at org.elasticsearch.xpack.ml.MachineLearningFeatureSet.isRunningOnMlPlatform(MachineLearningFeatureSet.java:115) ~[?:?]
at org.elasticsearch.xpack.ml.MachineLearning.createComponents(MachineLearning.java:613) ~[?:?]
at org.elasticsearch.node.Node.lambda$new$14(Node.java:522) ~[elasticsearch-7.9.2.jar:7.9.2]
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267) ~[?:1.8.0_181]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_181]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_181]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_181]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_181]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_181]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_181]
at org.elasticsearch.node.Node.<init>(Node.java:526) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.node.Node.<init>(Node.java:277) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.9.2.jar:7.9.2]
... 6 more
uncaught exception in thread [main]
ElasticsearchException[X-Pack is not supported and Machine Learning is not available for [linux-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml]
at org.elasticsearch.xpack.ml.MachineLearningFeatureSet.isRunningOnMlPlatform(MachineLearningFeatureSet.java:124)
at org.elasticsearch.xpack.ml.MachineLearningFeatureSet.isRunningOnMlPlatform(MachineLearningFeatureSet.java:115)
at org.elasticsearch.xpack.ml.MachineLearning.createComponents(MachineLearning.java:613)
at org.elasticsearch.node.Node.lambda$new$14(Node.java:522)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.elasticsearch.node.Node.<init>(Node.java:526)
at org.elasticsearch.node.Node.<init>(Node.java:277)
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393)
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:127)
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/local/develope/elasticsearch/elasticsearch-7.9.2/logs/elasticsearch.log

提示已经很明显了,加一个配置:

[root@MiWiFi-R4CM-srv bin]# cd ../config/
[root@MiWiFi-R4CM-srv config]# ls
elasticsearch.keystore elasticsearch.yml jvm.options jvm.options.d log4j2.properties role_mapping.yml roles.yml users users_roles
[root@MiWiFi-R4CM-srv config]# vim elasticsearch.yml

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_java_02

再启动:

[root@MiWiFi-R4CM-srv config]# cd ../bin/
[root@MiWiFi-R4CM-srv bin]# ./elasticsearch
future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/develope/java/jdk1.8.0_181/jre] does not meet this requirement
future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/develope/java/jdk1.8.0_181/jre] does not meet this requirement
[2020-10-13T01:33:15,578][WARN ][o.e.b.Natives ] [MiWiFi-R4CM-srv] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/linux-x86/libjnidispatch.so) not found in resource path ([file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/log4j-api-2.11.1.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-secure-sm-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-queries-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-plugin-classloader-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-launchers-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-spatial-extras-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/HdrHistogram-2.1.9.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/jackson-dataformat-yaml-2.10.4.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-join-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/jts-core-1.15.0.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/log4j-core-2.11.1.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/hppc-0.8.1.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/jopt-simple-5.0.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/jna-5.5.0.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-x-content-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/joda-time-2.10.4.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-geo-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/spatial4j-0.7.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/snakeyaml-1.26.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-core-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-misc-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/t-digest-3.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-analyzers-common-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-highlighter-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-grouping-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/java-version-checker-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-backward-codecs-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/jackson-dataformat-smile-2.10.4.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-sandbox-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/jackson-core-2.10.4.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-core-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-memory-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-spatial3d-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-queryparser-8.6.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/elasticsearch-cli-7.9.2.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/jackson-dataformat-cbor-2.10.4.jar, file:/usr/local/develope/elasticsearch/elasticsearch-7.9.2/lib/lucene-suggest-8.6.2.jar])
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1032) ~[jna-5.5.0.jar:5.5.0 (b0)]
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988) ~[jna-5.5.0.jar:5.5.0 (b0)]
at com.sun.jna.Native.<clinit>(Native.java:195) ~[jna-5.5.0.jar:5.5.0 (b0)]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_181]
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_181]
at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:45) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:110) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.9.2.jar:7.9.2]
[2020-10-13T01:33:15,589][WARN ][o.e.b.Natives ] [MiWiFi-R4CM-srv] cannot check if running as root because JNA is not available
[2020-10-13T01:33:15,590][WARN ][o.e.b.Natives ] [MiWiFi-R4CM-srv] cannot install system call filter because JNA is not available
[2020-10-13T01:33:15,590][WARN ][o.e.b.Natives ] [MiWiFi-R4CM-srv] cannot register console handler because JNA is not available
[2020-10-13T01:33:15,593][WARN ][o.e.b.Natives ] [MiWiFi-R4CM-srv] cannot getrlimit RLIMIT_NPROC because JNA is not available
[2020-10-13T01:33:15,593][WARN ][o.e.b.Natives ] [MiWiFi-R4CM-srv] cannot getrlimit RLIMIT_AS because JNA is not available
[2020-10-13T01:33:15,593][WARN ][o.e.b.Natives ] [MiWiFi-R4CM-srv] cannot getrlimit RLIMIT_FSIZE because JNA is not available
[2020-10-13T01:33:15,824][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] version[7.9.2], pid[5499], build[default/tar/d34da0ea4a966c4e49417f2da2f244e3e97b4e6e/2020-09-23T00:45:33.626720Z], OS[Linux/2.6.32-573.el6.i686/i386], JVM[Oracle Corporation/Java HotSpot(TM) Client VM/1.8.0_181/25.181-b13]
[2020-10-13T01:33:15,825][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] JVM home [/usr/local/develope/java/jdk1.8.0_181/jre]
[2020-10-13T01:33:15,825][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] JVM arguments [-Xshare:auto, -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=SPI,JRE, -Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/elasticsearch-5914515677812854093, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/usr/local/develope/elasticsearch/elasticsearch-7.9.2, -Des.path.conf=/usr/local/develope/elasticsearch/elasticsearch-7.9.2/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
[2020-10-13T01:33:19,501][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [aggs-matrix-stats]
[2020-10-13T01:33:19,503][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [analysis-common]
[2020-10-13T01:33:19,503][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [constant-keyword]
[2020-10-13T01:33:19,503][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [flattened]
[2020-10-13T01:33:19,504][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [frozen-indices]
[2020-10-13T01:33:19,504][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [ingest-common]
[2020-10-13T01:33:19,504][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [ingest-geoip]
[2020-10-13T01:33:19,504][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [ingest-user-agent]
[2020-10-13T01:33:19,504][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [kibana]
[2020-10-13T01:33:19,505][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [lang-expression]
[2020-10-13T01:33:19,505][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [lang-mustache]
[2020-10-13T01:33:19,505][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [lang-painless]
[2020-10-13T01:33:19,505][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [mapper-extras]
[2020-10-13T01:33:19,505][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [parent-join]
[2020-10-13T01:33:19,505][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [percolator]
[2020-10-13T01:33:19,505][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [rank-eval]
[2020-10-13T01:33:19,506][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [reindex]
[2020-10-13T01:33:19,506][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [repository-url]
[2020-10-13T01:33:19,506][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [search-business-rules]
[2020-10-13T01:33:19,506][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [searchable-snapshots]
[2020-10-13T01:33:19,507][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [spatial]
[2020-10-13T01:33:19,507][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [tasks]
[2020-10-13T01:33:19,507][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [transform]
[2020-10-13T01:33:19,508][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [transport-netty4]
[2020-10-13T01:33:19,508][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [vectors]
[2020-10-13T01:33:19,508][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [wildcard]
[2020-10-13T01:33:19,508][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-analytics]
[2020-10-13T01:33:19,509][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-async]
[2020-10-13T01:33:19,509][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-async-search]
[2020-10-13T01:33:19,509][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-autoscaling]
[2020-10-13T01:33:19,509][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-ccr]
[2020-10-13T01:33:19,509][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-core]
[2020-10-13T01:33:19,510][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-data-streams]
[2020-10-13T01:33:19,510][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-deprecation]
[2020-10-13T01:33:19,510][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-enrich]
[2020-10-13T01:33:19,510][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-eql]
[2020-10-13T01:33:19,510][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-graph]
[2020-10-13T01:33:19,510][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-identity-provider]
[2020-10-13T01:33:19,511][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-ilm]
[2020-10-13T01:33:19,511][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-logstash]
[2020-10-13T01:33:19,511][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-ml]
[2020-10-13T01:33:19,511][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-monitoring]
[2020-10-13T01:33:19,511][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-ql]
[2020-10-13T01:33:19,511][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-rollup]
[2020-10-13T01:33:19,512][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-security]
[2020-10-13T01:33:19,512][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-sql]
[2020-10-13T01:33:19,512][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-stack]
[2020-10-13T01:33:19,512][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-voting-only-node]
[2020-10-13T01:33:19,513][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] loaded module [x-pack-watcher]
[2020-10-13T01:33:19,513][INFO ][o.e.p.PluginsService ] [MiWiFi-R4CM-srv] no plugins loaded
[2020-10-13T01:33:19,556][INFO ][o.e.e.NodeEnvironment ] [MiWiFi-R4CM-srv] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [12.3gb], net total_space [17.3gb], types [rootfs]
[2020-10-13T01:33:19,556][INFO ][o.e.e.NodeEnvironment ] [MiWiFi-R4CM-srv] heap size [1017.6mb], compressed ordinary object pointers [unknown]
[2020-10-13T01:33:19,609][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] node name [MiWiFi-R4CM-srv], node ID [uTfDr7CWQ2K-nkEAI4y6Iw], cluster name [elasticsearch]
[2020-10-13T01:33:26,296][INFO ][o.e.x.s.a.s.FileRolesStore] [MiWiFi-R4CM-srv] parsed [0] roles from file [/usr/local/develope/elasticsearch/elasticsearch-7.9.2/config/roles.yml]
[2020-10-13T01:33:27,779][INFO ][o.e.t.NettyAllocator ] [MiWiFi-R4CM-srv] creating NettyAllocator with the following configs: [name=unpooled, factors={es.unsafe.use_unpooled_allocator=false, g1gc_enabled=false, g1gc_region_size=0b, heap_size=1017.6mb}]
[2020-10-13T01:33:27,874][INFO ][o.e.d.DiscoveryModule ] [MiWiFi-R4CM-srv] using discovery type [zen] and seed hosts providers [settings]
[2020-10-13T01:33:28,482][WARN ][o.e.g.DanglingIndicesState] [MiWiFi-R4CM-srv] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2020-10-13T01:33:28,900][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] initialized
[2020-10-13T01:33:28,901][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] starting ...
[2020-10-13T01:33:29,083][INFO ][o.e.t.TransportService ] [MiWiFi-R4CM-srv] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2020-10-13T01:33:29,347][WARN ][o.e.b.BootstrapChecks ] [MiWiFi-R4CM-srv] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2020-10-13T01:33:29,347][WARN ][o.e.b.BootstrapChecks ] [MiWiFi-R4CM-srv] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2020-10-13T01:33:29,347][WARN ][o.e.b.BootstrapChecks ] [MiWiFi-R4CM-srv] JVM is using the client VM [Java HotSpot(TM) Client VM] but should be using a server VM for the best performance
[2020-10-13T01:33:29,347][WARN ][o.e.b.BootstrapChecks ] [MiWiFi-R4CM-srv] system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2020-10-13T01:33:29,347][WARN ][o.e.b.BootstrapChecks ] [MiWiFi-R4CM-srv] 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
[2020-10-13T01:33:29,361][INFO ][o.e.c.c.ClusterBootstrapService] [MiWiFi-R4CM-srv] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2020-10-13T01:33:32,367][INFO ][o.e.c.c.Coordinator ] [MiWiFi-R4CM-srv] setting initial configuration to VotingConfiguration{uTfDr7CWQ2K-nkEAI4y6Iw}
[2020-10-13T01:33:32,540][INFO ][o.e.c.s.MasterService ] [MiWiFi-R4CM-srv] elected-as-master ([1] nodes joined)[{MiWiFi-R4CM-srv}{uTfDr7CWQ2K-nkEAI4y6Iw}{TgmGelvQQUCDAuWQSsaI0Q}{127.0.0.1}{127.0.0.1:9300}{dimrt}{xpack.installed=true, transform.node=true} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 1, version: 1, delta: master node changed {previous [], current [{MiWiFi-R4CM-srv}{uTfDr7CWQ2K-nkEAI4y6Iw}{TgmGelvQQUCDAuWQSsaI0Q}{127.0.0.1}{127.0.0.1:9300}{dimrt}{xpack.installed=true, transform.node=true}]}
[2020-10-13T01:33:32,592][INFO ][o.e.c.c.CoordinationState] [MiWiFi-R4CM-srv] cluster UUID set to [WjjVRuqoRZW0Z3Kj0K5leQ]
[2020-10-13T01:33:32,632][INFO ][o.e.c.s.ClusterApplierService] [MiWiFi-R4CM-srv] master node changed {previous [], current [{MiWiFi-R4CM-srv}{uTfDr7CWQ2K-nkEAI4y6Iw}{TgmGelvQQUCDAuWQSsaI0Q}{127.0.0.1}{127.0.0.1:9300}{dimrt}{xpack.installed=true, transform.node=true}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
[2020-10-13T01:33:32,693][INFO ][o.e.h.AbstractHttpServerTransport] [MiWiFi-R4CM-srv] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2020-10-13T01:33:32,693][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] started
[2020-10-13T01:33:32,767][INFO ][o.e.x.c.t.IndexTemplateRegistry] [MiWiFi-R4CM-srv] adding legacy template [.watch-history-11] for [watcher], because it doesn't exist
[2020-10-13T01:33:32,775][INFO ][o.e.x.c.t.IndexTemplateRegistry] [MiWiFi-R4CM-srv] adding legacy template [.triggered_watches] for [watcher], because it doesn't exist
[2020-10-13T01:33:32,776][INFO ][o.e.x.c.t.IndexTemplateRegistry] [MiWiFi-R4CM-srv] adding legacy template [.watches] for [watcher], because it doesn't exist
[2020-10-13T01:33:32,788][INFO ][o.e.x.c.t.IndexTemplateRegistry] [MiWiFi-R4CM-srv] adding legacy template [ilm-history] for [index_lifecycle], because it doesn't exist
[2020-10-13T01:33:32,790][INFO ][o.e.x.c.t.IndexTemplateRegistry] [MiWiFi-R4CM-srv] adding legacy template [.slm-history] for [index_lifecycle], because it doesn't exist
[2020-10-13T01:33:32,842][INFO ][o.e.g.GatewayService ] [MiWiFi-R4CM-srv] recovered [0] indices into cluster_state
[2020-10-13T01:33:33,165][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding component template [metrics-settings]
[2020-10-13T01:33:33,327][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding component template [logs-mappings]
[2020-10-13T01:33:33,359][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding component template [metrics-mappings]
[2020-10-13T01:33:33,389][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding component template [logs-settings]
[2020-10-13T01:33:33,450][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.triggered_watches] for index patterns [.triggered_watches*]
[2020-10-13T01:33:33,483][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.watches] for index patterns [.watches*]
[2020-10-13T01:33:33,526][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.watch-history-11] for index patterns [.watcher-history-11*]
[2020-10-13T01:33:33,554][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [ilm-history] for index patterns [ilm-history-2*]
[2020-10-13T01:33:33,579][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.slm-history] for index patterns [.slm-history-2*]
[2020-10-13T01:33:33,614][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-7-*]
[2020-10-13T01:33:33,656][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.monitoring-es] for index patterns [.monitoring-es-7-*]
[2020-10-13T01:33:33,694][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.monitoring-beats] for index patterns [.monitoring-beats-7-*]
[2020-10-13T01:33:33,720][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.monitoring-alerts-7] for index patterns [.monitoring-alerts-7]
[2020-10-13T01:33:33,790][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-7-*]
[2020-10-13T01:33:33,833][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding index template [metrics] for index patterns [metrics-*-*]
[2020-10-13T01:33:33,863][INFO ][o.e.c.m.MetadataIndexTemplateService] [MiWiFi-R4CM-srv] adding index template [logs] for index patterns [logs-*-*]
[2020-10-13T01:33:33,889][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [MiWiFi-R4CM-srv] adding index lifecycle policy [logs]
[2020-10-13T01:33:33,931][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [MiWiFi-R4CM-srv] adding index lifecycle policy [metrics]
[2020-10-13T01:33:33,955][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [MiWiFi-R4CM-srv] adding index lifecycle policy [watch-history-ilm-policy]
[2020-10-13T01:33:33,981][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [MiWiFi-R4CM-srv] adding index lifecycle policy [ilm-history-ilm-policy]
[2020-10-13T01:33:34,004][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [MiWiFi-R4CM-srv] adding index lifecycle policy [slm-history-ilm-policy]
[2020-10-13T01:33:34,318][INFO ][o.e.l.LicenseService ] [MiWiFi-R4CM-srv] license [c8ea1669-ece7-48c3-918d-7fee6dd10f14] mode [basic] - valid
[2020-10-13T01:33:34,319][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [MiWiFi-R4CM-srv] Active license is now [BASIC]; Security is disabled

默认启动端口是 9200。

检测是否启动成功:

[root@MiWiFi-R4CM-srv ~]# curl 127.0.0.1:9200
{
"name" : "MiWiFi-R4CM-srv",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "WjjVRuqoRZW0Z3Kj0K5leQ",
"version" : {
"number" : "7.9.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "d34da0ea4a966c4e49417f2da2f244e3e97b4e6e",
"build_date" : "2020-09-23T00:45:33.626720Z",
"build_snapshot" : false,
"lucene_version" : "8.6.2",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

可以发现,启动成功。

远程访问

这时候其实发现远程是无法访问的:

➜  ~ curl 10.224.221.6:9200    
curl: (7) Failed to connect to 10.224.221.6 port 9200: Operation timed out

要修改 elasticsearch.yml 文件:

[root@MiWiFi-R4CM-srv ~]# cd /usr/local/develope/elasticsearch/elasticsearch-7.9.2/config/
[root@MiWiFi-R4CM-srv config]# ls
elasticsearch.keystore elasticsearch.yml jvm.options jvm.options.d log4j2.properties role_mapping.yml roles.yml users users_roles

添加配置即可:

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_elasticsearch_03

保存后重新启动:

[2020-10-13T02:03:10,005][INFO ][o.e.n.Node               ] [MiWiFi-R4CM-srv] initialized
[2020-10-13T02:03:10,005][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] starting ...
[2020-10-13T02:03:10,287][INFO ][o.e.t.TransportService ] [MiWiFi-R4CM-srv] publish_address {10.224.221.68:9300}, bound_addresses {[::]:9300}
[2020-10-13T02:03:10,619][INFO ][o.e.b.BootstrapChecks ] [MiWiFi-R4CM-srv] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [5] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: JVM is using the client VM [Java HotSpot(TM) Client VM] but should be using a server VM for the best performance
[4]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[5]: 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: Elasticsearch did not exit normally - check the logs at /usr/local/develope/elasticsearch/elasticsearch-7.9.2/logs/elasticsearch.log
[2020-10-13T02:03:10,767][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] stopping ...
[2020-10-13T02:03:10,788][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] stopped
[2020-10-13T02:03:10,788][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] closing ...
[2020-10-13T02:03:10,809][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] closed

发现启动失败。我这里系统相关配置的确不行:

[root@MiWiFi-R4CM-srv bin]# ulimit -S -n
1024
[root@MiWiFi-R4CM-srv bin]# ulimit -H -n
4096

需要进行修改:

[root@MiWiFi-R4CM-srv bin]# vim /etc/security/limits.conf

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_elasticsearch_04

修改后重新登陆系统:

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_jar_05

可以发现已经修改成功:

[root@MiWiFi-R4CM-srv ~]# ulimit -H -n
65537

再次启动还是有异常,所以这几个问题都得解决:

[2020-10-13T02:21:00,433][INFO ][o.e.n.Node               ] [MiWiFi-R4CM-srv] initialized
[2020-10-13T02:21:00,434][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] starting ...
[2020-10-13T02:21:00,641][INFO ][o.e.t.TransportService ] [MiWiFi-R4CM-srv] publish_address {10.224.221.68:9300}, bound_addresses {[::]:9300}
[2020-10-13T02:21:00,979][INFO ][o.e.b.BootstrapChecks ] [MiWiFi-R4CM-srv] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [4] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: JVM is using the client VM [Java HotSpot(TM) Client VM] but should be using a server VM for the best performance
[3]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[4]: 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: Elasticsearch did not exit normally - check the logs at /usr/local/develope/elasticsearch/elasticsearch-7.9.2/logs/elasticsearch.log
[2020-10-13T02:21:01,156][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] stopping ...
[2020-10-13T02:21:01,191][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] stopped
[2020-10-13T02:21:01,191][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] closing ...
[2020-10-13T02:21:01,215][INFO ][o.e.n.Node ] [MiWiFi-R4CM-srv] closed

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

就是当前用户 ES 拥有的内存太小了,至少要 262144,解决方案:

在 root 用户下:

[root@MiWiFi-R4CM-srv bin]# sysctl -w vm.max_map_count=262144

vm.max_map_count = 262144

查看是否设置成功:

[root@MiWiFi-R4CM-srv bin]# sysctl -a|grep vm.max_map_count
vm.max_map_count = 262144

这个设置是临时方案,永久设置:

[root@MiWiFi-R4CM-srv bin]# vim /etc/sysctl.conf

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_jar_06

解决:[2]: JVM is using the client VM [Java HotSpot(TM) Client VM] but should be using a server VM for the best performance

这个异常好理解:

[root@MiWiFi-R4CM-srv bin]# java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) Client VM (build 25.181-b13, mixed mode)

修改一下即可:

[root@MiWiFi-R4CM-srv i386]# pwd
/usr/local/develope/java/jdk1.8.0_181/jre/lib/i386
[root@MiWiFi-R4CM-srv i386]# vim jvm.cfg

调换一下顺序:

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_jar_07

解决:[3]:system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

这是在因为Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。

在 elasticsearch.yml 中配置bootstrap.system_call_filter为false,注意要在Memory下面:

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_java_08

解决:[4]: 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

这个就是提示只需要保留一个节点即可,修改 elasticsearch.yml:

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_java_09

这里的 node-1 其实就是配置的 node.name:

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_elasticsearch_10

上诉问题都处理后,重新启动 ES。

发现我这里本机已经可以远程访问了:

32 位 CentOS 6.7 安装 Elasticsearch 7(单机)_java_11

 

References

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  4crWjjQBqFOy   2023年11月13日   25   0   0 javamavenandroid
  wpWn7yzs0oKF   2023年11月13日   31   0   0 javaapacheHDFS
6DOeteBHjp6w