您现在的位置是:首页 > 文章详情

ElasticSearch 2.2 升级 6.2.4

日期:2019-03-18点击:445

**最近公司要升级ES版本,从2.2升级到6.2.4
为了团队能够快速配合,就不等运维啦,自己动手部署一个es6
过程中也遇到了一些问题,这里记录一下方便给大家一个参考**

原来的配置文件

cluster.name: ehl_elasticsearch path.data: /data1/elasticsearch/indexdata path.work: /data1/elasticsearch/work path.logs: /data1/elasticsearch/logs bootstrap.mlockall: true ES_MIN_MEM: 16g ES_MAX_MEM: 16g index.mapper.dynamic: false node.name: ${HOSTNAME} network.host: _eth0_ discovery.zen.ping.unicast.hosts: ["host0:8200", "host1:8200"]

把下面这些参数删除

// es6的配置里面已经没有这一项了,如果加上的话,启动会报错 path.work: /data1/elasticsearch6/work // 这一项在6里面已经换名字了 bootstrap.mlockall: true // es6有了一个jvm的配置文件,内存在哪儿修改,这两个参数没啥必要了 ES_MIN_MEM: 16g ES_MAX_MEM: 16g // es6的配置里面没有这个参数的说明了,删掉 index.mapper.dynamic: false

修改参数

network.host: _eth0_ 改为 network.host: 0.0.0.0

以为这就完了
启动es结果
启动报错,不能用root启动

添加账号,设置权限(这个必须,包括配置里面设置的数据和日志的目录,否则会报错)切换用户

groupadd elsearch useradd elsearch -g elsearch -p elasticsearch chown -R elsearch:elsearch elasticsearch su elsearch

启动还报错,一次性还报5个

ERROR: [5] bootstrap checks failed [1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536] [2]: memory locking requested for elasticsearch process but memory is not locked [3]: max number of threads [1024] for user [elsearch] is too low, increase to at least [4096] [4]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] [5]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

问题5

配置文件增加

bootstrap.system_call_filter: false

问题4

切换到root用户
执行命令:

sysctl -w vm.max_map_count=262144

查看结果:

sysctl -a|grep vm.max_map_count

显示:

vm.max_map_count = 262144

上述方法修改之后,如果重启虚拟机将失效
解决办法:
在/etc/sysctl.conf文件最后添加一行

vm.max_map_count=262144

即可永久修改

问题3

修改/etc/security/limits.d/90-nproc.conf配置文件
vim /etc/security/limits.d/90-nproc.conf

soft nproc 1024 修改为 soft nproc 4096

问题2

bootstrap.memory_lock: false

问题1

vi /etc/profile
里面没有ulimit的限制

vi /etc/security/limits.conf

elsearch soft nproc 65535 elsearch hard nproc 65535 elsearch soft nofile 65536 elsearch hard nofile 131072

再启动,成功

在这里插入图片描述
欢迎关注公众号,共同交流,共同进步

原文链接:https://yq.aliyun.com/articles/694291
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章