tar -zxvf elasticsearch-7.12.0-linux-x86_64.tar.gz
下载完成后的地址路径如下:
3.启动ES,并解决ES启动报错
进入bin目录下面执行 ./elasticsearch
错误一:ES7.12 需要使用JDK11的版本
报错,提示信息如下:
1 2 3 4
distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set. warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME Future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/software/jdk1.8.0_281/jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set. [2021-04-18T19:54:57,709][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [MiWiFi-R3-srv] uncaught exception in thread [main]
#添加jdk判断 if [ -x "$JAVA_HOME/bin/java" ]; then JAVA="/usr/local/jdk-11.0.10/bin/java" else JAVA=`which java` fi
再次启动ES ./elasticsearch
错误二:Es提示我们不可以使用root用户
提示信息如下:
1 2 3 4 5 6 7 8 9 10 11 12
java.lang.RuntimeException: can not run elasticsearch as root at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:101) at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:168) at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:397) at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) at org.elasticsearch.cli.Command.main(Command.java:79) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) For complete error details, refer to the log at /usr/local/software/elasticsearch-7.12.0/logs/elasticsearch.log
错误三:Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release
这个是警告信息,垃圾回收器的问题,可以不修改
1
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
错误四:提示:在启动Elasticsearch之前,您必须解决以下行中描述的要点
提示信息如下:
1 2 3 4 5 6
ERROR: [3] bootstrap checks failed. You must address the points described in the following [3] lines before starting Elasticsearch. bootstrap check failure [1] of [3]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535] bootstrap check failure [2] of [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] bootstrap check failure [3] of [3]: 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/software/elasticsearch-7.12.0/logs/elasticsearch.log