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 for Linux

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to install Elasticsearch in Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install Elasticsearch in Linux.

Elasticsearch is a Lucene-based search server. It provides a full-text search engine with distributed multi-user capability, based on RESTful web interface. Developed in the Apache language and released as open source under the Apache license terms, Java is a popular enterprise search engine.

Linux install Elasticsearch step 1, download

Go to the Elasticsearch official website to download it yourself, or download version 7.6.2 (the latest version) via the link below.

Link: https://pan.baidu.com/s/1bfSHYpe6IY0cpsgIVT3Z5Q extraction code: kudt

2. Installation

Upload and download the compressed package to your own server directory, and here I upload it to the Linux directory as follows:

Decompress:

Tar-zxvf elasticsearch-7.6.2-linux-x86_64.tar.gz

Move Elasticsearch to the / usr/local/ directory

Mv elasticsearch-7.6.2 / usr/local/

Introduction to the catalogue of Elasticsearch

To create a data folder, you need to use the

Mkdir data

Go to the cofig directory

Cd config/

Modify elasticsearch.yml core configuration file

Vim elasticsearch.yml

Modify the content:

Cluster.name: elasticsearch

Node.name: es-node0

Path.data: / usr/local/elasticsearch-7.6.2/data

Path.logs: / usr/local/elasticsearch-7.6.2/logs

Http.port: 9200

Network.host: 0.0.0.0

Cluster.initial_master_nodes: ["es-node0"]

Then modify the jvm.options configuration file

Vim jvm.options

Because the ES is installed in the virtual machine, it is not recommended to modify the memory. If the production environment does not need to be modified

It's okay.

Note: ES startup cannot be done as a ROOT user, so you need to create a user

Create a user: *

Useradd user-es

Authorization:

Chown-R user-es:user-es / usr/local/elasticsearch-7.6.2

Switch to user-es user and enter bin to start elasticsearch

Su user-es

Cd / usr/local/elasticsearch-7.6.2/bin

. / elasticsearch

If the following error message appears (the maximum number of files is too small, the thread is too small, the memory is too low):

The corresponding environment configuration needs to be modified.

Switch to ROOT user modify / etc/security/limits.conf profile

Su-password is required for switching root users

Vi / etc/security/limits.conf

The modification information is as follows:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

Then modify another configuration file

Vi / etc/sysctl.conf

The modification information is as follows:

Vm.max_map_count = 262145

Save exit, refresh configuration file

Sysctl-p

Now to restart ES, remember to switch to the user-es user, and you will see the following message after successful startup:

Su user-es

Cd / usr/local/elasticsearch-7.6.2/bin

. / elasticsearch

Elasticsearch provides two ports, 9300 and 9200, one common and one private.

You can test whether elasticsearch is started by typing http://192.168.232.3:9200/ in the browser

Turning off elasticsearch can directly Ctrl+C because it is currently running in the foreground.

Let elasticsearch run in the background, using the following command:

. / elasticsearch-d

Jps

Kill 'process number'

Ps-ef | grep elasticsearch

At this point, I believe you have a deeper understanding of "Linux how to install Elasticsearch". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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