背景

之前使用es都是别人装好的,自己玩也是用的window版,忽然感觉有必要自己装一次linux版的。

准备

  1. 了解基础知识点我

  2. 虚拟机一台,系统centos6.7,配置内存至少2G,因为我看启动基本占用1.5G左右。

安装与问题解决

安装我就不说了,网上很多教程自己找一个吧。

安装好了之后启动会有一堆警告(warn)。这些警告基本就是错误,需要一一解决。

网上总结的解决方式的也有很多,自行百度吧!

我说一下的就是针对centos6.7这个系统出现的一些特殊问题。网上解决方式很少或者解决不了的。当然我也是百度的,不过找了好长时间。

问题一:

启动时报错:max number of threads [2048] for user [elsearch] is too low, increase to at least [4096];

这个问题网上基本的解决办法就是:

切换到root账户后,修改/etc/security/limits.conf 文件

但是修改完后还是报错。

正解是:

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

这个配置文件

我是两个都配置了的。

原因:

/etc/security/limits.d/90-nproc.conf 与 /etc/security/limits.conf 都是系统用户资源配置文件,两者有什么不一样呢?

先来看/etc/security/limits.d/90-nproc.conf 配置文件:

[root@ ~]# cat /etc/security/limits.d/90-nproc.conf

# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
*          soft    nproc     1024
root       soft    nproc     unlimited

系统其它普通用户最多进程默认是1024个,而root用户是 unlimited(不受限制)

/etc/security/limits.conf 配置文件可限制文件打开数,系统进程等资源,在该文件配置中写的最大用户进程数是受/etc/security/limits.d/90-nproc.conf配置上限影响的。

一般系统普通用户进程数满了都是修改/etc/security/limits.d/90-nproc.conf文件。

解决

  1. 修改/etc/security/limits.conf 文件(网上多数解决方法)

修改后:

#@student        -       maxlogins       4

# End of file

* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
  1. 修改文件: vi /etc/security/limits.d/90-nproc.conf

修改后:

# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     4096
*          hard    nproc     4096
#*          soft    nproc     2048
root       soft    nproc     unlimited