Elasticsearch installation
Create a dedicated user for Elasticsearch
- increase user
useradd -d /home/es -m es
2. Set password
passwd es
Install Elasticsearch
- Use
root
user uploades
installation package
scp elasticsearch-7.2.0-linux-x86_64.tar.gz [email protected]:/download/
- Unzip
tar -zxvf elasticsearch-7.2.0-linux-x86_64.tar.gz
Modify the configuration file
-
Modify the
elasticsearch.yml
configuration file -
modify
limits.conf
vi /etc/security/limits.conf
-
Add the following content
* soft nofile 65536 * hard nofile 65536 * soft nproc 4096 * hard nproc 4096
-
Modify the configuration file to
sysctl.conf
add the following configurationvi /etc/sysctl.conf vm.max_map_count=655360
-
Execute the command to take effect
sysctl -p
JAVA environment installation (JDK 1.12)
installation
- Use
root
user uploadJDK
installation packagescp jdk-12.0.1_linux-x64_bin.tar.gz [email protected]:/download/
- Create java installation directory
mkdir /usr/local/java/
3. Unzip to the installation directory
tar -zxvf jdk-12.0.1_linux-x64_bin.tar.gz -C /usr/local/java/
Set environment variables
- open a file
vim /etc/profile
- Add at the end
JAVA_HOME=/usr/local/java/jdk-12.0.1 CLASSPATH=$JAVA_HOME/lib/ PATH=$PATH:$JAVA_HOME/bin export PATH JAVA_HOME CLASSPATH
- Make environment variables take effect
source /etc/profile
Check if the installation is successful
java -version
start up Elasticsearch
cd /download/elasticsearch-7.2.0/
# 前台启动
./bin/elasticsearch
# 后台启动
./bin/elasticsearch -d
Check if the installation is successful
Please visit http://ip地址:9200
If the above prompt appears, the Elasticsearch
installation is successful