ElasticSearch-Head插件安装 CentOS7

环境说明:

CentOS7.4(CentOS-7-x86_64-DVD-1810.iso)

VMware® Workstation 12 Pro
 

搭建:

一、安装nodejs和rpm

cd /soft
su - root
yum install epel-release
yum install nodejs npm

二、下载并安装elasticsearch-head

git clone https://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start

三、 修改elasticsearch参数,以便于head插件访问ES

在elasticsearch下的elasticsearch.yml下新增一下两行:
http.cors.enabled: true
http.cors.allow-origin: "*"

 四、修改es-head的localhost地址

cd ./elasticsearch-head  #(elasticsearch-head源码文件夹)
vim Gruntfile.js
Add hostname
        connect: {
                        server: {
                                options: {
                                        hostname: '0.0.0.0',
                                        port: 9100,
                                        base: '.',
                                        keepalive: true
                                }
                        }
                }

五、修改head的连接地址

cd ./elasticsearch-head  #(elasticsearch-head源码文件夹)
vim ./_site/app.js
将localhost修改为ESdeIP地址
  修改前:this.base_uri = this.config.base_uri;
  修改后: this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://you ip address:9200";

 六、启动elasticsearch-head

方式1:
cd /soft/elasticsearch-head
npm run start
方式2:
cd elasticsearch-head(elasticsearch-head源码目录)
./node_modules/grunt/bin/grunt server

 七、访问

地址:http://you ip address:9100

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

core321

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值