elasticsearch 2.4
卸载原软件安装新软件cd /usr/local/srcrpm -e elasticsearchrpm -e kibanarpm -ivh elasticsearch-5.0.0.rpm kibana-5.0.0-x86_64.rpm
大概看了下配置文件没什么改动就直接用原来的diff elasticsearch.yml elasticsearch.yml.rpmsavemv elasticsearch.yml elasticsearch.yml.defaultcp -f elasticsearch.yml.rpmsave elasticsearch.ymlchown elasticsearch:elasticsearch /etc/elasticsearch/elasticsearch.yml3,根据官网建议添加了如下配置到elasticsearc.yml主配置文件http.cors.enabled: truehttp.cors.allow-origin: '*'
启动新的elasticsearch启动过程一直失败,通过查看错误日志发现如下问题总结如下:问题一[2016-11-07T11:37:54,191][WARN ][o.e.b.JNANatives ] Unable to lock JVM Memory: error=12, reason=Cannot allocate memory[2016-11-07T11:37:54,191][WARN ][o.e.b.JNANatives ] This can result in part of the JVM being swapped out.[2016-11-07T11:37:54,191][WARN ][o.e.b.JNANatives ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536[2016-11-07T11:37:54,191][WARN ][o.e.b.JNANatives ] These can be adjusted by modifying /etc/security/limits.conf, for example:# allow user 'elasticsearch' mlockallelasticsearch soft memlock unlimitedelasticsearch hard memlock unlimited解决方法:/etc/security/limits.confelasticsearch soft memlock unlimitedelasticsearch hard memlock unlimited问题二Found index level settings on node level configuration.Since elasticsearch 5.x index level settings can NOT be set on the nodesconfiguration like the elasticsearch.yaml, in system properties or command linearguments.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 closedin order to apply the upgradeIndices created in the future should use index templatesto set default values.解决方法:注释主配置文件里面的,官方建议生成索引时再设置# index.number_of_shards: 5# index.number_of_replicas: 1Please 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'}'问题三java.lang.IllegalArgumentException: unknown setting [node.rack] please check that any required plugins are installed, or check the breaking changes documentation for removed settings解决方法:这个是diff时唯一不同的地方,至于为啥这样改官网有介绍# node.rack: r1node.attr.rack: r1问题四[2016-11-07T12:26:05,957][ERROR][o.e.b.Bootstrap ] Exceptionjava.lang.IllegalArgumentException: unknown setting [script.indexed] did you mean any of [script.inline, script.ingest]?解决方法:目前我注释了,这个应该是语法错误,后续再查官网#script.inline: true#script.indexed: true问题五,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 65536elasticsearch hard nofile 131072elasticsearch soft nproc 2048elasticsearch hard nproc 4096