CentOS 7 elasticsearch service 开机自启

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

个人微信公众号:
这里写图片描述

作者:jiankunking 出处:http://blog.csdn.net/jiankunking

你可能感兴趣的:(Linux,ElasticSearch,elasticsearch,service,开机,自启,centos)