es5.4.0-CentOS-6.5-x86_64安装文档

1.环境说明

本示例安装环境如下:

系统:CentOS-6.5-x86_64

主机ip:192.168.1.237

安装根目录:/opt/es/

Jdk:要求jdk8及以上版本,本示例为:jdk1.8.0_131

2.下载安装包并拷贝到centos上

下载地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.zip

路径:/opt/es/elasticsearch-5.4.0

3.创建es用户

es不能运行在root用户下,需要创建单独的用户

useradd es

chown -R es:es /opt/es/elasticsearch-5.4.0/

bin目录下的文件分配可执行权限

cd /opt/es/elasticsearch-5.4.0/bin/

chmod  777 elasticsearch*

4.设置系统参数

1)vi /etc/security/limits.conf

添加如下内容

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

2)vi /etc/security/limits.d/90-nproc.conf

修改如下内容:

* soft nproc 1024

#修改为

* soft nproc 2048

3)vi /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令:

sysctl -p

5.修改配置文件

cluster.name: es-test

node.name: node-1

node.master: true

node.data: true

#启动异常:ERROR: bootstrap checks failed,因为Centos6不支持SecComp,而默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。

bootstrap.system_call_filter: false

network.host: 0.0.0.0

discovery.zen.ping.unicast.hosts: ["192.168.1.237:9300"]

# 增加新的参数,这样head插件可以访问es

http.cors.enabled: true

http.cors.allow-origin: "*"

6.启动es,检查是否成功

cd /opt/es/elasticsearch-5.4.0

./bin/elasticsearch

http://192.168.1.237:9200/检查是否安装成功

如果不能连接,检查防火墙和iptables

关闭防火墙

setenforce 0

设置iptables,开放9200端口

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 9200 -j ACCEPT

service iptables restart

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容