CentOS6.5安装ElasticSearch6.2.3 CentOS6.5安装ElasticSearch6.2.3

CentOS6.5安装ElasticSearch6.2.3


1、Elastic 需要 Java 8 环境。(安装步骤:http://www.cnblogs.com/hunttown/p/5450463.html

2、安装包下载:

#官网地址

https://www.elastic.co/downloads/elasticsearch

3、新建用户

       Elastic高版本不建议使用root用户

(1)创建elastic用户组

[root@mycentos ~]# groupadd elastic

(2)创建用户elastic

useradd elastic(用户名) -g elastic(组名) -p 123456(密码)

[root@mycentos ~]# useradd elastic -g elastic -p 123456

4、解压安装包

       建议将安装包放到/usr/local目录下   .放到新建用户目录下,要不报错    错误: 找不到或无法加载主类 org.elasticsearch.tools.java_version_checker.JavaVersionChecker

[root@mycentos local]# unzip elasticsearch-6.2.3.zip
tar zxvf xxx.gz

5、添加权限

chown -R elastic elasticsearch-6.2.3

6、修改配置文件

(1)ERROR: bootstrap checks failed

        memory locking requested for elasticsearch process but memory is not locked

原因:锁定内存失败

解决方案:使用root用户,编辑limits.conf配置文件, 添加如下内容:

[root@mycentos ~]# vim /etc/security/limits.conf

* soft memlock unlimited
* hard memlock unlimited

备注:* 代表Linux所有用户名称,保存、退出、重新登录生效。

(2)ERROR: bootstrap checks failed

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

原因:无法创建本地文件问题,用户最大可创建文件数太小。

解决方案:使用root用户,编辑limits.conf配置文件, 添加如下内容:

[root@mycentos ~]# vim /etc/security/limits.conf

* soft nofile 65536    #软件
* hard nofile 131072   #硬件

(3)max number of threads [1024] for user [es] is too low, increase to at least [2048]

原因:无法创建本地线程问题,用户最大可创建线程数太小

解决方案:使用root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。

[root@mycentos ~]# vim /etc/security/limits.d/90-nproc.conf

soft nproc 1024
#修改为:
soft nproc 4096

(4)max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

原因:最大虚拟内存太小

解决方案:使用root用户下,修改配置文件sysctl.conf

[root@mycentos ~]# vim /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令生效:

sysctl -p

(5)system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

原因:因为Centos6不支持SecComp

解决方法:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:

[root@mycentos config]# vim elasticsearch.yml

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

(6)配置host

[root@mycentos config]# vim elasticsearch.yml

network.host: 0.0.0.0 #所有用户都可以访问
http.port: 9200

7、切换用户

[root@mycentos local]# su elastic

8、启动es     

 [elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch

        后台启动:

[elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch -d
或
[elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch &

9、浏览器访问

或者:

安装完毕!

声明:本文仅为作者个人笔记,请勿转载!

1、Elastic 需要 Java 8 环境。(安装步骤:http://www.cnblogs.com/hunttown/p/5450463.html

2、安装包下载:

#官网地址

https://www.elastic.co/downloads/elasticsearch

3、新建用户

       Elastic高版本不建议使用root用户

(1)创建elastic用户组

[root@mycentos ~]# groupadd elastic

(2)创建用户elastic

useradd elastic(用户名) -g elastic(组名) -p 123456(密码)

[root@mycentos ~]# useradd elastic -g elastic -p 123456

4、解压安装包

       建议将安装包放到/usr/local目录下   .放到新建用户目录下,要不报错    错误: 找不到或无法加载主类 org.elasticsearch.tools.java_version_checker.JavaVersionChecker

[root@mycentos local]# unzip elasticsearch-6.2.3.zip
tar zxvf xxx.gz

5、添加权限

chown -R elastic elasticsearch-6.2.3

6、修改配置文件

(1)ERROR: bootstrap checks failed

        memory locking requested for elasticsearch process but memory is not locked

原因:锁定内存失败

解决方案:使用root用户,编辑limits.conf配置文件, 添加如下内容:

[root@mycentos ~]# vim /etc/security/limits.conf

* soft memlock unlimited
* hard memlock unlimited

备注:* 代表Linux所有用户名称,保存、退出、重新登录生效。

(2)ERROR: bootstrap checks failed

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

原因:无法创建本地文件问题,用户最大可创建文件数太小。

解决方案:使用root用户,编辑limits.conf配置文件, 添加如下内容:

[root@mycentos ~]# vim /etc/security/limits.conf

* soft nofile 65536    #软件
* hard nofile 131072   #硬件

(3)max number of threads [1024] for user [es] is too low, increase to at least [2048]

原因:无法创建本地线程问题,用户最大可创建线程数太小

解决方案:使用root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。

[root@mycentos ~]# vim /etc/security/limits.d/90-nproc.conf

soft nproc 1024
#修改为:
soft nproc 4096

(4)max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

原因:最大虚拟内存太小

解决方案:使用root用户下,修改配置文件sysctl.conf

[root@mycentos ~]# vim /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令生效:

sysctl -p

(5)system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

原因:因为Centos6不支持SecComp

解决方法:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:

[root@mycentos config]# vim elasticsearch.yml

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

(6)配置host

[root@mycentos config]# vim elasticsearch.yml

network.host: 0.0.0.0 #所有用户都可以访问
http.port: 9200

7、切换用户

[root@mycentos local]# su elastic

8、启动es     

 [elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch

        后台启动:

[elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch -d
或
[elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch &

9、浏览器访问

或者:

安装完毕!

猜你喜欢

转载自www.cnblogs.com/bigben0123/p/10102438.html