原文連結https://www.jianshu.com/p/e3f7bf6277f9elasticsearch-head
Windows下安裝
解壓elasticsearch-6.4.3.zip包到指定目錄,這裡不設定參數,直接啟動
運作:bin/elasticsearch.bat
ES軟體目錄說明
是用于監控 Elasticsearch 狀态的用戶端插件,包括資料可視化、執行增删改查操作等。elasticsearch-head 插件的安裝在 Linux 和 Windows 沒什麼差別,安裝之前確定目前系統已經安裝 nodejs 即可。
Elasticsearch 5.0之後的安裝方式和之前不太一樣
下載下傳 elasticsearch-head
elasticsearch-head,可以直接下壓縮包,也可以通過 git clone。
輸入指令,等待下載下傳完成:
git clone git://github.com/mobz/elasticsearch-head.git
安裝 grunt-cli
npm install -g grunt-cli
安裝 grunt
elasticsearch-head 下載下傳完成後,進入 elasticsearch-head 檔案夾,執行指令:
npm install grunt --save
安裝依賴的 npm 包
npm install
修改啟動檔案
所有依賴包安裝成功後,修改 elasticsearch-head 目錄下的 Gruntfile.js 檔案,在 options 屬性内增加 hostname,設定為 0.0.0.0。
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
修改 Elasticsearch 配置檔案 config/elasticsearch.yml
在配置檔案最後增加兩個配置項,這樣 elasticsearch-head 插件才可以通路 Elasticsearch 。
http.cors.enabled: true
http.cors.allow-origin: "*"
啟動 elasticsearch-head
在 elasticsearch-head 目錄下,執行指令:
grunt server
輸出如下内容表示啟動成功:
Running “connect:server” (connect) task
Waiting forever…
Started connect web server on http://localhost:9100
通路 http://localhost:9100 位址,就可以看到目前 Elasticsearch 叢集資訊。