配置3个节点的elasticsearch集群,遇到问题如下:
- 问题一
ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决办法:修改
/etc/sysctl.conf
,添加:vm.max_map_count
=262144,sudo sysctl -p
使修改生效,重启ES
- 问题二
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
解决办法: 修改
/etc/security/limits.conf
,通过添加:
es soft nofile 65536
es hard nofile 131072
es soft nproc 2048
es hard nproc 4096
这里es代表你当前的Ubuntu用户,退出当前登录用户重新登录即可
- 问题三:
即使修改了上面的内容但是不生效的问题:
使用ulimit -a
查看修改是否生效,发现没有生效。
使用ulimit -n 65535
修改报ulimit: open files: cannot modify limit: Operation not permitte
错误:
使用如下方法解决:
su - es 进入es用户,
然后 ulimit -a查看修改,此时应该是已生效的状态
以后每次启动节点都需要:su - es
- 问题四: es集群启动后:
with the same id but is a different node instance
由于node3 是复制node2的配置,需要将node3 es目录下的data目录删掉