Linux installation ElasticSearch [centOs7, ElasticSearch7.4.2]

1, the priority of all articles published in the personal blog: https://www.xdx97.com

2, the follow-up if there are changes, it may forget to update the CSDN, for the inconvenience, sorry.

3, personal blog this article address: https://www.xdx97.com/article?bamId=643489138867175424

Article from: https://blog.csdn.net/msllws/article/details/102807605

Step 1: Install the JDK 1.8 version of the above and in view JDK command

 java -version

Step two: Download ElasticSearch Download tar.gz

1. Download https://elasticsearch.cn/download/
2, download time off your VPN, otherwise the download is very slow
under 3, download good, the installation package uploaded to the / usr / local directory

The third step: Extract Configuration

1, extract

tar -xzvf elasticsearch-7.4.2-linux-x86_64\ .tar.gz 

2, moves ElasticSearch file directory, modify the configuration file vim config / elasticsearch.yml, add the following configuration at the end:

xpack.ml.enabled: false
network.host: 0.0.0.0
http.port: 9210
node.name: my-es
cluster.initial_master_nodes: ["my-es"]
 
#memory
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

Step Four: Create user ES, ES can not start with a root

#添加用户
useradd es

#设置密码
passwd es

#赋予权限
chown es:es -R /usr/local/elasticsearch-7.4.2/

Step 5: Additional Configuration

vim /etc/sysctl.conf 

Add the following configuration and then execute sysctl -p

vm.max_map_count=262144

Configuration files in server memory about elasticsearch-7.4.1 / config / jvm.options
There is a problem, I set it to 128m, start no problem. When I add a few worth the time inside. On the error (out of memory), so this should pay attention

vim config/jvm.options

-Xms128m
-Xmx128m

Here Insert Picture Description

Step Six: Start

Switch to the user es

su es
./bin/elasticsearch

After a successful start to print a lot of logs, do not bother. And then open a window to perform

 curl 127.0.0.1:9200

Here Insert Picture Description

Other: background boot

1 Start

 ./elasticsearch -d

2, shut down, first find the process ID, then -9 xxx the kill
PS -ef | grep Elastic

Published 302 original articles · won praise 127 · views 530 000 +

Guess you like

Origin blog.csdn.net/Tomwildboar/article/details/103122066