elasticsearch安装采坑记录

首先下载ES elasticsearch   6.1.1版本  然后安装 

安装准备:

安装Elasticsearch唯一的要求是安装官方新版的Java,包括对应的Jdk。

安装Elasticsearch

首先到官网下载最新版本的Elasticsearch压缩包。

可以使用命令,注意将最新的可用的下载链接填入:

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.2.zip
unzip elasticsearch-5.0.2.zip
cd elasticsearch-5.0.2

运行Elasticsearch

Elasticsearch已经准备就绪,执行以下命令可在前台启动:

./bin/elasticsearch

如果想在后台以守护进程模式运行,添加-d参数。

打开另一个终端进行测试:

curl 'http://localhost:9200/?pretty'

你能看到以下返回信息:

{
    "name": "vP19PMO",
    "cluster_name": "elasticsearch",
    "cluster_uuid": "IMKMfkMsSrKODIYg5gxgeQ",
    "version": {
        "number": "5.0.2",
        "build_hash": "f6b4951",
        "build_date": "2016-11-24T10:07:18.101Z",
        "build_snapshot": false,
        "lucene_version": "6.2.1"
    },
    "tagline": "You Know, for Search"
}

这说明你的ELasticsearch集群已经启动并且正常运行。

安装Kiabna

Kibana是一个为 ElasticSearch 提供的数据分析的 Web 接口。可使用它对日志进行高效的搜索、可视化、分析等各种操作。

首先到官网下载最新版本的Kiabna压缩包。

可以使用如下命令,注意将最新的可用的下载链接填入:

wget https://artifacts.elastic.co/downloads/kibana/kibana-5.1.1-linux-x86_64.tar.gz
sha1sum kibana-5.1.1-linux-x86_64.tar.gz
tar -xzf kibana-5.1.1-linux-x86_64.tar.gz
cd kibana/

注意:

  • https://www.elastic.co/downloads/kibana 可以在该地址获取下载链接,一定要选择对于系统和版本。
  • 按照文档的要求,一般情况下kibana的版本必须和Elasticsearch安装的版本一致。

安装X-Pack

X-Pack是一个Elastic Stack的扩展,将安全,警报,监视,报告和图形功能包含在一个易于安装的软件包中。在Elasticsearch 5.0.0之前,您必须安装单独的Shield,Watcher和Marvel插件才能获得在X-Pack中所有的功能。

下载前提

Elasticsearch 5.0.2

Kibana 5.0.2

Elasticsearch下载X-Pack

在Es的根目录(每个节点),运行 bin/elasticsearch-plugin进行安装。

bin/elasticsearch-plugin install x-pack


安装过程中跳出选项现在y即可。

如果你在Elasticsearch已禁用自动索引的创建,在elasticsearch.yml配置action.auto_create_index允许X-pack创造以下指标:

action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*

运行Elasticsearch。

bin/elasticsearch

Kibana下载X-Pack

在Kibana根目录运行 bin/kibana-plugin 进行安装。

bin/kibana-plugin install x-pack


安装过程会比较久,耐心等待。

运行Kibana。

bin/kibana

验证X-Pack

在浏览器上输入: http://localhost:5601/ ,可以打开Kibana,此时需要输入用户名和密码登录,默认分别是 elastic 和 changeme

安装参考:

  1. 每个操作系统安装Elasticsearch的文件选择不同,参考:https://www.elastic.co/downloads/elasticsearch,选择对应的文件下载。
  2. 安装Kiabna需要根据操作系统做选择,参考:https://www.elastic.co/guide/en/kibana/current/install.html,选择对应的文件下载。
  3. 安装X-Pack需要根据Elasticsearch安装不同的方式提供不同的安装方法,参考:https://www.elastic.co/guide/en/x-pack/5.0/installing-xpack.html#installing-xpack

名词解释

在刚接触Elasticsearch的时候,会有很多名词不能理解,或者不知道其中的关系。其中很多是为不同版本的Elasticsearch而存在的。

Marvel

Marvel插件:在簇中从每个节点汇集数据。这个插件必须每个节点都得安装。 
Marvel是Elasticsearch的管理和监控工具,在开发环境下免费使用。它包含了Sense。

