牛骨文教育服务平台(让学习变的简单)
博文笔记

ES 5.X 安装问题(持续更新,有错您说)

创建时间:2017-01-19 投稿人: 浏览次数:9576

root用户编辑

vi /etc/sysctl.conf

vm.max_map_count=262144

vi /etc/security/limits.conf

admin hard nofile 65536  
admin soft nofile 65536  
admin soft memlock unlimited
admin hard memlock unlimited
admin     soft    nproc     65536
admin     hard    nproc     65536

sysctl -p 立即生效

admin用户重新登录:

ulimit -a  查看确认

memory locking requested for elasticsearch process but memory is not locked
配置了bootstrap.memory_lock:true
https://www.elastic.co/guide/en/elasticsearch/reference/current/_memory_lock_check.html

max number of threads [1024] for user [admin] is too low, increase to at least [2048]
ulimit -u 2048
nproc –>/etc/security/limits.conf
https://www.elastic.co/guide/en/elasticsearch/reference/master/max-number-of-threads.html

[WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in

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

sudo sysctl -w vm.max_map_count=262144

/etc/sysctl.conf
vm.max_map_count=262144

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

临时解决: sudo ulimit -n 65536
若找不到ulimit命令(部分Ubuntu系统

sudo sh -c "ulimit -n 65536 && exec su $LOGNAME"

vi /etc/security/limits.conf

admin hard nofile 65536  
admin soft nofile 65536  

改为还ulimint -n 检查还是没有生效,特别是Ubuntu,参考

异常#

注意:yml配置文件的值前有一个空格隔开

原因:用户允许最大线程数首先
vi bin/elasticsearch
ulimit -u 2048 //仅供测试使用

Please pass JVM parameters via ES_JAVA_OPTS instead

vi bin/elasticsearch
添加如下配置项:
JAVA_HOME=”/export/servers/jdk1.8.0_60”
JAVA_OPTS=”“

JAVA_OPTS配置为空,是为了不受系统配置的环境变量的影响

不能以root用户启动ES服务器。非要以root用户运行?
配置 -Des.insecure.allow.root=true

对于5.X,在config/jvm.options配置文件中,添加-Des.insecure.allow.root=true

解决方法1:配置 config/elasticsearch.yml ,注释掉以下内容
#bootstrap.memory_lock: true
解决方法2:配置:/etc/security/limits.conf,

    admin soft memlock unlimited
    admin hard memlock unlimited

Your kernel does not support seccomp.
Elasticsearch attempts to utilize seccomp by default (via the setting bootstrap.system_call_filter).

Starting in 5.2.0, if you’re in production mode, bootstrap.system_call_filter is enabled, and initializing seccomp fails, then Elasticsearch will refuse to bootstrap.
You either have to migrate to a kernel that supports seccomp, or disable bootstrap.system_call_filter.

Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true

禁用:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

network.host: 192.168.179.20
http.port: 9201

之前的配置:

 --path.conf=${ES_CONF}

修改为:

-Epath.conf=${ES_CONF}

https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_plugins.html#_custom_plugins_path
specify a custom plugins path via path.plugins has been removed.

Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.

curl -XPUT ‘http://localhost:9200/_all/_settings?preserve_existing=true’ -d ‘{
“index.number_of_shards” : “3”
}’

curl -XPUT ‘http://localhost:9200/_all/_settings?preserve_existing=true’ -d ‘{
“index.mapper.dynamic” : “false”,
“index.translog.durability” : “async”,
“index.translog.sync_interval” : “30s”
}’
即以index开头的配置删除。

修改为: bootstrap.memory_lock: true

新配置:action.destructive_requires_name: true

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。