[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
2、创建新用户,用于elasticsearch服务
# elastic不允许使用root账号启动服务
[root@localhost ~]# useradd elastic
[root@localhost ~]# passwd elastic
Changing password for user elastic.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
3、设置ulimit
[root@localhost ~]# vi /etc/security/limits.conf
# 在文本最后添加如下几行
## 可以打开的最大文件数(软限制)
elastic soft nofile 65536
## 可以打开的最大文件数(硬限制)
elastic hard nofile 65536
## 可以创建的最大进程数(软限制)
elastic soft nproc 65535
## 可以创建的最大进程数(硬限制)
elastic hard nproc 65535
[root@localhost ~]# vi /etc/sysctl.conf
# 在文本最后添加下面行
## 设置单个进程可以拥有的最大内存映射区域数量
v