Elasticsearch-head插件安装篇

head插件说明

在以往的es版本有一个非常好用的插件叫head,可以方便的查看索引,集群等相关状态:
5.0之后head安装支持目前只是支持插件的方式

下载和安装插件

#git clone https://github.com/599166320/elasticsearch-head.git
#cd elasticsearch-head
#npm install
#npm install -g grunt-cli
#grunt server

注意:安装插件需要预先安装好nodejs和grunt,上面的安装过程可能比较久,取决于个人的网络

修改head的hostname

注意:修改hostname,是为了让其他机器的客户端浏览器也可以访问head,如果是本地访问,就不需要了

vi  Gruntfile.js


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

修改es的elasticsearch.yml文件

添加下面的配置属性

http.cors.enabled: true
http.cors.allow-origin: "*"

启动es

/path/to/elasticsearch/bin/elasticsearch

启动head

/path/to/elasticsearch-head/grunt server

访问head

使用浏览器访问http://yourhostname:9100/

通过head可以访问el集群的信息