Official website download address
https://www.elastic.co/cn/downloads/elasticsearch
Select the version as LINUX and the
current version as es-7.6.2
Use the tar command to extract tar -zxvf elasticsearch-7.6.2-linux-x86_64.tar.gz
Then move the mv command to the / usr / loacl directory. Currently, I'm in / usr / software, so do this step
cd command to enter
bin: the executable file is inside, the command to run es is inside this, contains some script files and so on
config: configuration file directory
JDK: java environment
lib: dependent jar, class library
logs: log file
modules: es related modules
plugins: plug-in
data that can be developed by yourself : this directory is not available, create it yourself, use-> mkdir data later, this is used as the index directory
Create data directory mkdri data
Modify the core configuration file elasticearch.yml
Need to enter the cd / config
vim command in the config folder to open the file (vim elasticsearch.yml)
Set the cluster name Set the node name
Set the data file path and logs file path
Set up network access
Cluster node name
After setting, set jvm.options
Add user
ES does not allow root to operate es, you need to add users, the operation is as follows:
useradd esuser
chown -R esuser: esuser /usr/local/elasticsearch-7.4.2
su esuser
whoami
switch back to
cd /usr/local/elasticsearch-7.6.2/bin
and start
If there is an error
Then you need to switch to the root user to modify the configuration as follows:
vim /etc/security/limits.conf
- soft nofile 65536
- hard nofile 131072
- soft nproc 2048
- hard nproc 4096
Then modify vim /etc/sysctl.conf
Command refresh
sysctl -p
Switch back to su esuser user to restart
testing successfully