Elasticsearch & Kibana with Shield
/opt/elasticsearch-2.3.2/bin/plugin install license
/opt/elasticsearch-2.3.2/bin/plugin install shield
或离线安装
[root@ela-master1 ~]# /opt/elasticsearch-2.3.2/bin/plugin install file:///root/license-2.3.2.zip
-> Installing from file:/root/license-2.3.2.zip...
Trying file:/root/license-2.3.2.zip ...
Downloading .DONE
Verifying file:/root/license-2.3.2.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed license into /opt/elasticsearch-2.3.2/plugins/license
[root@ela-master1 ~]# /opt/elasticsearch-2.3.2/bin/plugin install file:///root/shield-2.3.2.zip
-> Installing from file:/root/shield-2.3.2.zip...
Trying file:/root/shield-2.3.2.zip ...
Downloading .......................DONE
Verifying file:/root/shield-2.3.2.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed shield into /opt/elasticsearch-2.3.2/plugins/shield
shield.authc.realms.file1.type: file
shield.authc.realms.file1.order: 0
HERE
2.启动(或重启)elasticsearch
3.创建file based用户
https://www.elastic.co/guide/en/shield/current/defining-roles.html#valid-role-name
https://www.elastic.co/guide/en/shield/current/enable-basic-auth.html
/opt/elasticsearch-2.3.2/bin/shield/esusers useradd es_admin -p P@ssw0rd -r admin
/opt/elasticsearch-2.3.2/bin/shield/esusers useradd kibana -p P@ssw0rd -r kibana4_server
[root@ela-client ~]# /opt/elasticsearch-2.3.2/bin/shield/esusers list
es_admin : admin
kibana : kibana4_server
/opt/elasticsearch-2.3.2/config/shield/users
/opt/elasticsearch-2.3.2/config/shield/users_roles
5.测试用户认证
[root@ela-client ~]# curl -u es_admin:P@ssw0rd 'http://localhost:9200/_cat/health?v'
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1462705707 19:08:27 elasticsearch_cluster green 6 2 52 26 0 0 0 0 - 100.0%
[root@ela-client ~]# curl -u es_admin:P@ssw0rd 'http://localhost:9200/_cat/indices?v'
health status index pri rep docs.count docs.deleted store.size pri.store.size
green open shakespeare 5 1 111396 0 36.5mb 18.2mb
green open logstash-2015.05.20 5 1 4750 0 72.9mb 35.7mb
green open bank 5 1 1000 0 890.5kb 447.9kb
green open .kibana 1 1 4 0 44.5kb 22.2kb
green open logstash-2015.05.18 5 1 4631 0 64.9mb 32.7mb
green open logstash-2015.05.19 5 1 4624 0 66.7mb 32mb
shield.authc.realms.native1.type: native
shield.authc.realms.native1.order: 0
HERE
2.启动(或重启)elasticsearch
3.创建native用户
curl -u es_admin:P@ssw0rd -XPOST 'http://localhost:9200/_shield/user/fooadmin' -d '
{
"password" : "foo.123",
"roles" : [ "admin", "other_role1" ],
"full_name" : "Jlive Liu",
"email" : "iliujun_live@163.com",
"metadata" : {
"intelligence" : 7
}
}
'
说明:
1.新增native用户也需要认证,但启用了shield之后默认是没有native用户的,所以就需要借助file based用户来授权
2.native用户是存放在elasticsearch集群中,集群中的所有节点会自动同步
[root@ela-client ~]# curl -u es_admin:P@ssw0rd -XPOST 'http://localhost:9200/_shield/user/fooadmin' -d '
{
"password" : "foo.123",
"roles" : [ "admin", "other_role1" ],
"full_name" : "Jlive Liu",
"email" : "iliujun_live@163.com",
"metadata" : {
"intelligence" : 7
}
}
'
{"user":{"created":true}}
[root@ela-data1 ~]# curl -u es_admin:P@ssw0rd 'http://localhost:9200/_shield/user'
{"fooadmin":{"username":"fooadmin","roles":["admin","other_role1"],"full_name":"Jlive Liu","email":"iliujun_live@163.com","metadata":{"intelligence":7}}}
4.测试用户认证
[root@ela-master2 ~]# curl -u fooadmin:foo.123 'http://localhost:9200/_cat/health?v'
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1462707192 19:33:12 elasticsearch_cluster green 6 2 54 27 0 0 0 0 - 100.0%
Elasticsearch & Kibana with Shield的更多相关文章
- 安装logstash,elasticsearch,kibana三件套
logstash,elasticsearch,kibana三件套 elk是指logstash,elasticsearch,kibana三件套,这三件套可以组成日志分析和监控工具 注意: 关于安装文档, ...
- 使用logstash+elasticsearch+kibana快速搭建日志平台
日志的分析和监控在系统开发中占非常重要的地位,系统越复杂,日志的分析和监控就越重要,常见的需求有: * 根据关键字查询日志详情 * 监控系统的运行状况 * 统计分析,比如接口的调用次数.执行时间.成功 ...
- lagstash + elasticsearch + kibana 3 + kafka 日志管理系统部署 02
因公司数据安全和分析的需要,故调研了一下 GlusterFS + lagstash + elasticsearch + kibana 3 + redis 整合在一起的日志管理应用: 安装,配置过程,使 ...
- 安装logstash,elasticsearch,kibana三件套(转)
logstash,elasticsearch,kibana三件套 elk是指logstash,elasticsearch,kibana三件套,这三件套可以组成日志分析和监控工具 注意: 关于安装文档, ...
- ElasticSearch+Kibana 索引操作
ElasticSearch+Kibana 索引操作 一 前言 ElasticiSearch 简介 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引 ...
- logstash+ElasticSearch+Kibana VS Splunk
logstash+ElasticSearch+Kibana VS Splunk 最近帮磊哥移植一套开源的日志管理软件,替代Splunk. Splunk是一个功能强大的日志管理工具,它不仅可以用多种方式 ...
- logstash+elasticsearch+kibana快速搭建日志平台
使用logstash+elasticsearch+kibana快速搭建日志平台 日志的分析和监控在系统开发中占非常重要的地位,系统越复杂,日志的分析和监控就越重要,常见的需求有: 根据关键字查询日 ...
- Elasticsearch,Kibana,Logstash,NLog实现ASP.NET Core 分布式日志系统
Elasticsearch - 简介 Elasticsearch 作为核心的部分,是一个具有强大索引功能的文档存储库,并且可以通过 REST API 来搜索数据.它使用 Java 编写,基于 Apac ...
- 快速搭建应用服务日志收集系统(Filebeat + ElasticSearch + kibana)
快速搭建应用服务日志收集系统(Filebeat + ElasticSearch + kibana) 概要说明 需求场景,系统环境是CentOS,多个应用部署在多台服务器上,平时查看应用日志及排查问题十 ...
随机推荐
- day16 python-04 字典
Python之路,Day3 = Python基础4 # is 比较id # == 比较数值 # type(1) is type(2) 比较两个变量的类型是否相同 a = 1 b = 1 c = ' p ...
- thinkphp 页面Trace信息
调试模式并不能完全满足我们调试的需要,有时候我们需要手动的输出一些调试信息.除了本身可以借助一些开发工具进行调试外,ThinkPHP还提供了一些内置的调试工具和函数.例如,页面Trace功能就是Thi ...
- System.Collections.IDictionary.cs
ylbtech-System.Collections.IDictionary.cs 1.程序集 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKe ...
- 有道云笔记新功能发现——有道云笔记剪报,完美解决不开会员保存csdn博客到本地的问题。
怎么用 方法一:谷歌插件 方法二:http://note.youdao.com/web-clipper-chrome.html 添加到书签 功能: 能够把网页浏览的内容保存到有道云笔记 解决了自己的难 ...
- Linux权限命令chmod
一.Linux chmod命令修改文件和文件目录权限(默认情况下只有root用户才能使用).命令格式:chmod+修改内容+要修改的文件或者 目录 或者 chmod -R 修改内容 要修改的文件或者 ...
- 使用Python实现不同目录下文件的拷贝
目标:要实现将一台计算机的共享文件夹中的文件备份到另一台计算机,如果存在同名的文件只要文件的大小和最后修改时间一致,则不拷贝该文件 python版本:Python3.7.1 python脚本: fro ...
- 复杂Linq语句写法
从网上收藏的复杂Linq语句写法 1.case when: 原型: sql原型: SELECT ProductID, Name, Color, CASE WHEN Color = 'Red' THEN ...
- 那些使用VSCode写Python踩过的坑(Anaconda配置)
1. 如何在vscode上配置的配置方法请务必一定要直接参考官方文档Getting Started with Python in VS Code,不要去看什么杂七杂八的blog,要么过时要么不准确要么 ...
- react之可控组件与不可控组件
一.不可控组件 <input type="text" defaultvalue="Hello React" /> 如上:defaultvalue的值 ...
- 关于Synthesis
1,当追求面积最小时 会以牺牲Fmax为代价,可以使用一下setting: fit_pack_for_density=on fit_report_lab_usage_stats=on 可在 .qsf ...