有个问题必须注意,小内存跑不起来,内存申请失败,建议至少4个G吧java
下面是java配置git
JAVA_HOME=/usr/javajdk1.8.0_151
JRE_HOME=/usr/java/jdk1.8.0_151/jre
CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATHgithub
如下是安装Elasticsearchbootstrap
命令一:groupadd elsearchelasticsearch
命令二:useradd elsearch -g elsearchoop
命令三:chown -R elsearch:elsearch elasticsearch-5.6.3 该命令是更改该文件夹下所属的用户组的权限.net
3.2.4 建立ES数据文件和日志文件,直接在root用户根目录一下建立就能够了线程
执行命令:mkdir /data日志
命令二:chown -R elsearch:elsearch /data/ip
命令三:su - elsearch 切换用户
命令四:mkdir -p es/data
命令五:mkdir -p es/logs
启动遇到的问题:
1)max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
缘由:没法建立本地文件问题,用户最大可建立文件数过小
解决方案:切换到root用户,编辑limits.conf配置文件, 添加相似以下内容:
vi /etc/security/limits.conf
添加以下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
备注:* 表明Linux全部用户名称(好比 hadoop)
须要保存、退出、从新登陆才可生效。
2)max number of threads [1024] for user [es] likely too low, increase to at least [2048]
缘由:没法建立本地线程问题,用户最大可建立线程数过小
解决方案:切换到root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。
vi /etc/security/limits.d/90-nproc.conf
找到以下内容:
* soft nproc 1024
#修改成
* soft nproc 2048
3)max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
缘由:最大虚拟内存过小
root用户执行命令:
[root@localhost ~]# sysctl -w vm.max_map_count=262144
4)system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
缘由:Centos6不支持SecComp,而ES5.4.1默认bootstrap.system_call_filter为true进行检测,因此致使检测失败,失败后直接致使ES不能启动。
详见 :https://github.com/elastic/elasticsearch/issues/22899
解决方法:在elasticsearch.yml中新增配置bootstrap.system_call_filter,设为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
以上问题解决后,es启动成功了,