ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Linux安装elasticsearch6.4.1

2021-03-17 10:58:47  阅读:215  来源: 互联网

标签:centos root VM elasticsearch6.4 6.4 elasticsearch Linux 安装 es


(1)环境说明
服务器环境:CentOS Linux 7

[root@VM-0-3-centos ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

jdk环境:jdk1.8

[root@VM-0-3-centos app]# java -version
java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)

es版本:6.4.1

[root@VM-0-3-centos elasticsearch]# ll
total 123908
-rw-r--r-- 1 root root 97924081 Oct  9  2019 elasticsearch-6.4.1.tar.gz
-rw-r--r-- 1 root root  4502531 Oct  9  2019 elasticsearch-analysis-ik-6.4.1.zip
-rw-r--r-- 1 root root 24447542 Oct  9  2019 ingest-attachment-6.4.1.zip

资料下载连接
链接:https://pan.baidu.com/s/1Ml8b92zzXf9BgKiXjd-H_A
提取码:9527

(2)安装步骤
1)解压elasticsearch-6.4.1.tar.gz

[root@VM-0-3-centos elasticsearch]# tar -xzvf elasticsearch-6.4.1.tar.gz

2)将插件解压到elasticsearch-6.4.1/plugins目录下

[root@VM-0-3-centos elasticsearch]# unzip -d elasticsearch-6.4.1/plugins/elasticsearch-analysis-ik-6.4.1/ elasticsearch-analysis-ik-6.4.1.zip  
[root@VM-0-3-centos elasticsearch]# unzip -d elasticsearch-6.4.1/plugins/ingest-attachment-6.4.1/ ingest-attachment-6.4.1.zip

[root@VM-0-3-centos elasticsearch]# cd elasticsearch-6.4.1/plugins/
/app/software/elasticsearch/elasticsearch-6.4.1/plugins
[root@VM-0-3-centos plugins]# ll
total 8
drwxr-xr-x 3 root root 4096 Mar 17 09:34 elasticsearch-analysis-ik-6.4.1
drwxr-xr-x 2 root root 4096 Mar 17 09:34 ingest-attachment-6.4.1

3)修改配置文件elasticsearch-6.4.1/config/elasticsearch.yml

[root@VM-0-3-centos config]# vim elasticsearch.yml

在末尾追加

#自定义配置
network.host: 0.0.0.0
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"

4)创建es用户
不能用root用户启动。要创建es用户组和用户,授权elasticsearch-6.4.1目录给es用户

[root@VM-0-3-centos elasticsearch]# groupadd es
[root@VM-0-3-centos elasticsearch]# useradd es -g es -p elasticsearch-6.4.1
[root@VM-0-3-centos elasticsearch]# chown -R es:es elasticsearch-6.4.1
[root@VM-0-3-centos elasticsearch]# ll
total 95636
drwxr-xr-x 8 es   es       4096 Sep 14  2018 elasticsearch-6.4.1

5)切换su用户,启动服务

[root@VM-0-3-centos elasticsearch-6.4.1]# su es
[es@VM-0-3-centos elasticsearch-6.4.1]$ ./bin/elasticsearch

6)启动失败报错:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]启动失败报错:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:
使用root用户编辑/etc/security/limits.conf

[root@VM-0-3-centos ~]# vim /etc/security/limits.conf

在后面新增自定义配置

# 自定义配置
* soft nofile 65536
* hard nofile 65536

使用root用户编辑/etc/sysctl.conf

[root@VM-0-3-centos ~]# vim /etc/sysctl.conf

在后面新增自定义配置

# 自定义配置
# vm.max_map_count=655360

然后重新加载系统参数

[root@VM-0-3-centos ~]# sysctl -p

7)重新启动

[es@VM-0-3-centos elasticsearch-6.4.1]$ ./bin/elasticsearch

在这里插入图片描述
8)访问(x.x.x.x:9200)验证成功。
在这里插入图片描述

标签:centos,root,VM,elasticsearch6.4,6.4,elasticsearch,Linux,安装,es
来源: https://blog.csdn.net/qq_28959339/article/details/114906689

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有