ノンカフェインであなたにやさしい

Ruby,Rails,HTML,CSS,Reactなど

WSL Elasticsearchの起動ができない java.lang.IllegalArgumentException: Plugin [analysis-kuromoji] was built for Elasticsearch version 7.8.0 but version 7.10.0 is running

こんなエラーが出た

java.lang.IllegalArgumentException: Plugin [analysis-kuromoji] was built for Elasticsearch version 7.8.0 but version 7.10.0 is running

$ sudo service elasticsearch restart
 * Starting Elasticsearch Server                                                                                        uncaught exception in thread [main]
java.lang.IllegalArgumentException: Plugin [analysis-kuromoji] was built for Elasticsearch version 7.8.0 but version 7.10.0 is running
        at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:352)
        at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:622)
        at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:479)
        at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:168)
        at org.elasticsearch.node.Node.<init>(Node.java:346)
        at org.elasticsearch.node.Node.<init>(Node.java:289)
        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 /var/log/elasticsearch/elasticsearch.log
                                                                                                                 [fail]

プラグインの対応バージョンが違うらしい
Elasticsearchをアップデートだけしてプラグインが古いままのよう
一旦removeしてインストールし直す

sudo /usr/share/elasticsearch/bin/plugin remove analysis-kuromoji
sudo /usr/share/elasticsearch/bin/plugin install analysis-kuromoji

起動成功

$ sudo service elasticsearch restart
 * Starting Elasticsearch Server                                                                                 [ OK ]