elasticsearch-head 下載地址
ElasticSearch-head就是一款能連接ElasticSearch搜索引擎,并提供可視化的操作頁面對ElasticSearch搜索引擎進(jìn)行各種設(shè)置和數(shù)據(jù)檢索功能的管理插件,具備集群管理、增刪查改等功能。如在head插件頁面編寫RESTful接口風(fēng)格的請求,就可以對ElasticSearch中的數(shù)據(jù)進(jìn)行增刪改查、創(chuàng)建或者刪除索引等操作。類似于使用navicat工具連接MySQL這種關(guān)系型數(shù)據(jù)庫,對數(shù)據(jù)庫做操作。簡而言之:ElasticSearch-head就是一個針對es可視化操作的插件。
1、解壓 elasticsearch-head-master.zip 文件
打開elasticsearch-head-master/Gruntfile.js,找到下面connect屬性,
新增 hostname: '*' 或 hostname: '0.0.0.0'
{
? "connect": {
? ? "server": {
? ? ? "options": {
? ? ? ? "hostname": "*",
? ? ? ? "port": 9100,
? ? ? ? "base": ".",
? ? ? ? "keepalive": true
? ? ? }
? ? }
? }
}
2、安裝 grunt
因為 Elasticsearch 5.0 之后的版本 head 插件是通過 grunt 啟動,所以需要安裝 grunt
npm install -g grunt-cli
查看grunt版本
grunt -version
3、進(jìn)入 Elasticsearch 安裝目錄,在config目錄中,修改elasticsearch.yml文件,在【D:\elasticsearch\config\elasticsearch.yml】文件的末尾加入如下代碼
# 設(shè)置外網(wǎng)可以訪問
# network.host: 0.0.0.0 ??
# 增加參數(shù),使head插件可以訪問es ?
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Type,Content-Length
# node.master: true
# node.data: true
4、安裝 head
需要先運(yùn)行Elasticsearch,運(yùn)行 D:\elasticsearch\bin\elasticsearch.bat 文件,然后執(zhí)行如下命令
npm install
注意:可能會報警告或錯誤,可多次執(zhí)行npm install命令執(zhí)行下載
5、啟動文章來源:http://www.zghlxwxcb.cn/news/detail-586373.html
npm run start
或
grunt server
6、打開瀏覽器
地址欄訪問 http://localhost:9100 就可以訪問head插件
概覽
數(shù)據(jù)瀏覽
*
*
*文章來源地址http://www.zghlxwxcb.cn/news/detail-586373.html
到了這里,關(guān)于Windows 安裝 ElasticSearch Head插件的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!