elasticsearch+logstash+kibana5.5.2集成searchguard实现用户权限管理(二)
来源:互联网 发布:高考志愿填报软件 编辑:程序博客网 时间:2024/06/06 03:44
上一篇我们完成了elk集成sg的配置,但是,我们的logstash只能使用一台es,这是远远不够的,我们要重新制作自己的授信文件,幸运的是官网给出了一个工具,并且还给出了一个在线制作的网站,支持10个es节点,这里我们使用在线制作
url: https://floragunn.com/tls-certificate-generator/
填写表格,提交就可以了,所有的授信文件,都会发到你的邮箱里。注意查收,可能会被扔到垃圾箱里。
文件名是下面这样,目录结构如下,我们把每个es节点都拷贝一份
里面有一个README.txt文件保存了具体的操作步骤,和用到的密码
search-guard-certificates-<UUID>.tar.gz │└─── client-certificates│ Contains two client certificates named 'admin' and 'demouser'│ The admin certificate can be used with sgadmin and the REST API. │ The CN of this certificate is 'sgadmin'. The demouser certificate can be used │ for HTTPS client authentication. └─── node-certificates│ Contains the certificates in jks, p12 and pem format to be used │ on your Elasticsearch nodes. You will find certificates for all │ hostnames you specified when submitting the form.└─── root-ca│ Contains the root CA certificate and private key.└─── config│ Same as above, but for the signing CA└─── truststore.jks│ The truststore containing the certificate chain│ of the root and signing CA. Can be used on all nodes.
先把集群都停止了
1.拷贝truststore.jks和CN=[hostname]-keystore.jks文件(每个节点)
* Copy the file 'truststore.jks' to the config directory of your node(替换掉原来的即可)* Copy the file 'node-certificates/CN=[hostname]-keystore.jks' to the config directory of your node, where [hostname] is the hostname of your Elasticsearch node(es主机名叫什么,拷贝相应的keystore文件)
2.重新配置es。更改原来默认的配置为下(每个节点)
######## Start Search Guard Demo Configuration ########searchguard.ssl.transport.keystore_filepath: CN=[hostname]-keystore.jkssearchguard.ssl.transport.keystore_password: [keystore password for this node]searchguard.ssl.transport.truststore_filepath: truststore.jkssearchguard.ssl.transport.truststore_password: 62ef1c559f6ba96e4ca1searchguard.ssl.transport.enforce_hostname_verification: falsesearchguard.ssl.http.enabled: truesearchguard.ssl.http.keystore_filepath: CN=[hostname]-keystore.jkssearchguard.ssl.http.keystore_password: [keystore password for this node]searchguard.ssl.http.truststore_filepath: truststore.jkssearchguard.ssl.http.truststore_password: 62ef1c559f6ba96e4ca1searchguard.authcz.admin_dn: - CN=sgadmin ######## End Search Guard Demo Configuration ########
3.启动es,拷贝证书文件到tools文件夹下(任意一台es)
* Copy the file 'truststore.jks' to the directory 'plugins/search-guard-5/tools'* Copy the file 'client-certificates/CN=sgadmin-keystore.jks' to the directory 'plugins/search-guard-5/tools'
4.重新初始化sg(用到的密码都在README文件下面,请改成自己的)
./sgadmin.sh -ts truststore.jks -tspass 62ef1c559f6ba96e4ca1 -ks CN=sgadmin-keystore.jks -kspass f0fbad3ec91139f75136 -nhnv -icl -cd ../sgconfig/
至此es上面的配置就完成了,如果我们更改sg_config的用户的权限,要重新初始化sg,我们之前说过了,再强调一下。
我们更改es的truststore文件,相应的logstash也要重新配置。
elasticsearch { user => admin password => admin ssl => true ssl_certificate_verification => true truststore => "/etc/logstash/truststore.jks" truststore_password => "62ef1c559f6ba96e4ca1" hosts => [ "node1:9200","node2:9200","node3:9200" ] index => "mysql-%{+YYYY.MM.dd}" }
别忘了在/etc/hosts文件中做好主机名解析工作
贴一个truststore 配置错误的报错
[2017-09-13T15:14:24,265][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"https://admin:xxxxxx@node1:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [https://admin:xxxxxx@node1:9200/][Manticore::ClientProtocolException] PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"}
- elasticsearch+logstash+kibana5.5.2集成searchguard实现用户权限管理(二)
- elasticsearch+logstash+kibana5.5.2集成searchguard实现用户权限管理(一)
- SSH用户权限管理(二)
- supervisor管理elasticsearch和logstash
- 搭建ELK(ElasticSearch+Logstash+Kibana)日志分析系统(二) Logstash简介及常见配置语法
- logstash+elasticsearch +kibana 日志管理系统
- 用SearchGuard做elasticsearch的登录认证
- 用SearchGuard做elasticsearch的登录认证
- ElasticSearch之kibana5.x安装
- ELK(ElasticSearch, Logstash, Kibana)实现分布式日志
- 使用 logstash + kafka + elasticsearch 实现日志监控
- elasticsearch5.x(二)elasticsearch、logstash、kibana安装步骤(linux)
- [Elasticsearch] 索引管理 (二)
- 第六章 用户权限管理(二)- DataGrid控件技巧
- 浅谈Linux用户权限管理之二(用户管理工具)
- 浅谈Linux用户权限管理之二(用户管理工具)
- 使用ElasticSearch+LogStash+Kibana+Redis搭建日志管理服务
- 使用ElasticSearch+LogStash+Kibana+Redis搭建日志管理服务
- 解压下载的ms_celeb_1m数据集
- leetcode 667. Beautiful Arrangement II
- QGraphicsView大于QGraphicsScene时出现滚动条时,改变scene的显示位置
- ASimpleCache学习笔记
- 怎样在网站中添加google统计代码
- elasticsearch+logstash+kibana5.5.2集成searchguard实现用户权限管理(二)
- spring + quartz定时器
- 用户消费行为分析
- 运用dubbo框架之后logback.xml在Linux不起作用
- MATLAB中改变默认工作路径(Current Folder)的2种方法 软件版本:MATLAB2012b 电脑系统:win8.1 方法一: 1. 桌面快捷方式——右键“属性”——在选项卡里选“快
- 扩展KMP模板
- 根据身份证号获取性别
- 1022. Digital Library (30)
- poj 3299