1.es 官网提供的安装包
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz
2.解压压缩包
tar -zxvf elasticsearch-6.6.1.tar.gz
三.配置并且安装es
1.为es在linux系统中添加用户以及用户组(原因是es 不能以root用户的身份启动)
groupadd es
useradd -g es es
2.将elasticsearch解压目录的权限赋予es用户
本次安装将es解压到 /home/q/elasticsearch目录下,执行下面的命令已经cd /home/q/elasticsearch目录之下
chown es elasticsearch-6.6.1 -R
3.启动 es
su es -c "/home/q/elasticsearch/elasticsearch-6.6.1/bin/elasticsearch -d"
1.配置 config目录中的jvm.options 文件
设置jvm堆内存的大小
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms2g
-Xmx2g
2.配置elasticsearch.yml文件设置,允许跨域访问,head插件需要elasticsearch通过跨域进行访问
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"