Elasticsearch 5.x 安装X-Pack

2022-05-06 18:54:34 浏览数 (1)

x-pack是elasticsearch的一个扩展包,将安全,警告,监视,图形和报告功能捆绑在一个易于安装的软件包中,也是官方推荐的。

1.关闭ElasticSearch服务

需要关闭Elasticsearch 服务,如果已经启动的话,则安装安装x-pack失败。

2、ElasticSearch5.x安装x-pack

安装过程中遇到选项直接Y过去就可以了

代码语言:javascript复制
[elastic@node1 elasticsearch-5.6.5]$ bin/elasticsearch-plugin install x-pack
-> Downloading x-pack from elastic
[=================================================] 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
* javax.net.ssl.SSLPermission setHostnameVerifier
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
-> Installed x-pack
[elastic@node1 elasticsearch-5.6.5]$
代码语言:javascript复制
[elastic@node1 elasticsearch-5.6.5]$ ll plugins/
total 8
drwxrwxrwx 3 elastic elastic 4096 Jan 19 17:20 ik
drwxr-xr-x 4 elastic elastic 4096 Apr 24 14:06 x-pack
[elastic@node1 elasticsearch-5.6.5]$

3、kibana安装x-pack

安装过程时间较长,耐心等待

代码语言:javascript复制
[elastic@node1 kibana-5.6.5]$ bin/kibana-plugin install x-pack
Attempting to transfer from x-pack
Attempting to transfer from https://artifacts.elastic.co/downloads/kibana-plugins/x-pack/x-pack-5.6.5.zip
Transferring 119513816 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete
[elastic@node1 kibana-5.6.5]$

4、启动

代码语言:javascript复制
[elastic@node1 elasticsearch-5.6.5]$ bin/elasticsearch -d
代码语言:javascript复制
[elastic@node1 kibana-5.6.5]$ bin/kibana &
[1] 23641
[elastic@node1 kibana-5.6.5]$   log   [07:18:37.343] [info][status][plugin:kibana@5.6.5] Status changed from uninitialized to green - Ready
  log   [07:18:37.475] [info][status][plugin:elasticsearch@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:37.509] [info][status][plugin:xpack_main@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:37.840] [info][status][plugin:graph@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:37.864] [info][status][plugin:monitoring@5.6.5] Status changed from uninitialized to green - Ready
  log   [07:18:39.151] [warning][reporting] Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set xpack.reporting.encryptionKey in kibana.yml
  log   [07:18:39.161] [info][status][plugin:reporting@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:39.224] [info][status][plugin:security@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:39.226] [warning][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
  log   [07:18:39.234] [warning][security] Session cookies will be transmitted over insecure connections. This is not recommended.
  log   [07:18:39.303] [info][status][plugin:searchprofiler@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:39.316] [info][status][plugin:ml@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:39.389] [info][status][plugin:ml@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.403] [info][status][plugin:tilemap@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:39.415] [info][status][plugin:watcher@5.6.5] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:18:39.444] [info][status][plugin:elasticsearch@5.6.5] Status changed from yellow to green - Kibana index ready
  log   [07:18:39.465] [info][license][xpack] Imported license information from Elasticsearch for [data] cluster: mode: trial | status: active | expiry date: 2018-05-24T15:17:51 08:00
  log   [07:18:39.486] [info][status][plugin:xpack_main@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.490] [info][status][plugin:graph@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.491] [info][status][plugin:reporting@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.493] [info][status][plugin:security@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.495] [info][status][plugin:searchprofiler@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.497] [info][status][plugin:tilemap@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.498] [info][status][plugin:watcher@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:39.514] [info][status][plugin:monitoring@5.6.5] Status changed from green to yellow - Waiting for Monitoring Health Check
  log   [07:18:39.517] [info][status][plugin:grokdebugger@5.6.5] Status changed from uninitialized to green - Ready
  log   [07:18:39.535] [info][status][plugin:upgrade@5.6.5] Status changed from uninitialized to green - Ready
  log   [07:18:39.618] [info][status][plugin:console@5.6.5] Status changed from uninitialized to green - Ready
  log   [07:18:43.935] [info][status][plugin:monitoring@5.6.5] Status changed from yellow to green - Ready
  log   [07:18:43.939] [info][status][plugin:metrics@5.6.5] Status changed from uninitialized to green - Ready
  log   [07:18:44.210] [info][status][plugin:timelion@5.6.5] Status changed from uninitialized to green - Ready
  log   [07:18:44.224] [info][listening] Server running at http://node1:5601
  log   [07:18:44.226] [info][status][ui settings] Status changed from uninitialized to green - Ready

默认用户名和密码如下:

用户名:elastic 密码:changeme

5、修改elasticsearch密码

可以直接在Kibana中执行

代码语言:javascript复制
PUT _xpack/security/user/elastic/_password
{
    "password": "elastic"
}

然后Kibana跳转到登录页面,用新密码登录Kibana即可。

0 人点赞