问题集合
解决方法
1 Unable to lock JVM Memory: error=12, reason=Cannot allocate memory
This can result in part of the JVM being swapped out.
Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
These can be adjusted by modifying /etc/security/limits.conf
/etc/security/limits.conf
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited
2 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.In order to upgrade all indices the settings must be updated via the
/${index}/_settings API. Unless all settings are dynamic all indices must be closed
in order to apply the upgradeIndices created in the future should use index templates
to set default values.
解决方法:
注释主配置文件里面的,官方建议生成索引时再设置
# index.number_of_shards: 5
# index.number_of_replicas: 1
Please ensure all required values are updated on all indices by executing:curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
"index.number_of_replicas" : "1",
"index.number_of_shards" : "10"
}'
3 [2016-11-07T12:26:05,957][ERROR][o.e.b.Bootstrap ] Exception
java.lang.IllegalArgumentException: unknown setting [script.indexed] did you mean any of [script.inline, script.ingest]?
目前我注释了,这个应该是语法错误,后续再查官网
#script.inline: true
#script.indexed: true
4 max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [elasticsearch] likely too low, increase to at least [2048]
报错信息直接提示了修改limits.conf的相关参数
elasticsearch soft nofile 65536
elasticsearch hard nofile 131072
elasticsearch soft nproc 2048
elasticsearch hard nproc 4096
5
Copy2.X的elasticsearch.yml到5.0里,大量报错
1)踩了个"node settings must not contain any index level settings",报错提示是所有index配置(例如 index.mapper.dynamic)都需要在ES启动之后通过接口来改。
2)script开头的配置项也没了。
3)一些配置项的名字改了,例如 bootstrap.mlockall 改成了 bootstrap.memory_lock。
建议直接在5.0的elasticsearch.yml上面改配置!
另外./config/ 里面新增了 jvm.options 和 log4j2.properties,取消了logging.yml。关于内存的配置可以直接在 jvm.options 里面设,不需要折腾环境变量了。
6 动报错,提示调高JVM线程数限制
bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
vim /etc/sysctl.conf
vm.max_map_count=262144 #添加这一行
7搜索报错,默认Scripting语言从groovy改成了painless 这个坑藏得好深,困惑了一段时间...最后改query的lang字段为painless就过了
8 5.x的es,不再使用索引名称作为目录了,而是hash值
原来:Feb 7 00:05 logstash-www-2017.02.07
现在:Feb 7 11:24 ZpSCDUgGR2KfaHmu_fgx_A
9