New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elasticsearch5.5.1安装问题汇总 #3

Open
DimonHo opened this Issue Aug 2, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@DimonHo
Copy link
Owner

DimonHo commented Aug 2, 2017

问题一:

[2017-04-13T00:14:20,144][WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed

原因:报了一大串错误,大家不必惊慌,其实只是一个警告,主要是因为你Linux版本过低造成的。
解决方案:
1、重新安装新版本的Linux系统
2、警告不影响使用,可以忽略

问题二:

[2017-04-13T00:08:51,031][ERROR][o.e.b.Bootstrap ] [ZdbjA-a] node validation exception
[4] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1024] for user [es] is too low, increase to at least [2048]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[4]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2017-04-13T00:08:51,035][INFO ][o.e.n.Node ] [ZdbjA-a] stopping ...
[2017-04-13T00:08:51,097][INFO ][o.e.n.Node ] [ZdbjA-a] stopped
[2017-04-13T00:08:51,097][INFO ][o.e.n.Node ] [ZdbjA-a] closing ...
[2017-04-13T00:08:51,107][INFO ][o.e.n.Node ] [ZdbjA-a] closed

这里报了若干个错误,我们一个一个来

  1. max file descriptors [4096] for elasticsearch process is 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)
保存、退出、重新登录才可生效

  1. max number of threads [1024] for user [es] is 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
  1. 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
然后重新启动elasticsearch,即可启动成功。

  1. 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.2.1默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。详见 :elastic/elasticsearch#22899
解决方案:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

问题三:

启动后,如果只有本地可以访问,尝试修改配置文件 elasticsearch.yml中network.host(注意配置文件格式不是以 # 开头的要空一格, : 后要空一格)为

network.host: 0.0.0.0

默认端口是 9200
注意:关闭防火墙 或者开放9200端口

问题四

如果节点配置了多网卡,比如一个外网IP,一个内网IP,那么就需要指定network.publish_host参数为内网IP,否则如果该节点自动绑定publishaddress为外网IP,集群中其它节点将无法发现该节点。

network.bind_host: 0.0.0.0
network.publish_host: 192.168.1.75

问题五:

head后台启动命令:nohup grunt server &
安装head插件后,能进入到首页,却无法访问集群。查看控制台报错如下:
image

原因:不明,似乎与x-pack认证插件有关。
解决方案:在elasticsearch.yml 中添加如下配置:

# 开启跨域访问
http.cors.enabled: true
http.cors.allow-origin: "*"

# 关闭x-pack认证
xpack.security.enabled: false

安装x-pack

  1. 安装elasticsearch x-pack插件:
./bin/elasticsearch-plugins install x-pack
  1. 注册免费的 license, https://register.elastic.co,得到类似于如下的license.json文件。
{
  "license": {
    "uid": "50243885-138d-4299-a5e9-31e351546baf",
    "type": "basic",
    "issue_date_in_millis": 1504569600000,
    "expiry_date_in_millis": 1536191999999,
    "max_nodes": 100,
    "issued_to": "Ho Dimon (wd)",
    "issuer": "Web Form",
    "signature": "AAAAAwAAAA11dqH6hcmYFucp0/rlAAABmC9ZN0hjZDBGYnVyRXpCOW5Bb3FjZDAxOWpSbTVoMVZwUzRxVk1PSmkxaktJRVl5MUYvUWh3bHZVUTllbXNPbzBUemtnbWpBbmlWRmRZb25KNFlBR2x0TXc2K2p1Y1VtMG1UQU9TRGZVSGRwaEJGUjE3bXd3LzRqZ05iLzRteWFNekdxRGpIYlFwYkJiNUs0U1hTVlJKNVlXekMrSlVUdFIvV0FNeWdOYnlESDc3MWhlY3hSQmdKSjJ2ZTcvYlBFOHhPQlV3ZHdDQ0tHcG5uOElCaDJ4K1hob29xSG85N0kvTWV3THhlQk9NL01VMFRjNDZpZEVXeUtUMXIyMlIveFpJUkk2WUdveEZaME9XWitGUi9WNTZVQW1FMG1DenhZU0ZmeXlZakVEMjZFT2NvOWxpZGlqVmlHNC8rWVVUYzMwRGVySHpIdURzKzFiRDl4TmM1TUp2VTBOUlJZUlAyV0ZVL2kvVk10L0NsbXNFYVZwT3NSU082dFNNa2prQ0ZsclZ4NTltbU1CVE5lR09Bck93V2J1Y3c9PQAAAQAnZpBTHKYh2qFzWo3BRniX6BIiAMHoCnfR3OPlGCpfU1b2ObFCOccqslgcGw/NrHVOVyglyv7NuA1R6ZlFScB1mDMZFx6P5sTwJu7nwi9tbI3WC/diu2VCTzOzX7m3lnW+NTP9sH0q8Cw37FxsOxCNQuzxWjNXb92/DylzVF6U3cA2INYYHxdp4yULvbnEbAt2JTIbHcWqO4hp/0cOWaB6lRrJZLD24uUafODx10ySyioxYp4K8rVzPLSRTYerVKKWk0NNdXCVw2/PSypl6TisVxt8jXq5DXM0h220BSbEQXu3Lop9tXs39aB18bVnQ3kFv9yIx1wpk+kSht2ULxIM",
    "start_date_in_millis": 1504569600000
  }
}
  1. 将license.json文件上传到elasticsearch服务器,将license.json文件put到x-pack。
curl -XPUT -u elastic:changeme 'http://localhost:9200/_xpack/license' -d @license.json

@DimonHo DimonHo changed the title Elasticsearch5.5.2安装问题汇总 Elasticsearch5.5.1安装问题汇总 Sep 4, 2017

@DimonHo DimonHo added linux and removed error labels Sep 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment