elasticsearch 5.x安装head插件

2019-03-05  本文已影响0人  心水Diana

5.x还未支持head插件,所以需要单独运行

yum install –y git
# 不能放在elasticsearch的plugins/
git clone https://github.com/mobz/elasticsearch-head.git
wget https://nodejs.org/dist/v4.2.2/node-v4.2.2-linux-x64.tar.gz -c
tar -zxf node-v4.2.2-linux-x64.tar.gz; mv node-v4.2.2-linux-x64.tar.gz /usr/local/node
ln -sv  /usr/local/node/bin/* /usr/bin/
cd elasticsearch-head
npm install grunt-cli
# elasticsearch-head下 Gruntfile.js 文件
增加hostname 绑定本机ip 或者 '*'
     90                 connect: {
     91                         server: {
     92                                 options: {
     93                                         port: 9100,
     94                                         base: '.',
     95                                         hostname: '192.168.28.100',
     96                                         keepalive: true
     97                                 }
     98                         }
     99                 }
    100         
    101         });

Gruntfile.js.png
# _site/app.js
# 修改访问地址,默认是localhost
  this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.28.100:9200";

_site/app.js.png
在elasticsearch.yml文件追加
# 是否支持跨域
http.cors.enabled: true

# *表示支持所有域名
http.cors.allow-origin: "*"
node_modules/grunt/bin/grunt server &
elasticsearch 启动/重启
上一篇 下一篇

猜你喜欢

热点阅读