Elasticsearch这里安装在了Windows下

安装Elasticsearch,我这里选择的是最新版本(8.3.3)
下载地址: https://www.elastic.co/cn/downloads/elasticsearch

下载完之后解压文件夹
在这里插入图片描述
进入bin
在这里插入图片描述
双击执行
执行完成后会显示以下内容

-> Elasticsearch security features have been automatically configured!
-> Authentication is enabled and cluster connections are encrypted.

->  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
  01aVmPEg7*bWmgGaXnv0

->  HTTP CA certificate SHA-256 fingerprint:
  1ae7d35f3165a808fe6b55fc6090ff938dadc55ac86b3330548ef6b9a896f5b8

->  Configure Kibana to use this cluster:
* Run Kibana and click the configuration link in the terminal when Kibana starts.
* Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjMuMyIsImFkciI6WyIxOTIuMTY4LjEuNjY6OTIwMCJdLCJmZ3IiOiIxYWU3ZDM1ZjMxNjVhODA4ZmU2YjU1ZmM2MDkwZmY5MzhkYWRjNTVhYzg2YjMzMzA1NDhlZjZiOWE4OTZmNWI4Iiwia2V5IjoiMWhYcGxJSUJ4QVZtRkx4T0lQZ0U6Nm1ZeXNZTUlUcUNRaU5yTDFnVjZIQSJ9

->  Configure other nodes to join this cluster:
* On this node:
  - Create an enrollment token with `bin/elasticsearch-create-enrollment-token -s node`.
  - Uncomment the transport.host setting at the end of config/elasticsearch.yml.
  - Restart Elasticsearch.
* On other nodes:
  - Start Elasticsearch with `bin/elasticsearch --enrollment-token <token>`, using the enrollment token that you generated.

其中,需要注意两处
在这里插入图片描述
Elastic为登录账号,01aVmPEg7*bWmgGaXnv0为登录密码,密码是随机生成,不可直接复制本文中的。
安装完成后,进入config文件夹
在这里插入图片描述
打开elasticsearch.yml文件
在这里插入图片描述
在这里插入图片描述
访问访问localhost:9200,出现下图,则成功
在这里插入图片描述

JEECGBoot的配置

因为在application-dev.yml的配置中,没有配置登录的账户和密码,所以这里我们选择elasticsearch为免密登录
在这里插入图片描述
完成以上配置,直接启动项目即可
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