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,多个应用部署在多台服务器上,平时查看应用日志及排查问题十 ...
随机推荐
- dubbo重连机制会不会造成错误
dubbo在调用服务不成功时,默认会重试2次. Dubbo的路由机制,会把超时的请求路由到其他机器上,而不是本机尝试,所以 dubbo的重试机器也能一定程度的保证服务的质量. 但是如果不合理的配置重试 ...
- file对象的获取 radio值的获取
jq $("#hiddenFile").get(0).filesjs this.files; 获取radio的值 $('input:radio:checked').val(): $ ...
- Yii2 使用 npm 安装的包
转载自: yii2.0.15 使用 npm 替换 bower,加速 composer 安装速度 [ 2.0 版本 ] 修改 ommon/config/main.php <?php return ...
- Python 输入字符串找(String)下标 没有返回-1
str = "abcdefg123456"a = input("请输入一个字母或数字:")num = 0result = -1while num < le ...
- SQL Server SQLGetData()
{ /* 语法 C++ SQLRETURN SQLGetData( SQLHSTMT StatementHandle, SQLUSMALLINT Col_or_Param_Num, SQLSMALLI ...
- day31 类的组合及继承,文件目录规范
Python之路,Day18 = Python基础18-面向对象继承与组合 类的继承 def talk(): print("I am come from talk..a") cla ...
- P2763 试题库问题 (网络流 最大流)
传送门 解题思路 比较简单的网络流,建图还是比较好想的.让源点向试题连流量为1的边,试题向所属类型连流量为1的边,类型向汇点连流量为需要此类试题的边.直接跑最大流,输出答案时找到那些满流的边所对的点. ...
- OBJC依赖库管理利器cocoapods 安装及使用详细图解
cocoapods: github:https://github.com/CocoaPods/CocoaPods 官方网站:http://www.cocoapods.org/ 1.安装 RubyGem ...
- ssm下使用分页插件PageHelper进行分页
1. 导入maven依赖: <dependency> <groupId>com.github.pagehelper</groupId> <artifactId ...
- day 49 Bootstrap框架和inconfont、font-awesome使用
Bootstrap框架和inconfont.font-awesome使用 iconfont的使用:https://www.cnblogs.com/clschao/articles/10387580 ...