CentOS 8 上安装 Elasticsearch 启动失败
参考教程:https://developer.aliyun.com/article/766370?spm=a2c6h.12873581.0.0.70212784gaDzaG#slide-0
已开放9200、9300对应端口 修改yml配置 修改service配置但还是不管用
运行结果及详细报错内容如下
```bash
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2023-01-15 07:15:36 CST; 4min 21s ago
Docs: https://www.elastic.co
Process: 18788 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 18788 (code=exited, status=1/FAILURE)
Jan 15 07:15:35 RainYun-b4ZFP4fo systemd-entrypoint[18788]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Jan 15 07:15:35 RainYun-b4ZFP4fo systemd-entrypoint[18788]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Jan 15 07:15:35 RainYun-b4ZFP4fo systemd-entrypoint[18788]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Jan 15 07:15:35 RainYun-b4ZFP4fo systemd-entrypoint[18788]: at org.elasticsearch.cli.Command.main(Command.java:77)
Jan 15 07:15:35 RainYun-b4ZFP4fo systemd-entrypoint[18788]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Jan 15 07:15:35 RainYun-b4ZFP4fo systemd-entrypoint[18788]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Jan 15 07:15:35 RainYun-b4ZFP4fo systemd-entrypoint[18788]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
Jan 15 07:15:36 RainYun-b4ZFP4fo systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jan 15 07:15:36 RainYun-b4ZFP4fo systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jan 15 07:15:36 RainYun-b4ZFP4fo systemd[1]: Failed to start Elasticsearch.
日志
```bash
Jan 14 18:52:05 RainYun-b4ZFP4fo systemd[1]: Starting Elasticsearch...
Jan 14 18:52:05 RainYun-b4ZFP4fo systemd[1]: Started Elasticsearch.
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/lucene/util/Constants has been compiled by a more recent versi>
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.lang.ClassLoader.defineClass1(Native Method)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.security.AccessController.doPrivileged(Native Method)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.env.ESFileStore.<init>(ESFileStore.java:55)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.env.Environment.<clinit>(Environment.java:90)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:81)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.common.cli.CliTool.<init>(CliTool.java:107)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.common.cli.CliTool.<init>(CliTool.java:100)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.bootstrap.BootstrapCLIParser.<init>(BootstrapCLIParser.java:48)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:226)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Jan 14 18:52:13 RainYun-b4ZFP4fo elasticsearch[1176]: Refer to the log for complete error details.
Jan 14 18:52:13 RainYun-b4ZFP4fo systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jan 14 18:52:13 RainYun-b4ZFP4fo systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jan 14 18:52:40 RainYun-b4ZFP4fo systemd[1]: Starting Elasticsearch...
Jan 14 18:52:40 RainYun-b4ZFP4fo systemd[1]: Started Elasticsearch.
Jan 14 18:52:41 RainYun-b4ZFP4fo elasticsearch[2461]: Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/lucene/util/Constants has been compiled by a more recent versi>
lines 1-30