Sense

交互式控制台,使用户方便的通过浏览器直接与Elasticsearch进行交互。

Hand

在学习Elasticsearch的过程中,必不可少需要通过一些工具查看es的运行状态以及数据。如果都是通过rest请求,未免太过麻烦,而且也不够人性化。此时,Head插件可以实现基本信息的查看,rest请求的模拟,数据的检索等等。

X-pack

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

Kibana

kibana是一个与elasticsearch一起工作的开源的分析和可视化的平台。使用kibana可以查询、查看并与存储在elasticsearch索引的数据进行交互操作。使用kibana能执行高级的数据分析,并能以图表、表格和地图的形式查看数据。

kibana使得理解大容量的数据变得非常容易。它非常简单,基于浏览器的接口使我们能够快速的创建和分享显示elasticsearch查询结果实时变化的仪表盘。

在Elasticsearch 5版本之前,一般都是通过安装Kibana,而后将Marvel、Hand等各种功能插件添加到Kibana上使用。在Elasticsearch 5版本之后,一般情况下只需要安装一个官方推荐的X-pack扩展包即可。

安装Kibana之前X-pack必须安装并设置 权限

chown -R elasticsearch:elasticsearch /LG/elasticsearch-6.1.1

1. 设置X-Pack

X-Pack是一个Elastic Stack扩展,将安全性,警报,监控,报告,机器学习和图形功能捆绑到一个易于安装的软件包中。要访问此功能,您必须 在Elasticsearch中安装X-Pack。

2. 在Elasticsearch中安装X-Pack

安装Elasticsearch之后,您可以选择获取并安装X-Pack。

您必须运行与您正在运行的Elasticsearch版本相匹配的X-Pack版本。

重要

如果您是在现有群集上首次安装X-Pack,则必须执行完整群集重新启动。安装X-Pack后,必须在群集中的所有节点上启用安全性和安全性才能使群集正常运行。升级时通常可以执行滚动升级。

这里写图片描述

2.1 要在Elasticsearch中安装X-Pack:

可选:如果您想在没有互联网访问权限的机器上安装X-Pack

注意

1.1 .Elasticsearch,Kibana和Logstash的插件包含在同一个zip文件中。如果您已下载此文件以在其中一个其他产品上安装X-Pack,则可以重复使用相同的文件

1.2 将zip文件传输到脱机机器上的临时目录。(不要将文件放在Elasticsearch插件目录中。)

在ES_HOME群集中的每个节点上 运行

?

1

bin/elasticsearch-plugin install x-pack

我执行这个命令后

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

[root@biluos elasticsearch-6.2.0]# 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

See https://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-ml,x-pack-logstash,x-pack-watcher,x-pack-core,x-pack-deprecation,x-pack-security,x-pack-upgrade,x-pack-graph,x-pack-monitoring

[root@biluos elasticsearch-6.2.0]# cd /usr/share/elasticsearch

-bash: cd: /usr/share/elasticsearch: No such file or directory

网络不好的可能需要多次执行,有可能报错如下

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

[root@biluos elasticsearch-6.2.0]# bin/elasticsearch-plugin install x-pack

-> Downloading x-pack from elastic

