Elasticsearch5.x installation and solutions to common errors

Elasticsearch is developed based on java. The java environment must be used first on the machine. The latest version of jdk8 is recommended for elasticsearch 5. X. The following describes the installation steps of elasticsearch5.x:

I. install Elasticsearch5.x

1.1 download and unzip

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz tar zxvf elasticsearch-5.4.0.tar.gz

1.2 boot

cd elasticsearch-5.4.0 bin/elasticsearch (-d)  # -d starting in the background mode


[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 {}, bound_addresses {}
[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 {}, bound_addresses {}

1.3 check whether the startup is successful

Access address on browser or terminal: 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"


The above message appears, indicating that elasticsearch is installed successfully.  


II. Common installation problems

Question 1: max file descriptors [10240] for elasticsearch process like too low, increase to at least [65536]

Solution: switch to root, edit vim /etc/security/limits.conf file, and add the following configuration items:

* soft nofile 65536
* hard nofile 131072

After saving and modifying the file, you need to log in the user again before it will take effect.


Question 2: Max virtual memory areas vm.max map [count [65530] almost too low, increase to at least [262144]

Solution: switch to root user, edit vim /etc/sysctl.conf file, and modify the following configuration items:


After saving and exiting, execute: sysctl -p


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

Solution: modify the vim config/elasticsearch.yml configuration file under the es installation directory, and add the following configuration:

bootstrap.system_call_filter: false

Tags: PHP ElasticSearch Java vim curl

Posted on Fri, 01 Nov 2019 02:03:05 -0700 by aceconcepts