Elasticsearch5.5.2 Installation Tutorials

Source: Internet
Author: User

Recently learn Elasticsearch, by the way, to record the operation steps for future reference

Installation Environment CentOS Release 6.6

1, because Elasticsearch is based on Java write, so it needs Java support in the running environment, under Linux command: java-version, check whether the jar package is installed

Install Java version at least 1.8


2, first prepare to download Elasticsearch5.5.2 installation package

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.tar.gz


3, download to the/usr/local directory, unzip

TAR-ZXVF elasticsearch-5.2.2.tar.gz


4, because after Elasticsearch5.0, cannot use the root account to start, we first create a elasticsearch group and the account

Useradd elasticsearch-g elasticsearch-p Elasticsearch

Chown-r Elasticsearch:elasticsearch elasticsearch-5.2.2


5. Start Elasticsearch

Cd/usr/local/elasticsearch5.2.2/

Su Elasticsearch

./bin/elasticsearch


At this point, we see the following hints, and the instructions are successful.

[Plain]  View plain  copy  print? [elasticsearch@vmlnx-sma bin]$ ./elasticsearch   [2017-03-02t21:43:21,185][info ][ O.e.n.node               ] []  initializing ...   [2017-03-02t21:43:21,264][info ][o.e.e.nodeenvironment     ] [uY3prpy] using [1] data paths, mounts [[/  (/dev/mapper/ Volgroup-lv_root)]], net usable_space [43.5gb], net total_space [54.6gb],  spins? [possibly], types [ext4]   [2017-03-02t21:43:21,265][info ][ o.e.e.nodeenvironment    ] [uy3prpy] heap size [1.9gb],  compressed ordinary object pointers [true]   [2017-03-02t21:43:21,268][info  ][o.e.n.node               ] node name [uy3prpy] derived from node id [uy3prpyqthim5twauivwhq];  set [node.name] to override   [2017-03-02t21:43:21,271][info ][o.e.n.node                ] version[5.2.2 ], PID[5602], BUILD[F9D9B74/2017-02-24T17:26:45.835Z], OS[LINUX/3.10.5-3.EL6.X86_64/AMD64],  JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_121/25.121-b13]   [ 2017-03-02t21:43:22,226][info ][o.e.p.pluginsservice     ] [uy3prpy]  loaded module [aggs-matrix-stats]   [2017-03-02t21:43:22,226][info ][ O.e.p.pluginsservice     ] [uy3prpy] loaded module [ingest-common ]   [2017-03-02t21:43:22,226][info ][o.e.p.pluginsservice     ] [ Uy3prpy] loaded module&nbSp [lang-expression]   [2017-03-02t21:43:22,227][info ][o.e.p.pluginsservice      ] [uY3prpy] loaded module [lang-groovy]   [2017-03-02t21:43:22,227][ info ][o.e.p.pluginsservice     ] [uy3prpy] loaded module [ lang-mustache]   [2017-03-02t21:43:22,227][info ][o.e.p.pluginsservice      ] [uY3prpy] loaded module [lang-painless]   [2017-03-02t21:43:22,228][info  ][o.e.p.pluginsservice     ] [uy3prpy] loaded module [ percolator]   [2017-03-02t21:43:22,228][info ][o.e.p.pluginsservice      ] [uY3prpy] loaded module [reindex]   [2017-03-02t21:43:22,228][info ] [o.e.p.pluginsservice     ] [uy3prpy] loaded module [ transport-netty3]   [2017-03-02t21:43:22,229][info ][o.e.p.pluginsservice     ] [uy3prpy]  loaded module [transport-netty4]   [2017-03-02t21:43:22,230][info ][ o.e.p.pluginsservice     ] [uy3prpy] no plugins loaded    [2017-03-02t21:43:24,689][info ][o.e.n.node                ] initialized   [2017-03-02t21:43:24,689][info ][ o.e.n.node               ] [ uy3prpy] starting ...   [2017-03-02t21:43:24,929][info ][o.e.t.transportservice    ] [uy3prpy] publish_address {10.245.250.65:9300}, bound_addresses { 10.245.250.65:9300}   [2017-03-02t21:43:24,948][info ][o.e.b.bootstrapchecks     ] [uy3prpy] bound or publishing to a non-loopback or non-link-local address, enforcing  bootstrap checks   [2017-03-02t21:43:28,010][info ][o.e.c.s.clusterservice    ] [uy3prpy] new_master {uy3prpy}{uy3prpyqthim5twauivwhq}{aqalbh68rcucwcpmhce6dw}{ 10.245.250.65}{10.245.250.65:9300}, reason: zen-disco-elected-as-master  ([0] nodes  Joined)    [2017-03-02t21:43:28,034][info ][o.e.h.httpserver          ] [uy3prpy] publish_address {10.245.250.65:9200}, bound_addresses { 10.245.250.65:9200}   [2017-03-02t21:43:28,034][info ][o.e.n.node                ] [uY3prpy] started   [ 2017-03-02t21:43:28,061][info ][o.e.g.gatewayservice     ] [uy3prpy]  Recovered [0] indices into cluster_state  

Perform Curl http://localhost:9200


Open another terminal for testing:
Curl ' Http://localhost:9200/?pretty '


You can see the following return information:


{
"Status": 200,
"Name": "Shrunken Bones",
"Version": {
"Number": "1.4.0",
"Lucene_version": "4.10"
},
"Tagline": "Know, for Search"
}


Indicates that the installation was successful.

But we want to be able to use IP access, then we need to set up the relevant content

Jump to Elasticsearch config profile, use vim to open elasticsearch.yml, find inside the "network.host", change it to native IP, save.


CD elasticsearch/config/


Vim Elasticsearch.yml


Restart Elasticsearch, and then use Http://192.168.37.137:9200/to access it.


Our common mistakes:


Issue One: Warning Prompt

[2016-11-06t16:27:21,712] [WARN] [O.e.b.jnanatives] Unable to install Syscall filter:

Java.lang.UnsupportedOperationException:seccomp unavailable:requires kernel 3.5+ with Config_seccomp and Config_ Seccomp_filter compiled in
At Org.elasticsearch.bootstrap.Seccomp.linuxImpl (seccomp.java:349) ~[elasticsearch-5.0.0.jar:5.0.0]
At Org.elasticsearch.bootstrap.Seccomp.init (seccomp.java:630) ~[elasticsearch-5.0.0.jar:5.0.0]

It was a warning that a large list of errors had been reported.

workaround : With the experience Linux version, there will be no such problem.

question two: Error:bootstrap checks failed

Max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
Max number of threads [1024x768] for user [Lishang] likely too low, increase to at least [2048]

FIX: switch to root user, edit limits.conf add similar to the following content

Vi/etc/security/limits.conf

Add the following content:

* Soft Nofile 65536

* Hard Nofile 131072

* Soft Nproc 2048

* Hard Nproc 4096

issue three : max number of threads [1024x768] for user [lish] likely too low, increase to at least [2048]

Workaround: switch to the root user and go to the LIMITS.D directory to modify the configuration file.

Vi/etc/security/limits.d/90-nproc.conf

Modify the following content:

* Soft Nproc 1024

#修改为

* Soft Nproc 2048

issue four : Max virtual memory Areas Vm.max_map_count [65530] likely too low, increase to at least [262144]

fix : Switch to root user to modify configuration sysctl.conf

Vi/etc/sysctl.conf

Add the following configuration:

vm.max_map_count=655360

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.