elasticsearch之旅----------------Linux中安装部署

elasticsearch学习----------------Linux中安装部署

    • 一.安装前提
    • 二. 获取相应的安装包
    • 三.配置并且安装es
    • 四. 安装elasticsearch-head 插件
          • 4.1 node安装elasticsearch-head插件
          • 4.2 elasticsearch在启动过程可能会报错

一.安装前提

1.linux中安装了jdk,并且配置了java环境变量(如果不会可以自行百度)

2.elasticsearch 5点几 的版本要求 jdk的版本在 1.8以上

二. 获取相应的安装包

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"

四. 安装elasticsearch-head 插件

4.1 node安装elasticsearch-head插件
1.获取elasticsearch-head插件

wget  https://github.com/mobz/elasticsearch-head/archive/master.zip

2.解压head 插件
   unzip master.zip

3. head插件是基于node开发的,所以运行该插件需要提前安装好node环境

通过node将head插件运行起来

4.2 elasticsearch在启动过程可能会报错
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: "*"




你可能感兴趣的:(elasticsearch之旅----------------Linux中安装部署)