linux下es的安装

1,创建es文件夹

mkdir /home/local/elasticsearch

2,在线下载es安装包

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.2-linux-x86_64.tar.gz

3,解压安装包

tar -zxvf elasticsearch-7.13.2-linux-x86_64.tar.gz

4,创建es操作用户,非root

创建用户

useradd user-es

创建所属组

chown user-es:user-es -R /home/local/elasticsearch-7.13.2

5,设置使用es自带jdk

vim /home/local/elasticsearch-7.13.2/bin/elasticsearch

############## 添加配置解决jdk版本问题 ##############

# 将jdk修改为es中自带jdk的配置目录

export JAVA_HOME=/usr/local/elasticsearch-7.13.2/jdk

export PATH=$JAVA_HOME/bin:$PATH

if [ -x "$JAVA_HOME/bin/java" ]; then

        JAVA="/home/local/elasticsearch/elasticsearch-7.13.2/jdk/bin/java"

else

        JAVA=`which java`

fi

6,配置修改

sysctl -w vm.max_map_count=262144

vim /etc/sysctl.conf

vm.max_map_count=262144

7,启动

/home/local/elasticsearch/elasticsearch-7.13.2/bin/elasticsearch

8,设置后台启动

/home/local/elasticsearch/elasticsearch-7.13.2/bin/elasticsearch -d

你可能感兴趣的:(linux下es的安装)