vi /etc/security/limits.conf

添加如下内容:

* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

在/etc/systemd/system目录下创建elasticsearch.service文件

[Unit]
Description=elasticsearch
[Service]
User=elasticsearch
LimitNOFILE=100000
LimitNPROC=100000
ExecStart=/usr/local/elasticsearch/bin/elasticsearch
[Install]
WantedBy=multi-user.target

设置开机自启

systemctl enable elasticsearch

个人微信公众号:

CentOS 7 elasticsearch service 开机自启_elasticsearch

作者:jiankunking