CLI 安裝步驟 1、停止 Elasticsearch(如果正在運行): 在安裝插件之前,確保 Elasticsearch 沒有在運行。 命令: systemctl stop elasticsearch2、安裝插件: 使用 elasticsearch-plugin 命令安裝 IK 插件。進入到你的es的安裝目錄:如/usr/local/software/elasticsearch [root@localhost elasticsearch]# bin/elasticsearch-plugin install https://get.infini.cloud/elasticsearch/analysis-ik/8.17.0其中analysis-ik/8.17.0對應你自己安裝es的版本warning: ignoring JAVA_HOME=/usr/local/software/jdk-21.0.5; using bundled JDK -> Installing https://get.infini.cloud/elasticsearch/analysis-ik/8.17.0 -> Downloading https://get.infini.cloud/elasticsearch/analysis-ik/8.17.0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: plugin requires additional permissions @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ * java.net.SocketPermission * connect,resolve See https://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html for descriptions of what these permissions allow and the associated risks.Continue with installation? [y/N]y (此處選擇y) -> Installed analysis-ik -> Please restart Elasticsearch to activate any plugins installed3、查看ik分詞器是否安裝成功 [root@localhost elasticsearch]# curl -X GET "localhost:9200/_cat/plugins?v" name component version localhost.localdomain analysis-ik 8.17.04、重啟 Elasticsearch:安裝完成后,重啟 Elasticsearch 使插件生效。systemctl stop elasticsearch systemctl start elasticsearch查看狀態 systemctl status elasticsearch查看日志 journalctl -u elasticsearch -f5、查看日志載入插件里有個名為:loaded plugin [analysis-ik]cat /usr/local/software/elasticsearch/logs/elasticsearch.log[2025-07-25T13:28:57,460][INFO ][o.e.p.PluginsService ] [localhost.localdomain] loaded plugin [analysis-ik]我是中國人,的ik分詞情況{"tokens": [{"token": "我","start_offset": 0,"end_offset": 1,"type": "CN_CHAR","position": 0},{"token": "是","start_offset": 1,"end_offset": 2,"type": "CN_CHAR","position": 1},{"token": "中國人","start_offset": 2,"end_offset": 5,"type": "CN_WORD","position": 2},{"token": "中國","start_offset": 2,"end_offset": 4,"type": "CN_WORD","position": 3},{"token": "國人","start_offset": 3,"end_offset": 5,"type": "CN_WORD","position": 4}] }