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 的版本对照表

search-guard-docs in github

  一、停止运行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.jkstruststore.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.jkstruststore.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)的更多相关文章

  1. Elasticsearch5.X IN Windows 10 系列文章(2)

    ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:2017-08-29 第二章:安装Kibana ...

  2. Elasticsearch5.X IN Windows 10 系列文章(1)

    系统类型:windows10  64位家庭版 ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:2 ...

  3. Elasticsearch5.X IN Windows 10 系列文章(5)

    ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:2017-08-31 第五章:Kibana 安装 ...

  4. Elasticsearch5.X IN Windows 10 系列文章(3)

    系统类型:windows10 64位家庭版 ElasticSearch版本: 5.5.1 (最新稳定版为5.5.2),由于用到IK中文分词插件,最新版本没有5.5.2 ,所以使用5.5.1 日期:20 ...

  5. 不可或缺 Windows Native 系列文章索引

    [源码下载] 不可或缺 Windows Native 系列文章索引 作者:webabcd 1.不可或缺 Windows Native (1) - C 语言: hello c 介绍不可或缺 Window ...

  6. 重新想象 Windows 8 Store Apps 系列文章索引

    [源码下载][重新想象 Windows 8.1 Store Apps 系列文章] 重新想象 Windows 8 Store Apps 系列文章索引 作者:webabcd 1.重新想象 Windows ...

  7. 重新想象 Windows 8.1 Store Apps 系列文章索引

    [源码下载] [重新想象 Windows 8 Store Apps 系列文章] 重新想象 Windows 8.1 Store Apps 系列文章索引 作者:webabcd 1.重新想象 Windows ...

  8. 与众不同 windows phone 8.0 & 8.1 系列文章索引

    [源码下载] [与众不同 windows phone 7.5 (sdk 7.1) 系列文章索引] 与众不同 windows phone 8.0 & 8.1 系列文章索引 作者:webabcd ...

  9. 一步步实现windows版ijkplayer系列文章之四——windows下编译ijkplyer版ffmpeg

    一步步实现windows版ijkplayer系列文章之一--Windows10平台编译ffmpeg 4.0.2,生成ffplay 一步步实现windows版ijkplayer系列文章之二--Ijkpl ...

随机推荐

  1. 在xcode6中使用矢量图(iPhone6置配UI)

    转载出处:http://blog.xoneday.com ios应用程序是一个图像主导的产品.在开发一个应用程序时,你需要各种尺寸的图标,你需要为每个图像文件制作一个@1x尺寸和一个@2x尺寸.这样你 ...

  2. 客户端JavaScript加密数据,服务端Java解密数据

    原文:http://blog.csdn.net/peterwanghao/article/details/43303807 在普通的页面提交时,如果没有使用SSL,提交的数据将使用纯文本的方式发送.如 ...

  3. Android Service完全解析,关于服务你所需知道的一切

    来自:http://www.360doc.com/content/14/0415/18/2793098_369238276.shtml 相信大多数朋友对Service这个名词都不会陌生,没错,一个老练 ...

  4. powerbuilder webbrowser 内嵌浏览器 select下拉框无法使用

        Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MA ...

  5. Kingdee Apusic 中间件有关资料

    Kingdee Apusic 中间件有关资料: 1.官方网站:http://www.apusic.com 2.资料目录:http://www.apusic.com/dist 3.Apusic 8 资料 ...

  6. cs-HtmlHelpers

    ylbtech-Unitity: cs-HtmlHelpers PagingHelpers.cs  SelectInputHelpers.cs TreeHelpers.cs 1.A,效果图返回顶部   ...

  7. parallax corrected cubemap

    https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity https:/ ...

  8. Vue实例总结

    一.登陆框的要点总结: 1.暂无数据就是要myData里没数据时候才出来:删除全部就是要有数据才出来.v-show的使用: 2.表格行就是需要循环数据,v-for.{{$index}}.{{item. ...

  9. PHPCMS V9管理员password忘记怎样改动

    一般的虚拟主机商都提供了PHPmyAdmin,选择你站点数据库.然后选择v9_admin这个表. 编辑 password,变成:fa3250300be9b7ab0848257f3cbb06e7 enc ...

  10. Centos 7 搭建蓝鲸V4.1.16社区版

    第一次搭建蓝鲸平台,参考了蓝鲸社区的官方搭建文档. 友情链接:蓝鲸智云社区版V4.1.16用户手册 搭建时遇到了不少的坑,这里做一个详细的安装梳理 主机硬件要求 官方的推荐如下: 在本地用VMware ...