1.Elasticsearch歷史版本下載(選擇6.8.10)
https://www.elastic.co/cn/downloads/past-releases#elasticsearch
解壓到本地路徑:tools\elasticsearch-6.8.10
2.JDK1.8安裝(百度)
本機(jī)版本:

3.node.js安裝(百度)
本機(jī)版本:

4.grunt安裝(百度)
本機(jī)版本:

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配置安裝
首先查看還學(xué)要安裝那些東西: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.運(yùn)行
elasticsearch6.8.10\bin\elasticsearch.bat
elasticsearch-head
grunt server

9.設(shè)置用戶
????進(jìn)入bin目錄,輸入”./setup-passwords interactive”初始化密碼
????內(nèi)置三個用戶:
????elastic:內(nèi)置超級用戶
????kibana:僅可用于kibana用來連接elasticsearch并與之通信, 不能用于kibana登錄
????logstash_system:用于Logstash在Elasticsearch中存儲監(jiān)控信息時使用