Homestead 啟動 elasticsearch 報錯

chaofu發表於2020-07-20

啟動 elasticsearch

$ sudo systemctl restart elasticsearch.service

報錯

Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.

執行命令

sudo systemctl status elasticsearch.service
sudo journalctl -xe
// 結果
vagrant@homestead:/usr/share/elasticsearch/bin$ sudo journalctl -xe
Jul 20 03:00:01 homestead systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit elasticsearch.service has failed.
--
-- The result is RESULT.
Jul 20 03:00:01 homestead sudo[5721]: pam_unix(sudo:session): session closed for user root
Jul 20 03:00:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:01:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:02:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:03:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:04:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:05:01 homestead CRON[5871]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 20 03:05:01 homestead CRON[5872]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 20 03:05:01 homestead CRON[5871]: pam_unix(cron:session): session closed for user root
Jul 20 03:05:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:05:39 homestead sudo[5878]:  vagrant : TTY=pts/0 ; PWD=/usr/share/elasticsearch/bin ; USER=root ; COMMAND=/usr/bin/vim /etc/elasticsearch/elasticsearch.yml
Jul 20 03:05:39 homestead sudo[5878]: pam_unix(sudo:session): session opened for user root by vagrant(uid=0)
Jul 20 03:06:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:07:05 homestead sudo[5878]: pam_unix(sudo:session): session closed for user root
Jul 20 03:07:10 homestead sudo[5889]:  vagrant : TTY=pts/0 ; PWD=/usr/share/elasticsearch/bin ; USER=root ; COMMAND=/bin/systemctl restart elasticsearch.service
Jul 20 03:07:10 homestead sudo[5889]: pam_unix(sudo:session): session opened for user root by vagrant(uid=0)
Jul 20 03:07:10 homestead systemd[1]: Starting Elasticsearch...
-- Subject: Unit elasticsearch.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit elasticsearch.service has begun starting up.
Jul 20 03:07:10 homestead env[808]: [APIv1] KEEPALIVE /api/v1/events
Jul 20 03:07:12 homestead elasticsearch[5892]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Jul 20 03:07:33 homestead elasticsearch[5892]: uncaught exception in thread [main]
Jul 20 03:07:33 homestead elasticsearch[5892]: java.lang.IllegalArgumentException: Plugin [analysis-ik] was built for Elasticsearch version 7.4.2 but version 7.6.0 is running
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:346)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:531)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:471)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:163)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.node.Node.<init>(Node.java:313)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.node.Node.<init>(Node.java:257)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.cli.Command.main(Command.java:90)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
Jul 20 03:07:33 homestead elasticsearch[5892]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Jul 20 03:07:33 homestead elasticsearch[5892]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
Jul 20 03:07:33 homestead systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jul 20 03:07:33 homestead systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 20 03:07:33 homestead systemd[1]: Failed to start Elasticsearch.

// 發現
java.lang.IllegalArgumentException: Plugin [analysis-ik] was built for Elasticsearch version 7.4.2 but version 7.6.0 is running
// good 就是它了

找到錯誤 java.lang.IllegalArgumentException: Plugin [analysis-ik] was built for Elasticsearch version 7.4.2 but version 7.6.0 is running

解決錯誤

cd /usr/share/elasticsearch/plugins/analysis-ik
sudo vim plugin-descriptor.properties
// 修改 
elasticsearch.version=7.6.0
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章