一、下载 elasticsearch-head-master.zip

https://codeload.github.com/mobz/elasticsearch-head/tar.gz/v5.0.0

解压并进入目录

二、下载node.js

elasticsearch-head-master]# curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
 
elasticsearch-head-master]# yum install -y nodejs

查看是否下载成功

elasticsearch-head-master]# node -v
v10.16.0
elasticsearch-head-master]# npm -v
6.9.0

三、安装grunt

elasticsearch-head-master]# npm install -g grunt-cli
 
elasticsearch-head-master]# npm install

四、修改

elasticsearch-head-master]# vim Gruntfile.js,添加hostname: '0.0.0.0'

server: {
        options: {
                hostname: '0.0.0.0',
                port: 9100,
                base: '.',
                keepalive: true
        }
}

elasticsearch-head-master]# vim _site/app.js,将this.prefs.get("app-base_uri") || "localhost:9200",修改如下

this._super();
this.prefs = services.Preferences.instance();
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.25.180:9200";

五、启动

elasticsearch-head-master]# npm run start nohup npm run start(后台启动)

> elasticsearch-head@0.0.0 start /home/elasticsearch-head-master
> grunt server
 
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

六、浏览器访问

192.168.25.180:9100