kibana5.3使用x-pack插件对elasticsearch5.3集群进行监控

kibana5.3使用x-pack插件对elasticsearch5.3集群进行监控

需求:  安装elasticsearch后添加x-pack插件,访问elasticsearch索引可以不用用户验证;并且能在kibana的页面上查看monitor模块

说明:由于只是一次解决问题经历,有什么不对的请大佬们指点

解决:

环境: centos (windows用户只需要下载相应的zip包解压即可 地址https://www.elastic.co/downloads/past-releases)

1: 安装elasticsearch

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.tar.gz

tar -zxvf  elasticsearch-5.3.0.tar.gz

cd elasticsearch-5.3.0

2:安装Elasticsearch插件 X-Pack  
bin/elasticsearch-plugin install x-pack

3: 启动Elasticsearc 

bin/elasticsearch -d

/**
默认 ElasticSearch的用户:
username:elastic
password:changeme
**/


4: 新建一个特殊的用户,有monitor查看权限
--添加角色权限
curl -XPOST -u elastic:changeme 'localhsot:9200/_xpack/security/role/monitor_admin' -d '{
  "indices" : [
    {
      "names" : [ "events*" ],
      "privileges" : [ "all" ]
    },
    {
      "names" : [ ".kibana*" ],
      "privileges" : [ "manage", "read", "index" ]
    }
  ]
}'

--添加用户并赋予角色权限
curl -XPOST -u elastic:changeme 'localhsot:9200/_xpack/security/user/monitor' -d '{
  "password" : "monitor",
  "full_name" : "monitor",
  "email" : "monitor@163.com",
  "roles" : [ "events_admin" ]
}'


5: 停止 elasticsearch
pid=$(ps -ef |egrep -v grep | grep elasticsearch | awk '{ print $2}')

kill -9  $pid


6: 在config/elasticsearch.yml中添加如下配置,去除权限kongzhi

xpack.security.enabled: false

--重启es

bin/elasticsearch -d


7:安装kibana

wget https://artifacts.elastic.co/downloads/kibana/kibana-5.3.0-linux-x86_64.tar.gz

tar -zxvf  kibana-5.3.0-linux-x86_64.tar.gz

cd kibana-5.3.0-linux-x86_64

8: 安装Kibana的X-Pack 插件
bin/kibana-plugin install x-pack

9:把特殊权限的用户添加到kibana.yml作为默认登录用户 
xpack.security.enabled: false
elasticsearch.username: "monitor"
elasticsearch.password: "monitor"
elasticsearch.url: "http://localhost:9200"
server.host: "localhost"
server.name: "localhost"

# elasticsearch.url : the remote elasticsearch server 
# elasticsearch.username and elasticsearch.password :  the login user
# server.host : use this ip to login in
# xpack.security.enabled : close security module


10: login in kibana 

http://localhost:5601  

效果图:es集群,新的节点只需要把第一份es文件拷贝一份并去掉data文件,再设置node节点与第一个节点不一样再启动就可以看到集群效果



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值