docker部署从9升级10版,elasticsearch报错无法启动(已解决)

2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.251Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-security]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.255Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-shutdown]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.256Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-sql]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.257Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-stack]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.258Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-text-structure]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.259Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-voting-only-node]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.261Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-watcher]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.263Z”, “log.level”: “INFO”, “message”:“loaded module [x-pack-write-load-forecaster]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:47 {“@timestamp”:“2023-11-08T13:47:47.265Z”, “log.level”: “INFO”, “message”:“no plugins loaded”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.plugins.PluginsService”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:51 {“@timestamp”:“2023-11-08T13:47:51.151Z”, “log.level”: “INFO”, “message”:“using [1] data paths, mounts [[/usr/share/elasticsearch/data (drvfs)]], net usable_space [12.1tb], net total_space [16.3tb], types [9p]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.env.NodeEnvironment”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:51 {“@timestamp”:“2023-11-08T13:47:51.152Z”, “log.level”: “INFO”, “message”:“heap size [1gb], compressed ordinary object pointers [true]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.env.NodeEnvironment”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:51 {“@timestamp”:“2023-11-08T13:47:51.181Z”, “log.level”: “INFO”, “message”:“upgrading legacy data folders: [/usr/share/elasticsearch/data]”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.env.NodeEnvironment”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”}
2023-11-08 21:47:51 {“@timestamp”:“2023-11-08T13:47:51.313Z”, “log.level”:“ERROR”, “message”:“fatal exception while booting Elasticsearch”, “ecs.version”: “1.2.0”,“service.name”:“ES_ECS”,“event.dataset”:“elasticsearch.server”,“process.thread.name”:“main”,“log.logger”:“org.elasticsearch.bootstrap.Elasticsearch”,“elasticsearch.node.name”:“5e0a9211d7e3”,“elasticsearch.cluster.name”:“docker-cluster”,“error.type”:“java.lang.IllegalStateException”,“error.message”:“cannot upgrade a node from version [7.16.2] directly to version [8.6.2], upgrade to version [7.17.0] first.”,“error.stack_trace”:“java.lang.IllegalStateException: cannot upgrade a node from version [7.16.2] directly to version [8.6.2], upgrade to version [7.17.0] first.\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.env.NodeMetadata.verifyUpgradeToCurrentVersion(NodeMetadata.java:122)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.env.NodeEnvironment.checkForIndexCompatibility(NodeEnvironment.java:514)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.env.NodeEnvironment.upgradeLegacyNodeFolders(NodeEnvironment.java:408)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:301)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.node.Node.(Node.java:478)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.node.Node.(Node.java:322)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.bootstrap.Elasticsearch$2.(Elasticsearch.java:214)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.bootstrap.Elasticsearch.initPhase3(Elasticsearch.java:214)\n\tat org.elasticsearch.server@8.6.2/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:67)\n”}
2023-11-08 21:47:51 ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log
2023-11-08 21:47:51
2023-11-08 21:47:51 ERROR: Elasticsearch exited unexpectedly

自己解决了,看了下日志是elasticsearch大版本升级问题,网上查找发现,elasticsearch需要先升级到7.17.5版本,再升级到8版