[===================>                             ] 41%? ?  Exception in thread "main" javax.net.ssl.SSLException: SSL peer shut down incorrectly

        at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:596)

        at sun.security.ssl.InputRecord.read(InputRecord.java:532)

        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)

        at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930)

        at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)

        at sun.net.www.MeteredStream.read(MeteredStream.java:134)

        at java.io.FilterInputStream.read(FilterInputStream.java:133)

        at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3375)

        at java.io.FilterInputStream.read(FilterInputStream.java:133)

        at org.elasticsearch.plugins.ProgressInputStream.read(ProgressInputStream.java:55)

        at org.elasticsearch.plugins.ProgressInputStream.read(ProgressInputStream.java:62)

        at java.nio.file.Files.copy(Files.java:2908)

        at java.nio.file.Files.copy(Files.java:3027)

        at org.elasticsearch.plugins.InstallPluginCommand.downloadZip(InstallPluginCommand.java:336)

        at org.elasticsearch.plugins.InstallPluginCommand.downloadZipAndChecksum(InstallPluginCommand.java:379)

        at org.elasticsearch.plugins.InstallPluginCommand.download(InstallPluginCommand.java:231)

        at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:221)

        at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:212)

        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)

        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)

        at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:75)

        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)

        at org.elasticsearch.cli.Command.main(Command.java:90)

        at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:48)

        Suppressed: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: SSL peer shut down incorrectly

                at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1541)

                at sun.security.ssl.AppInputStream.available(AppInputStream.java:60)

                at java.io.BufferedInputStream.available(BufferedInputStream.java:410)

                at sun.net.www.MeteredStream.available(MeteredStream.java:170)

                at sun.net.www.http.KeepAliveStream.close(KeepAliveStream.java:85)

                at java.io.FilterInputStream.close(FilterInputStream.java:181)

                at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(HttpURLConnection.java:3448)

                at java.io.FilterInputStream.close(FilterInputStream.java:181)

                at org.elasticsearch.plugins.InstallPluginCommand.$closeResource(InstallPluginCommand.java:139)

                at org.elasticsearch.plugins.InstallPluginCommand.downloadZip(InstallPluginCommand.java:337)

                ... 10 more

        [CIRCULAR REFERENCE:javax.net.ssl.SSLException: SSL peer shut down incorrectly]

注意

如果您正在使用 Elasticsearch 的DEB / RPM分发,请以超级用户权限运行安装。

插件安装脚本需要直接访问互联网来下载和安装X-Pack。如果您的服务器无法访问Internet,请指定您下载到临时目录的X-Pack zip文件的位置。

?

1

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

注意

file://协议之后,您必须指定zip文件的绝对路径。

2.2 确认您要授予X-Pack其他权限。

TIP

在运行install命令时指定–batch选项以自动授予这些权限并绕过这些安装提示。

X-Pack需要这些权限才能在安装期间设置威胁上下文加载器,以便Watcher可以发送电子邮件通知。

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

**@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@     WARNING: plugin requires additional permissions     @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

* java.lang.RuntimePermission accessClassInPackage.com.sun.activation.registries

* java.lang.RuntimePermission getClassLoader

* java.lang.RuntimePermission setContextClassLoader

* java.lang.RuntimePermission setFactory

* java.security.SecurityPermission createPolicy.JavaPolicy

* java.security.SecurityPermission getPolicy

* java.security.SecurityPermission putProviderProperty.BC

* java.security.SecurityPermission setPolicy

* java.util.PropertyPermission * read,write

* java.util.PropertyPermission sun.nio.ch.bugLevel write

* javax.net.ssl.SSLPermission setHostnameVerifier

See https://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**

X-Pack需要权限才能使Elasticsearch启动机器学习分析引擎。本地控制器确保启动的进程是有效的机器学习组件。一旦启动,机器学习进程和Elasticsearch之间的通信就会限制在Elasticsearch所运行的操作系统用户身上。

?

1

2

3

4

5

6

7

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@        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

2.3 X-Pack将尝试在Elasticsearch中自动创建一些索引。

默认情况下,Elasticsearch被配置为允许自动创建索引,不需要额外的步骤。但是,如果你有Elasticsearch禁用自动创建索引,你必须配置 action.auto_create_index的 elasticsearch.yml,让X-包创建以下指标:

?

1

action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*

重要

如果您使用的是Logstash 或Beats,那么在您的action.auto_create_index设置中,您很可能需要额外的索引名称,具体值取决于您的本地配置。如果您不确定环境的正确价值,则可以考虑设置 *可以自动创建所有指标的值。

2.4 配置传输层安全性(TLS / SSL)。

如果您有非试用许可证,并且想要使用X-Pack安全性,则必须配置TLS以进行节点间通信。

注意

此要求适用于具有多个节点的群集,并与具有在外部接口上侦听的单个节点群集。使用回送接口的单节点群集不具备此要求。有关更多信息,请参阅 加密通信。

