参考:https://blog.csdn.net/xyy1028/article/details/126948634
es8默认是https协议
下载: https://www.elastic.co/cn/downloads/elasticsearch
Elasticsearch高版本内置jdk
双击 elasticsearch.bat 启动 elasticsearch 服务
Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
zaWIZMOWDl5mnGfk3Ju3
https://localhost:9200/ (使用上面的user password登录)
显示一下内容:
{
"name" : "DESKTOP-7MKJHED",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "rfC9foRuS7yX3rXNlw-CQg",
"version" : {
"number" : "8.7.0",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "09520b59b6bc1057340b55750186466ea715e30e",
"build_date" : "2023-03-27T16:31:09.816451435Z",
"build_snapshot" : false,
"lucene_version" : "9.5.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
执行安装:elasticsearch-service.bat install
D:\elasticsearch-8.7.0\bin>elasticsearch-service.bat install
启动服务:elasticsearch-service.bat start
停止服务:elasticsearch-service.bat stop
卸载服务:elasticsearch-service.bat remove
下载:https://nodejs.org/
添加环境变量
NODE_PATH
C:\Program Files\nodejs\node_modules
Path
C:\Program Files\nodejs
验证:
node -v
npm -v
npm install -g grunt
npm install -g grunt-cli
重启cmd窗口验证: grunt -V 或 grunt -version
下载:https://github.com/mobz/elasticsearch-head
在该文件夹内打开cmd
执行安装命令 D:\elasticsearch-head-master>npm install
遇到的问题:
① npm ERR! network This is a problem related to network connectivity.
解决:npm config set registry https://registry.npm.taobao.org
② npm ERR! PhantomJS not found on PATH
解决:npm install phantomjs@2.1.1 --ignore-scripts
执行启动命令 D:\elasticsearch-head-master>npm run start
访问:http://localhost:9100 此时还连不上ElasticSearch
解决跨域问题 在config/elasticsearch.yml 添加如下配置:
#开启跨域访问支持,默认为false
http.cors.enabled: true
#跨域访问允许的域名地址,(允许所有域名)使用正则
http.cors.allow-origin: /.*/
重启elasticsearch
再次访问:http://localhost:9100/?auth_user=elastic&auth_password=zaWIZMOWDl5mnGfk3Ju3
连接地址: https://localhost:9200/ (注意这里是https)
下载与Elasticsearch 相同版本的 kibana
https://www.elastic.co/cn/downloads/past-releases#kibana
中文版界面:
修改 config\kibana.yml 文件
将 i18n.locale: “en”, 改为 i18n.locale: “zh-CN”
启动Kibana服务:bin目录下双击执行 kibana.bat
浏览器访问Kibana
http://localhost:5601
获取elasticsearch 授权token
D:\elasticsearch-8.7.0\bin>elasticsearch-create-enrollment-token --scope kibana
获取kibana 的授权码
D:\kibana-8.7.0\bin>kibana-verification-code
输入elasticSearch的用户名密码登录