ES

时间:2019-08-07
本文章向大家介绍ES,主要包括ES使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

ES安装

1.安装jdk(1.8)
2.上传 ElasticSearch 并解压 ,目录重命名为 es
3.创建一普通用户 (ES只能是普通用户运行)
    useradd pengyy
    passwd pengyy
4.修改 es  目录 所属用户和所属组
    chown -R pengyy:pengyy es

5.启动 (只能在本地访问 )
    bin/elasticsearch
6.验证
    curl http://127.0.0.1:9200

7.如果想要使用其他机器访问或浏览器访问,修改 配置文件 (修改配置文件重新启动会报错)
    vim elasticsearch.yml   添加以下内容
    network.host: 192.168.31.82
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]


1.vim /etc/security/limits.conf 
    添加如下内容:
    * soft nofile 65536
    * hard nofile 131072

2.vim /etc/sysctl.conf 
    添加下面配置:
    vm.max_map_count=655360
    并执行命令:
    sysctl -p

问题

问题一:[2019-07-14T15:46:33,436][WARN ][o.e.b.JNANatives         ] [unknown] unable to install syscall filter: 
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
    at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:329) ~[elasticsearch-6.6.0.jar:6.6.0]
解决:使用新的linux版本,就不会出现此类问题了。
原因:  因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动解决:修改elasticsearch.yml 添加一下内容 :
    bootstrap.memory_lock: false
    bootstrap.system_call_filter: false


问题二:ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]

解决:切换到root用户,编辑limits.conf 添加类似如下内容
    vi /etc/security/limits.conf 
    添加如下内容:
    * soft nofile 65536
    * hard nofile 131072
    * soft nproc 2048
    * hard nproc 4096

问题三:max number of threads [1024] for user [lish] likely too low, increase to at least [2048]

    解决:切换到root用户,进入limits.d目录下修改配置文件。
    vi /etc/security/limits.d/90-nproc.conf 
    修改如下内容:
    * soft nproc 1024
    #修改为
    * soft nproc 2048

问题四:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

    解决:切换到root用户修改配置sysctl.conf
    vi /etc/sysctl.conf 
    添加下面配置:
    vm.max_map_count=655360
    并执行命令:
    sysctl -p

原文地址:https://www.cnblogs.com/pengyy/p/11318252.html