CentOS 7.X Linux下安装ElasticSearch-Head插件

一、修改/etc/elasticsearch/elasticsearch.yml,增加下面的参数,这样head插件可以访问es

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

修改后,重启elasticsearch

systemctl restart elasticsearch.service

二、下载并安装

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
sudo npm install -g grunt-cli
npm install
grunt server

三、默认监听地址是localhost,修改监控地址 vi head/Gruntfile.js
增加hostname

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

四、修改head 的链接地址
vi head/_site/app.js

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://your ip:9200";

Leave a Reply