1. Download the ElasticSearch
1.1 Official Website Download address
www.elastic.co/products/el…
1.2 Remote Download
Wget HTTP: / / https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.3.tar.gzCopy the code
2. Copy the elasticSearch compressed file to the specified directory
Create user “es”, “es”, “es”, “es”
adduser es
Copy the code
2.2 Specify the User password
passwd es
Copy the code
2.3 Creating An ES group Create an ES group
groupadd esgroup
Copy the code
2.4 Setting the owning user of the MODIFIED ES Compressed File in the Root Directory
Chown -r es elasticsearch - 6.4.0Copy the code
2.5 Changing the Owning Group of a File
The CHGRP -r esgroup elasticsearch - 6.4.3Copy the code
3. Decompress and install the ES
3.1 Switching users to ES
su es
Copy the code
3.2 Decompressing Files
The tar - XZVF elasticsearch - 6.4.3. Tar. GzCopy the code
3.3 Enter ElasticSearch-6.4.3 and start ElasticSearch. If the started command is displayed in the log, the ElasticSearch is started successfully
./elasticsearch
Copy the code
3.4 Verifying startup Success Enter curl localhost:9200
3.5 Only the local ElasticSearch service can be accessed. To access the ElasticSearch service from the Internet, modify the configuration file config/ Elasticsearch. yml
3.6 The following errors may occur during startup after modification
Open the elasticSearch. yml configuration file and change the value to 0.0.0.0
Host: 192.168.0.1 is changed to the local IP address 0.0.0.0Copy the code
3.7 The following three errors may occur during startup after modification
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [3802] for user [esyonghu] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
Copy the code
Solution: Switch to user root
A The first error requires that the current user’s soft and hard call limits be increased
Switch to the root user, then execute the vim/etc/security/limits the conf note es add the following code at the end of the file name for the user Please modify according to actual situation
es soft nofile 65536
es hard nofile 131072
es soft nproc 2048
es hard nproc 4096
Copy the code
B. the second mistakes need to modify the vim/etc/security/limits. D / 20 – nproc. Conf file
Add to the file
esyonghu soft nproc 4096
Copy the code
C The third error requires modification to /etc/sysctl.conf
Run the vim /etc/sysctl.conf command to edit the sysctl.conf file and add the following content to the file
Combined with the vm. Max_map_count = 262144Copy the code
To make the change take effect, run sysctl -p
sysctl -p
Copy the code
4. Start the es
Switch to esyonghu again and go to the ElasticSearch file directory to start ElasticSearchEnter your IP address in the browser. If the following page is displayed, the server is successfully started