**Elasticsearch6.0不能使用命令直接安装head插件**
修改配置文件/etc/elasticsearch/elasticsearch.yml增加参数
```bash
# 增加参数,使head插件可以访问es
http.cors.enabled: true
http.cors.allow-origin: "*"
```
下载head插件
```bash
[root@base ~]# wget https://github.com/mobz/elasticsearch-head/archive/master.zip
```
解压至/opt目录下
安装node
```bash
[root@base ~]# wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz
[root@base ~]# tar -zxvf node-v4.4.7-linux-x64.tar.gz
```
修改环境变量/etc/profile添加
```bash
[root@base ~]# vim /etc/profile
export NODE_HOME=/opt/node-v4.4.7-linux-x64
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules
source /etc/profile
```
安装grunt
```bash
[root@base ~]# cd /opt/elasticsearch-head-master
npm install -g grunt-cli
```
检查是否安装成功

修改head插件源码/opt/elasticsearch-head-master/Gruntfile.js

PS:hostname是新增的,不要忘记原有的true后面加,符号
修改连接地址/opt/elasticsearch-head-master/_site/app.js

下载运行head必要的文件(放置在文件夹/tmp下)
```bash
[root@base ~]# cd /tmp
[root@base tmp]# wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
yum -y install bzip2
```
运行head,后台启动
```bash
[root@base ~]# cd /opt/elasticsearch-head-master
[root@base master]# npm install
[root@base master]# grunt server &
```
web页面验证


Elasticsearch6.0以上版本head插件安装