Elasticsearch5.x安装及常见错误的解决方法

Elasticsearch是基于java开发的,机器上必须要先java环境,elasticsearch5.x建议用jdk8的最新版本。下面介绍elasticsearch5.x的安装步骤:

一、安装Elasticsearch5.x

1.1 下载并解压

tar zxvf elasticsearch-5.4.0.tar.gz

1.2 启动

cd elasticsearch-5.4.0
bin/elasticsearch (-d)  # -d 以后台方式启动

输出

[2019-07-06T00:46:40,496][INFO ][o.e.n.Node ] [] initializing ...
[2019-07-06T00:46:40,607][INFO ][o.e.e.NodeEnvironment ] [dwEr1_X] using [1] data paths, mounts [[/home (/dev/cciss/c0d0p8)]], net usable_space [243.5gb], net total_space [1.2tb], spins? [possibly], types [ext4]
[2019-07-06T00:46:40,608][INFO ][o.e.e.NodeEnvironment ] [dwEr1_X] heap size [1.9gb], compressed ordinary object pointers [true]
[2019-07-06T00:46:40,648][INFO ][o.e.n.Node ] node name [dwEr1_X] derived from node ID [dwEr1_XnTHGXEhaSQveAMg]; set [node.name] to override
[2019-07-06T00:46:40,649][INFO ][o.e.n.Node ] version[5.4.0], pid[22486], build[780f8c4/2017-04-28T17:43:27.229Z], OS[Linux/2.6.32_1-22-0-0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_192/25.192-b12]
[2019-07-06T00:46:42,490][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [aggs-matrix-stats]
[2019-07-06T00:46:42,490][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [ingest-common]
[2019-07-06T00:46:42,490][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [lang-expression]
[2019-07-06T00:46:42,490][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [lang-groovy]
[2019-07-06T00:46:42,491][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [lang-mustache]
[2019-07-06T00:46:42,491][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [lang-painless]
[2019-07-06T00:46:42,491][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [percolator]
[2019-07-06T00:46:42,491][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [reindex]
[2019-07-06T00:46:42,492][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [transport-netty3]
[2019-07-06T00:46:42,492][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded module [transport-netty4]
[2019-07-06T00:46:42,493][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded plugin [elasticsearch-vector-scoring]
[2019-07-06T00:46:42,493][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded plugin [sql]
[2019-07-06T00:46:42,493][INFO ][o.e.p.PluginsService ] [dwEr1_X] loaded plugin [x-pack]
[2019-07-06T00:46:44,453][DEBUG][o.e.a.ActionModule ] Using REST wrapper from plugin org.elasticsearch.xpack.XPackPlugin
[2019-07-06T00:46:44,784][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/23807] [Main.cc@128] controller (64 bit): Version 5.4.0 (Build 120b96fa7f6fa7) Copyright (c) 2017 Elasticsearch BV
[2019-07-06T00:46:44,815][INFO ][o.e.d.DiscoveryModule ] [dwEr1_X] using discovery type [zen]
[2019-07-06T00:46:45,762][INFO ][o.e.n.Node ] initialized
[2019-07-06T00:46:45,762][INFO ][o.e.n.Node ] [dwEr1_X] starting ...
[2019-07-06T00:46:46,079][INFO ][o.e.t.TransportService ] [dwEr1_X] publish_address {10.252.30.51:19300}, bound_addresses {0.0.0.0:19300}
[2019-07-06T00:46:46,089][INFO ][o.e.b.BootstrapChecks ] [dwEr1_X] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
^C[2019-07-06T00:46:47,721][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started
[2019-07-06T00:46:47,721][INFO ][o.e.n.Node ] [dwEr1_X] stopping ...
[2019-07-06T00:46:47,757][INFO ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [dwEr1_X] publish_address {10.252.30.51:19200}, bound_addresses {0.0.0.0:19200}

1.3 检测是否启动成功

在浏览器或终端上访问地址:http://localhost:9200

 

{
  "name" : "PleU5uo",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "xwHSgZrjQO6sraj7I2yfHg",
  "version" : {
    "number" : "5.4.0",
    "build_hash" : "780f8c4",
    "build_date" : "2017-04-28T17:43:27.229Z",
    "build_snapshot" : false,
    "lucene_version" : "6.5.0"
  },
  "tagline" : "You Know, for Search"
}

 

出现如上信息,表示elasticsearch安装成功。 

 

二、安装常见问题

问题一:max file descriptors [10240] for elasticsearch process likely too low, increase to at least [65536]

解决方法:切换到root用户,编辑 vim /etc/security/limits.conf文件,增加以下配置项:

* soft nofile 65536
* hard nofile 131072

保存文件修改后,需要重新登录用户,才会生效。

 

问题二: max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

解决方法:切换至root用户,编辑 vim /etc/sysctl.conf 文件,修改以下配置项:

vm.max_map_count=655360

保存退出后,执行: sysctl -p

 

问题三:system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

解决方法:修改 es 安装目录下 vim config/elasticsearch.yml配置文件,添加如下的配置:

bootstrap.system_call_filter: false

 

posted @ 2019-07-06 01:13  笑得开心  阅读(709)  评论(0编辑  收藏  举报