ES視覺化外掛ES-HEAD安裝
ES視覺化外掛ES-HEAD安裝
修改設定系統引數
#檢視系統檔案程序的開啟數 ulimit -Hn ulimit -Sn #設定最大檔案開啟數 ulimit -n 65536 #修改系統限制的配置檔案 /etc/security/limits.conf * soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096 /etc/sysctl.conf * vm.max_map_count=262144
修改elasticsearch.yml的配置
#設定外網可以訪問 network.host: 0.0.0.0 # 監聽埠(預設) http.port: 9200 # 增加引數,使head外掛可以訪問es http.cors.enabled: true http.cors.allow-origin: "*"
啟動ES
./elasticsearch
下載head外掛
wgethttps://github.com/mobz/elasticsearch-head/archive/master.zip
安裝node.js
##下載 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 ##配置環境變數 vim /etc/profile export NODE_HOME=/opt/elasticsearch-6.5.4/es-head/node-v4.4.7-linux-x64 export PATH=$PATH:$NODE_HOME/bin export NODE_PATH=$NODE_HOME/lib/node_modules ##讓配置生效 source /etc/profile
安裝grunt
grunt是基於Node.js的專案構建工具,可以進行打包壓縮、測試、執行等等的工作,head外掛就是通過grunt啟動
##進入到外掛目錄下面 cd /opt/elasticsearch-6.5.4/es-head/elasticsearch-head-master ##下載安裝grunt npm install -g grunt-cli ##檢測是否安裝成功,如果執行命令後出現版本號就表明成功 grunt -version ##修改原始碼 Gruntfile.js,新增host正則匹配項 connect: { server: { options: { port: 9100, base: '.', keepalive: true, host: '*' } } } _site/app.js,修改es的連結地址 var ui = app.ns("ui"); var services = app.ns("services"); app.App = ui.AbstractWidget.extend({ defaults: { base_uri: null }, init: function(parent) { this._super(); this.prefs = services.Preferences.instance(); this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.10.143:9200"; ##安裝npm的服務,然後再head目錄下面啟動外掛 npm install grunt server
然後就可以在瀏覽器中訪問ip:9100檢視es的結構了。