Elasticsearch和Kibana安装X-Pack

版权声明:本文为博主原创文章,未经博主允许禁止转载(http://blog.csdn.net/napoay) https://blog.csdn.net/napoay/article/details/79740821

一、Elasticsearch安装X-PACK

安装命令:

bin/elasticsearch-plugin install x-pack

这里写图片描述

默认用户名:elastic
默认密码:changeme

访问9200端口需要输入用户名和密码:

这里写图片描述

二、Kibana安装X-pack

bin/kibana-plugin install x-pack

登录Kibana的时候输入用户名和密码:

这里写图片描述

安装X-pack之后多了更多的功能:

这里写图片描述

三、修改密码

修改用户elastic的命名:

PUT /_xpack/security/user/elastic/_password
{
  "password" : "NewPassWord"
}

四、用户管理

角色:角色就是用户的标签,比如用户属于管理员、属于普通员工、或者公司A的用户、公司B的用户。

4.1 查看角色

GET /_xpack/security/role

返回结果:

{
  "watcher_admin": {
    ......
  }
}

4.2 新增用户

POST /_xpack/security/user/usera
{
  "password" : "123456abc",
  "roles" : [ "superuser", "ucas" ]
}

4.3 用户列表

列出所有用户:

GET /_xpack/security/user

结果:

{
  "elastic": {
    "username": "elastic",
    "roles": [
      "superuser"
    ],
    "full_name": null,
    "email": null,
    "metadata": {
      "_reserved": true
    },
    "enabled": true
  },
  "kibana": {
    "username": "kibana",
    "roles": [
      "kibana_system"
    ],
    "full_name": null,
    "email": null,
    "metadata": {
      "_reserved": true
    },
    "enabled": true
  },
  "logstash_system": {
    "username": "logstash_system",
    "roles": [
      "logstash_system"
    ],
    "full_name": null,
    "email": null,
    "metadata": {
      "_reserved": true
    },
    "enabled": true
  },
  "usera": {
    "username": "usera",
    "roles": [
      "superuser",
      "ucas"
    ],
    "full_name": null,
    "email": null,
    "metadata": {},
    "enabled": true
  }
}

查看某一用户:

GET /_xpack/security/user/usera

结果:

{
  "usera": {
    "username": "usera",
    "roles": [
      "superuser",
      "ucas"
    ],
    "full_name": null,
    "email": null,
    "metadata": {},
    "enabled": true
  }
}

4.4 禁用用户

PUT /_xpack/security/user/elastic/_disable

4.5 启用用户

PUT /_xpack/security/user/elastic/_enable

4.5 删除用户

DELETE /_xpack/security/user/usera
阅读更多

扫码向博主提问

mydpp

博客专家

熟悉Lucene、ES、ELK
去开通我的Chat快问
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页