Elastic Stack学习--elasticsearch安装X-Pack

x-pack作为elasticsearch的增强组件,主要提供安全、监控等功能。elasticsearch安装x-pack组件的顺序如下图:

image

离线安装x-pack

    因为大多数情况下,生产环境中的服务器无法访问到外网环境,因此,使用离线安装方式;在线安装方式见参考连接;
1)下载离线安装包,并上传至服务器;(集群中每个elasticsearch节点都要执行)

注:x-pack离线安装包包含elasticsearch、logstash、kibana中所需组件,可以共用;

2)执行安装命令;(集群中每个elasticsearch节点都要执行)

bin/elasticsearch-plugin install file:///path/to/file/x-pack-6.2.2.zip

注:此处的安装包路径一定是绝对路径,直接使用压缩包安装即可,无需解压;格式类似:file://路径

安装成功后结果类似如下:

current workdir: /home/work/elasticsearch-6.2.2
-> Downloading file:///home/work/x-pack-6.2.2.zip
[=================================================] 100%??
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.io.FilePermission \\.\pipe\* read,write
* java.lang.RuntimePermission accessClassInPackage.com.sun.activation.registries
* java.lang.RuntimePermission getClassLoader
* java.lang.RuntimePermission setContextClassLoader
* java.lang.RuntimePermission setFactory
* java.net.SocketPermission * connect,accept,resolve
* java.security.SecurityPermission createPolicy.JavaPolicy
* java.security.SecurityPermission getPolicy
* java.security.SecurityPermission putProviderProperty.BC
* java.security.SecurityPermission setPolicy
* java.util.PropertyPermission * read,write
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@        WARNING: plugin forks a native controller        @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This plugin launches a native controller that is not subject to the Java
security manager nor to system call filters.

Continue with installation? [y/N]y
Elasticsearch keystore is required by plugin [x-pack-security], creating...
-> Installed x-pack with: x-pack-security,x-pack-deprecation,x-pack-watcher,x-pack-core,x-pack-graph,x-pack-upgrade,x-pack-ml,x-pack-monitoring,x-pack-logstash

3)重启elasticsearch;启动后可看到加载组件中包含x-pack-*;(集群中每个elasticsearch节点都要执行)

[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-core]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-deprecation]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-graph]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-logstash]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-ml]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-monitoring]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-security]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-upgrade]
[2018-03-13T13:29:15,122][INFO ][o.e.p.PluginsService     ] [gzhxy-matrix-001.gzhxy.baidu.com] loaded plugin [x-pack-watcher]
[2018-03-13T13:29:20,046][DEBUG][o.e.a.ActionModule       ] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security

4)以交互方式为内置用户elastic, kibana, logstash_system设置密码;(集群中任意一个elasticsearch节点执行即可)

bin/x-pack/setup-passwords interactive

期间需要输入每个用户要设置的密码,输入日志如下:

Initiating the setup of passwords for reserved users elastic,kibana,logstash_system.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y


Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [kibana]:
Reenter password for [kibana]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [elastic]

注意:设置密码进需要在集群中任意一个elasticsearch节点执行完成即可,如果执行第二次,将会给出如下错误提示,如果需要更新密码,则可以通过kibana上的Management > Users进行更新:

Failed to authenticate user 'elastic' against http://10.113.130.33:8200/_xpack/security/_authenticate?pretty
Possible causes include:
 * The password for the 'elastic' user has already been changed on this cluster
 * Your elasticsearch node is running against a different keystore
   This tool used the keystore at /home/work/elasticsearch-6.2.2/config/elasticsearch.keystore

ERROR: Failed to verify bootstrap password

参考

Installing X-Pack in Elasticsearch
Setting Up User Authentication
Elasticsearch系列(三)----Elasticsearch5.5.1与插件安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Elasticsearch X-Pack 是一个强大的插件,它为 Elasticsearch 提供了一系列的扩展功能,包括安全、监控、报告、机器学习等。下面简单介绍一下如何安装 Elasticsearch X-Pack。 1. 下载 Elasticsearch X-Pack 插件 你可以从 Elastic 官网下载对应版本的 X-Pack 插件,链接为:https://www.elastic.co/cn/downloads/x-pack。 2. 安装 Elasticsearch X-Pack 插件 安装 Elasticsearch X-Pack 插件需要使用 Elasticsearch 的插件安装命令。将下载好的 X-Pack 插件解压到 Elasticsearch 的 plugins 目录下,然后使用以下命令安装插件: ``` bin/elasticsearch-plugin install file:///path/to/x-pack-xxx.zip ``` 其中,`/path/to/x-pack-xxx.zip` 是 X-Pack 插件的压缩包路径。 3. 配置 Elasticsearch X-Pack 插件 安装 Elasticsearch X-Pack 插件后,你需要在 Elasticsearch 的配置文件中进行相应的配置。具体配置方法可以参考官方文档。 4. 启动 Elasticsearch X-Pack 插件 启动 Elasticsearch X-Pack 插件需要先启动 Elasticsearch,然后在 Elasticsearch 的命令行界面输入以下命令: ``` bin/elasticsearch ``` 如果一切顺利,你应该可以看到 Elasticsearch 启动成功的日志信息。 5. 验证 Elasticsearch X-Pack 插件是否安装成功 你可以通过访问 Elasticsearch 的 API 或者使用 Kibana 来验证 Elasticsearch X-Pack 插件是否安装成功。如果安装成功,你应该可以看到 X-Pack 相关的 API 和功能。 总之,在安装 Elasticsearch X-Pack 插件之前,你需要先了解自己的 Elasticsearch 版本,然后下载对应版本的 X-Pack 插件。安装插件需要使用 Elasticsearch 的插件安装命令,并且需要在 Elasticsearch 的配置文件中进行相应的配置。启动插件后,你可以通过访问 Elasticsearch 的 API 或者使用 Kibana 来验证插件是否安装成功。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值