elasticsearch-head安装步骤

依赖:node环境。

elk安装elasticsearch-head步骤

npm install -g grunt-cli
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install -g cnpm --registry=https://registry.npm.taobao.org

2、修改Elasticsearch配置文件

编辑elasticsearch-5.1.1/config/elasticsearch.yml,加入以下内容:

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

3、修改Gruntfile.js

打开elasticsearch-head/Gruntfile.js,找到下面connect属性,新增hostname: ‘0.0.0.0’:

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

4、修改elasticsearch-head/_site/app.js

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

5、启动

cd /data1/xinsrv/elasticsearch-head
nohup npm run start & &>/dev/null

  • 启动失败的话在执行npm install 执行后再次执行start

注意点:

可以修改elasticsearch-head的 Gruntfile.js 文件添加hostname如下

 hostname: "10.70.1.224",
 port: 9100,
 base: '.',
 keepalive: true

6、x-pack认证访问

http://10.70.93.93:9100/?auth_user=kibana&auth_password=kibana

注意:
es集群修改elasticsearch.yml配置添加
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type

posted @ 2019-01-22 11:55  石Stone头  阅读(480)  评论(0编辑  收藏  举报