为每个Elasticsearch节点生成节点证书。

在每个Elasticsearch节点上启用TLS。

2.5 启动Elasticsearch。

?

1

bin/elasticsearch

我运行结果报错

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

[es@biluos elasticsearch-6.2.0]$ bin/elasticsearch

Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /home/es/elasticsearch/elasticsearch-6.2.0/config/elasticsearch.keystore

Likely root cause: java.nio.file.AccessDeniedException: /home/es/elasticsearch/elasticsearch-6.2.0/config/elasticsearch.keystore

        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)

        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)

Refer to the log for complete error details.

我猜测是文件权限的问题

[es@biluos elasticsearch-6.2.0]$ cd config/

[es@biluos config]$ ll

total 28

drwxrwxr-x 2 es   es   4096 Feb  9 14:34 discovery-file

-rw-rw---- 1 root root  416 Feb 10 10:13 elasticsearch.keystore

-rw-rw---- 1 es   es   3088 Feb  9 16:21 elasticsearch.yml

-rw-rw---- 1 es   es   2767 Feb  9 14:05 jvm.options

-rw-rw---- 1 es   es   5091 Feb  2 01:28 log4j2.properties

drwxr-x--- 2 es   es   4096 Feb 10 10:13 x-pack

# 发现真的是文件权限问题

# 修改权限

[es@biluos config]$ chown es:es elasticsearch.keystore

