安装Elasticsearch7.4.2、IK分词器以及Head插件步骤

步骤1:安装Elasticsearch7.4.2

安装ES之前要安装JDK,我安装的版本是jdk-13.0.1,此版本目前只支持Elasticsearch7.4.x和Elasticsearch7.5.x,可以在https://www.elastic.co/cn/support/matrix#matrix_jvm中查看Elasticsearch各版本支持的JDK版本。

下载Elasticsearch网址:https://www.elastic.co/cn/downloads/past-releases#elasticsearch

下载自己需要的版本,这里下载的是7.4.2的版本

直接解压,加压完成后运行elasticsearch-7.4.2\bin目录下的elasticsearch.bat文件启动es,在浏览器运行http://localhost:9200/出现如下图所示结果则安装成功。

步骤2:安装Ik分词器

网址:https://github.com/medcl/elasticsearch-analysis-ik/releases

选择与Elasticsearch同版本的ik,下载zip,并在elasticsearch-7.4.2\plugins下新建ik文件夹,将zip解压到ik文件夹下。

重新运行elasticsearch.bat文件启动es,此时如下图。

步骤3:安装Head插件 

(1)安装head插件之前需要安装node.js和grunt;

         node下载地址:https://nodejs.org/en/download/   ,安装结束后,使用命令:node -v  查看是否安装成功

         安装grunt命令:npm install -g grunt-cli  ,安装结束后,使用命令:grunt -version 查看是否安装成功

(2)进入elasticsearch-7.4.2\config目录,修改elasticsearch.yml文件.在文件的末尾加入以下代码;

http.cors.enabled: true 
http.cors.allow-origin: "*"
node.master: true
node.data: true

          然后去掉network.host: 192.168.0.1的注释并改为network.host: 0.0.0.0(此步骤操作后会重新启动es会出问题,所以没进行此操作);

          去掉cluster.name 、node.name 和 http.port 的注释(也就是去掉#);

          最后重新启动elasticsearch.bat;

(3)下载Head插件网址:https://github.com/mobz/elasticsearch-head,下载ZIP并解压;

(4)修改elasticsearch-head-master\Gruntfile.js 在对应的位置加上hostname:'*';

(5)在elasticsearch-head-master文件路径下执行npm install;

如果报错:[email protected] install: `node install.js`,则执行npm install [email protected] --ignore-scripts

(6)安装完成后执行grunt server 或者npm run start 运行head插件;

(7) 在浏览器中浏览,如下图所示则安装成功。

发布了4 篇原创文章 · 获赞 0 · 访问量 33

猜你喜欢

转载自blog.csdn.net/huqiut/article/details/103970653