1.Elasticsearch历史版本下载(选择6.8.10)
https://www.elastic.co/cn/downloads/past-releases#elasticsearch
解压到本地路径:tools\elasticsearch-6.8.10
2.JDK1.8安装(百度)
本机版本:
3.node.js安装(百度)
本机版本:
4.grunt安装(百度)
本机版本:
5.Elasticsearch-head下载解压
https://github.com/mobz/elasticsearch-head
路径如:tools\elasticsearch-head
6.Elasticsearch配置
cluster.name: es.6.8.10-local
node.name: node-1
http.port: 9200
#追加跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
7.Elasticsearch-head配置安装
首先查看还学要安装那些东西:npm install grunt --save-dev
npm WARN deprecated coffee-script@1.10.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
+ grunt@1.0.1
added 94 packages from 65 contributors and audited 162 packages in 30.176s
1 package is looking for funding
run `npm fund` for details
found 9 vulnerabilities (2 low, 2 moderate, 5 high)
run `npm audit fix` to fix them, or `npm audit` for details
D:\download\elasticsearch-head-master>grunt server
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue.
上述提示未安装的grunt-contrib下面的很多未安装的包,安装好了之后即可正常使用
安装
npm install grunt-contrib-clean --registry=https://registry.npm.taobao.org
npm install grunt-contrib-concat --registry=https://registry.npm.taobao.org
npm install grunt-contrib-watch --registry=https://registry.npm.taobao.org
npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org
npm install grunt-contrib-copy --registry=https://registry.npm.taobao.org
npm install grunt-contrib-jasmine --registry=https://registry.npm.taobao.org
修改head源码
head/Gruntfile.js:
connect: { server: { options: { port: 9100, hostname: '*', base: '.', keepalive: true } }}
修改连接地址:
this.base_uri =this.config.base_uri ||this.prefs.get("app-base_uri") || "http://localhost:9200";
8.运行
elasticsearch6.8.10\bin\elasticsearch.bat
elasticsearch-head
grunt server
9.设置用户
进入bin目录,输入”./setup-passwords interactive”初始化密码
内置三个用户:
elastic:内置超级用户
kibana:仅可用于kibana用来连接elasticsearch并与之通信, 不能用于kibana登录
logstash_system:用于Logstash在Elasticsearch中存储监控信息时使用