chown: changing ownership of `elasticsearch.keystore': Operation not permitted

[es@biluos config]$ su root

Password:

[root@biluos config]# pwd

/home/es/elasticsearch/elasticsearch-6.2.0/config

[root@biluos config]# ll

total 28

drwxrwxr-x 2 es   es   4096 Feb  9 14:34 discovery-file

-rw-rw---- 1 root root  416 Feb 10 10:13 elasticsearch.keystore

-rw-rw---- 1 es   es   3088 Feb  9 16:21 elasticsearch.yml

-rw-rw---- 1 es   es   2767 Feb  9 14:05 jvm.options

-rw-rw---- 1 es   es   5091 Feb  2 01:28 log4j2.properties

drwxr-x--- 2 es   es   4096 Feb 10 10:13 x-pack

[root@biluos config]# chown es:es elasticsearch.keystore

[root@biluos config]# ll

total 28

drwxrwxr-x 2 es es 4096 Feb  9 14:34 discovery-file

-rw-rw---- 1 es es  416 Feb 10 10:13 elasticsearch.keystore

-rw-rw---- 1 es es 3088 Feb  9 16:21 elasticsearch.yml

-rw-rw---- 1 es es 2767 Feb  9 14:05 jvm.options

-rw-rw---- 1 es es 5091 Feb  2 01:28 log4j2.properties

drwxr-x--- 2 es es 4096 Feb 10 10:13 x-pack

[root@biluos config]# su es

[es@biluos config]$ cd ../

[es@biluos elasticsearch-6.2.0]$ bin/elasticsearch

Exception in thread "main" org.elasticsearch.bootstrap.Bo[2018-02-10T10:22:12,398][INFO ][o.e.n.Node               ] [node-1] initializing ...

[2018-02-10T10:22:12,537][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [7.6gb], net total_space [25.4gb], types [rootfs]

[2018-02-10T10:22:12,538][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [1.9gb], compressed ordinary object pointers [true]

[2018-02-10T10:22:12,607][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [Wquj4gYuTteo7M5uXzSBiQ]

[2018-02-10T10:22:12,608][INFO ][o.e.n.Node               ] [node-1] ver

运行成功,但是 在浏览器访问需要密码

这里写图片描述

我输入密码es的账户和密码发现不对。然后看2.6

2.6 设置所有内置用户的密码。该setup-passwords命令是第一次设置内置用户密码的最简单的方法。

例如,您可以运行在“互动”模式下的命令,它会提示您为输入新的密码elastic,kibana和logstash_system用户:

?

1

bin/x-pack/setup-passwords interactive

重要

该setup-passwords命令使用临时引导程序密码,该命令在命令成功运行后不再有效。您不能setup-passwords再次运行该 命令。相反,您可以从Kibana中的管理>用户 UI 更新密码或使用安全用户API。

有关更多信息,请参阅 设置内置用户密码。

我运行这个命令:

?

1

2

3

4

5

6

[es@biluos elasticsearch-6.2.0]$ bin/x-pack/setup-passwords interactive

Connection failure to: https://192.168.10.173:9200/_xpack/security/_authenticate?pretty failed: Connection refused (Connection refused)

ERROR: Failed to connect to elasticsearch at https://192.168.10.173:9200/_xpack/security/_authenticate?pretty. Is the URL correct and elasticsearch running?

[es@biluos elasticsearch-6.2.0]$

可能是我没开启服务,所以另起一个窗口

?

1

2

3

4

5

[es@biluos elasticsearch-6.2.0]$

[es@biluos elasticsearch-6.2.0]$ bin/elasticsearch

[2018-02-10T10:33:41,743][INFO ][o.e.n.Node               ] [node-1] initializing ...

[2018-02-10T10:33:41,933][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [7.6gb], net total_space [25.4gb], types [rootfs]

[2018-02-10T10:33:41,935][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [1.9gb], compressed ordinary object pointers [true]

这里再次运行要给许多插件设置了密码

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

[es@biluos elasticsearch-6.2.0]$ 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]

运行成功,但是 在浏览器访问需要密码,我以为是es用户,密码是我刚刚设置的,结果还是不对,最后使用Enter password for [elastic]中的elastic当用户名,密码刚刚设置的访问成功。

浏览器输入https://192.168.10.X:9200/,显示结果

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

{

  "name" : "node-1",

  "cluster_name" : "my-application",

  "cluster_uuid" : "HG06BeIMTsqTe4L93thUpw",

  "version" : {

    "number" : "6.2.0",

    "build_hash" : "37cdac1",

    "build_date" : "2018-02-01T17:31:12.527918Z",

    "build_snapshot" : false,

    "lucene_version" : "7.2.1",

    "minimum_wire_compatibility_version" : "5.6.0",

    "minimum_index_compatibility_version" : "5.0.0"

  },

  "tagline" : "You Know, for Search"

}

2.7 我们看看安装X-Pack都生成了什么

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

[es@biluos elasticsearch-6.2.0]$ cd plugins/

[es@biluos plugins]$ ll

total 4

drwxr-xr-x 11 root root 4096 Feb 10 10:13 x-pack

[es@biluos plugins]$ cd x-pack/

[es@biluos x-pack]$ ll

total 40

-rw-r--r-- 1 root root  775 Feb 10 10:13 meta-plugin-descriptor.properties

drwxr-xr-x 2 root root 4096 Feb 10 10:13 x-pack-core

。。。。。

drwxr-xr-x 2 root root 4096 Feb 10 10:13 x-pack-watcher

# 上面可以看到生成的x-pack文件权限不是es,修改

[es@biluos x-pack]$ exit

exit

[root@biluos elasticsearch-6.2.0]# chown -R es:es /home/es/elasticsearch/

[root@biluos elasticsearch-6.2.0]# su es

[es@biluos elasticsearch-6.2.0]$ cd plugins/x-pack/

[es@biluos x-pack]$ ll

total 40

-rw-r--r-- 1 es es  775 Feb 10 10:13 meta-plugin-descriptor.properties

drwxr-xr-x 2 es es 4096 Feb 10 10:13 x-pack-core

drwxr-xr-x 2 es es 4096 Feb 10 10:13 x-pack-deprecation

。。。。。

drwxr-xr-x 2 es es 4096 Feb 10 10:13 x-pack-watcher

# bin目录下也有一些运行命令

[es@biluos x-pack]$ cd ../../bin/

[es@biluos bin]$ ll

total 260

-rwxr-xr-x 1 es es   1557 Feb  2 01:28 elasticsearch

。。。。。

drwxr-xr-x 2 es es   4096 Feb 10 10:13 x-pack

[es@biluos bin]$ cd x-pack/

[es@biluos x-pack]$ ll

total 96

-rwxr-xr-x 1 es es 298 Feb 10 10:13 certgen

-rwxr-xr-x 1 es es 376 Feb 10 10:13 certgen.bat

-rwxr-xr-x 1 es es 290 Feb 10 10:13 certutil

-rwxr-xr-x 1 es es 368 Feb 10 10:13 certutil.bat

-rwxr-xr-x 1 es es 307 Feb 10 10:13 croneval

-rwxr-xr-x 1 es es 385 Feb 10 10:13 croneval.bat

-rwxr-xr-x 1 es es 299 Feb 10 10:13 extension

-rwxr-xr-x 1 es es 377 Feb 10 10:13 extension.bat

-rwxr-xr-x 1 es es 314 Feb 10 10:13 migrate

-rwxr-xr-x 1 es es 392 Feb 10 10:13 migrate.bat

-rwxr-xr-x 1 es es 296 Feb 10 10:13 saml-metadata

-rwxr-xr-x 1 es es 374 Feb 10 10:13 saml-metadata.bat

-rwxr-xr-x 1 es es 312 Feb 10 10:13 setup-passwords

-rwxr-xr-x 1 es es 390 Feb 10 10:13 setup-passwords.bat

-rwxr-xr-x 1 es es 300 Feb 10 10:13 syskeygen

-rwxr-xr-x 1 es es 378 Feb 10 10:13 syskeygen.bat

-rwxr-xr-x 1 es es 300 Feb 10 10:13 users

-rwxr-xr-x 1 es es 378 Feb 10 10:13 users.bat

-rwxr-xr-x 1 es es 120 Feb 10 10:13 x-pack-env

-rwxr-xr-x 1 es es  71 Feb 10 10:13 x-pack-env.bat

-rwxr-xr-x 1 es es 164 Feb 10 10:13 x-pack-security-env

-rwxr-xr-x 1 es es 116 Feb 10 10:13 x-pack-security-env.bat

-rwxr-xr-x 1 es es 163 Feb 10 10:13 x-pack-watcher-env

-rwxr-xr-x 1 es es 115 Feb 10 10:13 x-pack-watcher-env.bat

[es@biluos x-pack]$ ../../bin/elasticsearch-plugin --help

A tool for managing installed elasticsearch plugins

Commands

--------

list - Lists installed elasticsearch plugins

install - Install a plugin

remove - removes a plugin from Elasticsearch

Non-option arguments:

command             

Option         Description       

------         -----------       

-h, --help     show help         

-s, --silent   show minimal output

-v, --verbose  show verbose output

[es@biluos x-pack]$ ../../bin/elasticsearch-plugin list

x-pack

        x-pack-core

        x-pack-deprecation

        x-pack-graph

        x-pack-logstash

        x-pack-ml

        x-pack-monitoring

        x-pack-security

        x-pack-upgrade

        x-pack-watcher

[es@biluos x-pack]$

这里有个疑问,在2.6中这里给kibana设置了密码,但是我却没找到kibana,应该是需要单独安装。请看下节,讲解安装kibana

2.7 可选:配置Java客户端。

2.8 在Kibana上安装X-Pack。

2.9 在Logstash上安装X-Pack。

3 在DEB / RPM软件包安装上安装X-Pack

如果使用DEB / RPM软件包来安装Elasticsearch,默认情况下会安装Elasticsearch
/usr/share/elasticsearch并将配置文件存储在其中/etc/elasticsearch。(有关默认路径的完整列表,请参阅 Elasticsearch参考中的Debian目录布局和 RPM目录布局。)

要在DEB / RPM软件包安装上安装X-Pack,您需要以超级用户权限运行 bin/plugin install该/usr/share/elasticsearch目录:

?

1

2

cd /usr/share/elasticsearch

sudo bin/elasticsearch-plugin install x-pack

注意

如果配置文件不在/etc/elasticsearch你需要通过设置环境变量来指定配置文件的位置ES_PATH_CONF通过ES_PATH_CONF=

发布了112 篇原创文章 · 获赞 266 · 访问量 26万+

猜你喜欢

转载自blog.csdn.net/fujiakai/article/details/88573578