Elasticsearch6.0及其head插件安裝

Elasticsearch6.0及其head插件安裝

1.下載並解壓elasticsearch

2.修改elasticsearch.yml文件

集羣的名字

cluster.name: my-application

節點名字

node.name: node-1

數據存儲目錄(多個路徑用逗號分隔)

path.data: /home/wjy/es/data

日誌目錄

path.logs: /home/wjy/es/logs
#本機的ip地址
network.host: 192.168.161.128
#設置集羣中master節點的初始列表,可以通過這些節點來自動發現新加入集羣的節點
discovery.zen.ping.unicast.hosts: ["192.168.161.128"]

設置節點間交互的tcp端口(集羣),(默認9300)

transport.tcp.port: 9300

監聽端口(默認)

http.port: 9200

增加參數,使head插件可以訪問es

http.cors.enabled: true
http.cors.allow-origin: "*"
3.啓動es ./elasticsearch

4.下載head插件

wget https://github.com/mobz/elasticsearch-head/archive/master.zip
5.安裝node

wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz
tar -zxvf node-v4.4.7-linux-x64.tar.gz
配置下環境變量,編輯/etc/profile添加

執行 source /etc/profile

6.安裝grunt

grunt是基於Node.js的項目構建工具,可以進行打包壓縮、測試、執行等等的工作,head插件就是通過grunt啓動

cd /opt/elasticsearch-head-master
npm install -g grunt-cli //執行後會生成node_modules文件夾
檢查是否安裝成功

7.修改head插件源碼

修改服務器監聽地址:Gruntfile.js

修改連接地址:_site/app.js

7.運行head

在elasticsearch-head-master目錄下

npm install(安裝下載下來的包)
grunt server
8.訪問http://xxx:9100

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章