Elasticsearch5.X IN Windows 10 系列文章(4)
ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1
日期:2017-08-30
第四章:安装 Search Guard
由于x-pack 的 security 部分是收费的,考虑使用其他插件来替代,倾向于两款插件,一个是今天的主角 Search Guard, 另一个是readonlyrest
Search Guard 与 Elasticsearch 的版本对照表
一、停止运行elasticsearch,定位到es主目录下,执行下面命令:
.\bin\elasticsearch-plugin install -b com.floragunn:search-guard-5:5.4.2-15
执行效果如下图:
如果在服务器上没有网络,可以使用离线安装方式:
离线安装步骤:
1、下载对应版本的Search Guard,版本对照表
2、Search Guard 5 下载地址
3、search-guard-ssl 下载地址 ,后面要用到这个生成证书。
二、配置Search Guard
1、下载search-guard-ssl
git clone https://github.com/floragunncom/search-guard-ssl.git
2、切换到search guard ssl 源码目录,进入example-pki-scripts文件夹,修改example.sh文件,修改之后如下:
#!/bin/bash
OPENSSL_VER="$(openssl version)" if [[ $OPENSSL_VER == *"0.9"* ]]; then
echo "Your OpenSSL version is too old: $OPENSSL_VER"
echo "Please install version 1.0.1 or later"
exit -1
else
echo "Your OpenSSL version is: $OPENSSL_VER"
fi set -e
./clean.sh
./gen_root_ca.sh capass changeit
./gen_node_cert.sh 1 changeit capass
./gen_client_node_cert.sh spock changeit capass
./gen_client_node_cert.sh kirk changeit capass
./gen_client_node_cert.sh kibana changeit capass rm -f ./*tmp*
3、生成证书:
sh example.sh
4、将example-pki-scripts文件夹中的node-1-keystore.jks和truststore.jks复制到elasticsearch的配置目录中(%ES_HOME%/config)
5、配置elasticsearch 基于 TLS 加密通讯,在 elasticsearch.yml 中增加以下内容:
searchguard.ssl.transport.keystore_filepath: node-1-keystore.jks
searchguard.ssl.transport.keystore_password: changeit
searchguard.ssl.transport.truststore_filepath: truststore.jks
searchguard.ssl.transport.truststore_password: changeit
searchguard.ssl.transport.enforce_hostname_verification: false
6、重启后访问:http://localhost:9200,发现会报错,提示没有初始化 Search Guard 索引。
7、初始化 Search Guard 索引,配置帐号,首先将example-pki-scripts文件夹中的kirk-keystore.jks和truststore.jks复制到%ES_HOME%\plugins\search-guard-5\sgconfig 文件夹中
8、在 elasticsearch.yml 中增加以下内容:
searchguard.authcz.admin_dn:
- CN=kirk,OU=client,O=client,L=test, C=de
9、重启elasticsearch,在 \plugins\search-guard-5\ 目录打开终端,执行以下命令:
.\tools\sgadmin.bat -ts .\sgconfig\truststore.jks -tspass changeit -ks .\sgconfig\kirk-keystore.jks -kspass changeit -cd .\sgconfig\ -icl -nhnv -h 0.0.0.0
显示如下图,则执行成功:
使用浏览器访问:http://localhost:9200 提示输入密码,输入默认用户: admin admin ,可登陆表示正常。
10、配置REST-API 基于https连接,在 elasticsearch.yml 中增加以下内容:
searchguard.ssl.http.enabled: true
searchguard.ssl.http.keystore_filepath: node-1-keystore.jks
searchguard.ssl.http.keystore_password: changeit
searchguard.ssl.http.truststore_filepath: truststore.jks
searchguard.ssl.http.truststore_password: changeit
重启后 ,使用浏览器访问:https://localhost:9200 提示输入密码,输入默认用户: admin admin ,可登陆表示正常
http://localhost:9200 无加密拒绝访问
参考文章:
http://m.blog.csdn.net/envinfo2012/article/details/76685818
http://blog.csdn.net/lulongzhou_llz/article/details/77099418
http://www.cnblogs.com/Orgliny/p/6168986.html
https://hacpai.com/article/1472803335867?p=1&m=0
http://www.cnblogs.com/ywcz060/p/6950404.html
http://www.cnblogs.com/shifu204/p/6376683.html
Elasticsearch5.X IN Windows 10 系列文章(4)的更多相关文章
- Elasticsearch5.X IN Windows 10 系列文章(2)
ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:2017-08-29 第二章:安装Kibana ...
- Elasticsearch5.X IN Windows 10 系列文章(1)
系统类型:windows10 64位家庭版 ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:2 ...
- Elasticsearch5.X IN Windows 10 系列文章(5)
ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:2017-08-31 第五章:Kibana 安装 ...
- Elasticsearch5.X IN Windows 10 系列文章(3)
系统类型:windows10 64位家庭版 ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:20 ...
- 不可或缺 Windows Native 系列文章索引
[源码下载] 不可或缺 Windows Native 系列文章索引 作者:webabcd 1.不可或缺 Windows Native (1) - C 语言: hello c 介绍不可或缺 Window ...
- 重新想象 Windows 8 Store Apps 系列文章索引
[源码下载][重新想象 Windows 8.1 Store Apps 系列文章] 重新想象 Windows 8 Store Apps 系列文章索引 作者:webabcd 1.重新想象 Windows ...
- 重新想象 Windows 8.1 Store Apps 系列文章索引
[源码下载] [重新想象 Windows 8 Store Apps 系列文章] 重新想象 Windows 8.1 Store Apps 系列文章索引 作者:webabcd 1.重新想象 Windows ...
- 与众不同 windows phone 8.0 & 8.1 系列文章索引
[源码下载] [与众不同 windows phone 7.5 (sdk 7.1) 系列文章索引] 与众不同 windows phone 8.0 & 8.1 系列文章索引 作者:webabcd ...
- 一步步实现windows版ijkplayer系列文章之四——windows下编译ijkplyer版ffmpeg
一步步实现windows版ijkplayer系列文章之一--Windows10平台编译ffmpeg 4.0.2,生成ffplay 一步步实现windows版ijkplayer系列文章之二--Ijkpl ...
随机推荐
- Jackson错误:Can not deserialize instance of java.lang.String out of START_OBJECT token
org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not des ...
- sqlserver 删除临时表
sqlserver 删除临时表 if object_id('tempdb..#tempTable') is not null Begin drop table #tempTable End
- 简单php连接数据库作操作
1.近期稳定版本 <?php header('Content-Type: application/json'); $output = []; $host = ''; //MySQL服务器地址 $ ...
- 数据实时分析平台 Heron
Twitter发布了新开发的数据实时分析平台Heron,以下为官方文档摘译: 我们每天在Twitter上处理着数十亿的事件.正如你猜测的那样,实时分析这些事件是一个巨大的挑战.目前,我们主要的分析平台 ...
- 常见Hibernate报错处理:出现“org.hibernate.QueryException: could not resolve property”和 is not mapped和could not locate named parameter错误的解决
正确写法: @Override @SuppressWarnings("unchecked") public List<Device> queryOSDevice(Str ...
- Laravel 5系列教程二:路由,视图,控制器工作流程
免费视频教程地址https://laravist.com/series/laravel-5-basic 上一篇教程我们走了那么长的路,终于把Laravel安装好了,这一篇教程我们就要进入Laravel ...
- Linux下免安装mysql
我是使用免安装的包mysql-5.6.30-linux2.6-x86_64.tar.gz(在http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6 ...
- jquery 中attr和prop的区别
在jQuery API中也有专门解释: Attributes VS. Properties 在一些特殊的情况下,attributes和properties的区别非常大.在jQuery1.6之前,.at ...
- Java Volatile keyword
Volatile修饰的成员变量在每次被线程訪问时,都强迫从主内存中重读该成员变量的值.并且,当成员变量发生变化时,强迫线程将变化值回写到主内存.这样在不论什么时刻,两个不同的线程总是看到某个成员变量的 ...
- Selenium webdriver Java 高级应用
对于这一段还蛮有感慨的,只想说,代码还是需要自己去敲的. 1. 改变用户代理 import org.junit.AfterClass; import org.junit.BeforeClass; im ...