elasticsearch启动常见错误
1、ElasticSearch不允许以root用户启动
需要新建用户并授权
adduser zhangsan
passwd 123456
chown -R zhangsan /usr/local/elasticsearch (改变elasticsearch目录下的所有文件的所有者为zhangsan)
2、max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量
ulimit -Hn
ulimit -Sn
修改/etc/security/limits.conf文件,增加如下配置,用户退出后重新登录生效
es soft nofile 65536
es hard nofile 65536
3、max number of threads [3818] for user [es] is too low, increase to at least [4096]
问题同上,最大线程个数太低。修改配置文件/etc/security/limits.conf,增加配置
es soft nproc 4096
es hard nproc 4096
可通过命令查看
ulimit -Hu
ulimit -Su
4、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
vi /etc/sysctl.conf
sysctl -p
执行命令sysctl -p生效
5、从外面的浏览器访问,访问不了
编辑elasticsearch.yml文件
修改配置如下