ElasticSearch

参考:https://blog.csdn.net/xyy1028/article/details/126948634
// windows环境安装
es8默认是https协议
下载: https://www.elastic.co/cn/downloads/elasticsearch
Elasticsearch高版本内置jdk
双击 elasticsearch.bat 启动 elasticsearch 服务

// 注意启动信息会显示一些配置,包括生成的默认用户密码(user=elastic password=zaWIZMOWDl5mnGfk3Ju3)
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服务
执行安装:elasticsearch-service.bat install
D:\elasticsearch-8.7.0\bin>elasticsearch-service.bat install

// 启动Elasticsearch服务
启动服务:elasticsearch-service.bat start

// 停止Elasticsearch服务
停止服务:elasticsearch-service.bat stop

// 卸载Elasticsearch服务
卸载服务:elasticsearch-service.bat remove
// 安装node.js环境
下载:https://nodejs.org/

添加环境变量 
NODE_PATH
C:\Program Files\nodejs\node_modules

Path
C:\Program Files\nodejs

验证:
node -v 
npm -v

// 安装 Grunt 工具
npm install -g grunt
npm install -g grunt-cli
重启cmd窗口验证: grunt -V 或 grunt -version

// 安装ElasticSearch-head插件
下载: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)
// 安装 kibana
下载与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的用户名密码登录
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值