ES插件head安装

用于查看集群状态

  • ES: v5.6.12
  • OS: Ubuntu 16.04

ES安装完成

root@elk:~# curl localhost:9200
{
  "name" : "80ELvPI",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "v8oV3pEwQV-BGk2YTK1DBA",
  "version" : {
    "number" : "5.6.12",
    "build_hash" : "cfe3d9f",
    "build_date" : "2018-09-10T20:12:43.732Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}
root@elk:~# 

head插件

官方readme中有几种方式使用:

  • Running with built in server
  • Running with docker
  • Running as a Chrome extension
  • Running as a plugin of Elasticsearch (deprecated)
  • Running with the local proxy
  • Alternatives

以前我们用的最多的就是作为一个ES插件来使用,不过从ES 5.*版本开始便不再支持;
故目前我将其build为一个server,而后再连接本机ES端口来使用

running

git clone git://github.com/mobz/elasticsearch-head.git
网速慢,或者直接下载
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
cd ./elasticsearch-head
npm install
npm install grunt-cli
npm install -g cnpm --registry=

启用9100端口vim ./elasticsearch-head/Gruntfile.js,加一个hostname

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

此时可启动服务,但未连接到ES集群

root@elk:/opt/elk/elasticsearch-head-master# ln -s /opt/elk/elasticsearch-head-master/node_modules/grunt/bin/grunt /usr/bin/grunt
root@elk:/opt/elk/elasticsearch-head-master# grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://10.10.2.109:9100

connect ES

vim /opt/elk/elasticsearch-head-master/_site/app.js,修改为ES监听地址

                init: function(parent) {
                        this._super();
                        this.prefs = services.Preferences.instance();
                        this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://10.10.2.109:9200";
                        if( this.base_uri.charAt( this.base_uri.length - 1 ) !== "/" ) {

vim /etc/elasticsearch/elasticsearch.yml,添加如下字段

http.cors.enabled: true
http.cors.allow-origin: "*"
ES-head
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 闺女好像从小到大都是这样,古灵精怪,淘气异常。她读书这十多年有过太多曲折,其成绩波动之大超乎常人想象,一会儿陪你上...
    一杯_171a阅读 652评论 9赞 9
  • 其实道理也就那些,把道理想明白,按照道理执拗地、彻底地、不折不扣的去做,到了最后你才会明白,原来只有做过了才知道:...
    苏海琳阅读 377评论 0赞 1
  • ▲ 听卢克给你讲故事 【小城故事】 停更一年了,这一年里换了城市换了身份,换了电脑也换了系统,过去的一些文件都打包...
    Luketime阅读 309评论 0赞 1
  • 今天的标题很特殊,我是别人给题目才能写,所以特地到群里找了一下标题,发现没有标题,很纠结,说真的不知道写啥...
    帅气的昵称长啥样子阅读 196评论 0赞 1
  • 昨天从阳澄湖回家的路上,胃又开始隐隐作痛,决定去医院看看,于是请了一天假。 上午看完医生,吃完午饭回到家不到12点...
    Freya在思考阅读 199评论 0赞 0

友情链接更多精彩内容