Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Elasticsearch under Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to install Elasticsearch under Linux", the content is simple and easy to understand, organized clearly, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to install Elasticsearch under Linux" this article bar.

Elasticsearch is a Lucene-based search server. It provides a full-text search engine with distributed multi-user capabilities, based on RESTful web interfaces. Elasticsearch, developed in Java and distributed as open source under the Apache License, is a popular enterprise-class search engine.

Download elasticsearch

Go directly to elasticsearch's official website and download the latest installation package: https://www.elastic.co/downloads/elasticsearch. This tutorial uses version 5.1.1.

Second, install elasticsearch

Upload the downloaded installation package to centos, or download it directly from centos using the wget command.

1. Decompression

unzip elasticsearch-5.1.1.zip

2. Install jdk1.8

To install elasticsearch the official recommendation is to use version 1.8 of jdk, so install and deploy jdk first. For more information on jdk deployment see other resources on the web.

3. Operation

cd bin./ elasticsearch

Some common errors may occur: (1) elasticsearch cannot be run with root privileges, and this error occurs: Exception in thread "main" java. lang. RuntimeException: don't run elasticsearch as root.

Because elasticsearch does not allow you to run it directly as root, create a new user. Workaround:

Step 1: liunx Create a new user adduser XXX and password the created user passwd XXX Enter the password twice. Step 2: Switch the user su XXX just created and then execute elasticsearch to show that Permission denied is insufficient. Step 3: Give the new XXX permission, chmod 777 * This is not good, because the user itself does not have permission, certainly can not give themselves permission to pay. So you have to log in as root. Step 4: Root grants XXX permissions, chown -R XXX /your elasticsearch installation directory.

Max number of threads for elasticsearch too low Solution:

Modify/etc/security/limits.confvim /etc/security/limits.conf Add a line: xxx - nproc 2048 where "xxx" is the user who started elasticsearch

Max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

Modify/etc/sysctl.confvim /etc/sysctl.conf Add a line: vm.max_map_count=262144, add the execution: sysctl -p, see if the result is vm.max_map_count = 262144

The result of a successful run is that it will appear started. Localhost:9200 or 127.0.0.1: 9200 may be accessible, but according to IP: 9200 is not accessible, at this time modify: elasticsearch.yaml file.

4, Unable to install plug-in license

bin/elasticsearch-plugin install licenseERROR: Unknown plugin license

Cause: Plugin commands have changed since ElasticSearch 6.0.0. Solution: Install all plugins using the latest commands.

bin/elasticsearch-plugin install x-pack

5. Test operation

Enter http://192.168.1.100:9200/in the browser, if it appears:

This means that the deployment is successful, where cluster_name:my-demo means that I modified the default cluster_name.

The above is "How to install Elasticsearch under Linux" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report