Elasticsearchan安装初尝01-问题记录

1】5.0版本以后不允许root启动,需要为es单独创建一个用户,并修改配置文件为这个普通用户授予root权限(至于如何授权,百度搜【如何给普通用户授予root权限】),启动时切换到该用户,进入到es安装目录,并用chmod -X /bin/elasticsearch给es启动命令授权,使用./bin/elasticsearch(前台运行)启动es(./bin/elasticsearch -d 代表后台运行)
2】启动时发现的问题:
elasticsearch.yml配置文件,为了可以远程访问加上network.host=0.0.0.0后,本机使用curl命令访问不了,而且es的进程一直会被自动杀掉(配置文件去掉network.host=0.0.0.0则不会),
与此同时在es没被杀的期间,外部服务器还是不能访问,求解?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
解决了:总的原因还是内存不足
1、本人部署时出现异常以及解决方法
首先查看启动日志发现[error]:ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]-------1
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]--------2

对于异常1:
sudo vim /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令:

sudo sysctl -p
对于异常2:
切换到root用户,编辑limits.conf 添加类似如下内容

vi /etc/security/limits.conf

添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096
2、其他异常解决以及方法
max number of threads [1024] for user [lish] likely too low, increase to at least [2048]

解决:切换到root用户,进入limits.d目录下修改配置文件。

vi /etc/security/limits.d/90-nproc.conf

修改如下内容:

* soft nproc 1024

#修改为

* soft nproc 2048
解决完此问题,外部服务器即可访问

原文地址:https://www.cnblogs.com/xuxiaojian/p/8796263.html