1、下载
https://www.elastic.co/downloads
2、配置
修改配置文件,详情见
3、允许外网访问
修改elasticsearch.yml配置文件,允许外网访问。
vim config/elasticsearch.yml
# 增加
network.host: 0.0.0.0
4、常见错误
(1)ES6在centOS系统启动
报错信息:
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
原因: 因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动解决:修改elasticsearch.yml 添加一下内容 :
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
(2)ERROR: [2] bootstrap checks failed
【1】
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
解决方法:切换到root用户,进入vi /etc/security/limits.conf ,增加配置
编辑 /etc/security/limits.conf,追加以下内容;
* soft nofile 65536
* hard nofile 65536
此文件修改后需要重新登录用户,才会生效
【2】 max number of threads [1024] for user [work] likely too low, increase to at least [2048]
解决方法:进入limits.d下的配置文件:vi /etc/security/limits.d/90-nproc.conf ,修改配置如下:
* soft nproc 1024
为
* soft nproc 4096
【3】max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
解决方法:修改sysctl文件:vi /etc/sysctl.conf ,增加下面配置项:
增加改行配置:vm.max_map_count=655360
保存退出后,执行: sysctl -p
5、重新启动 成功
然后使用后台运行启动elasticsearch ./bin/elasticsearch &
6、http://ip:9200/