腾讯云主机systemctl restart elasticsearch起不来的问题解决

腾讯云主机elasticsearch起不来的问题解决
[root@VM_58_118_centos elasticsearch]# vim /usr/lib/systemd/system/elasticsearch.service
[Unit]
Description=Elasticsearch
[Service]
User=elasticsearch
Group=elasticsearch
LimitNOFILE=100000
LimitNPROC=100000
ExecStart=/usr/share/elasticsearch/bin/elasticsearch
[Install]
WantedBy=multi-user.target

[root@VM_58_118_centos elasticsearch]# systemctl daemon-reload

[root@VM_58_118_centos elasticsearch]# cat /etc/passwd |grep elasticsearch
elasticsearch:x:984:988:elasticsearch user:/home/elasticsearch:/sbin/nologin
修改为
elasticsearch:x:984:988:elasticsearch user:/home/elasticsearch:/bin/bash

[root@VM_58_118_centos elasticsearch]# mkdir -p /home/elasticsearch
[root@VM_58_118_centos elasticsearch]# chmod -R 755 /home/elasticsearch

su - elasticsearch
/usr/share/elasticsearch/bin/elasticsearch -d
exit

[root@VM_58_118_centos elasticsearch]# ./plugins/search-guard-2/tools/sgadmin.sh -cn syhuo -h 127.0.0.1 -cd plugins/search-guard-2/sgconfig -ks plugins/search-guard-2/sgconfig/syhuo-keystore.jks -kspass 86337898 -ts plugins/search-guard-2/sgconfig/truststore.jks -tspass 86337898 -nhnv
[root@VM_58_118_centos elasticsearch]# ps -ef |grep elasticsearch
[root@VM_58_118_centos elasticsearch]# kill -9 xxxx

[root@VM_58_118_centos elasticsearch]# systemctl restart elasticsearch
[root@VM_58_118_centos elasticsearch]# systemctl restart status
[root@VM_58_118_centos elasticsearch]# netstat -anop|grep 9300

[root@VM_58_118_centos elasticsearch]# cat /etc/passwd |grep elasticsearch
elasticsearch:x:984:988:elasticsearch user:/home/elasticsearch:/bin/bash
修改为
elasticsearch:x:984:988:elasticsearch user:/home/elasticsearch:/sbin/nologin

[root@VM_58_118_centos elasticsearch]# systemctl enable elasticsearch
[root@VM_58_118_centos elasticsearch]# systemctl list-unit-files |grep enable |grep elasticsearch
上一篇:docker增加restart=always, docker重启后自动启动容器


下一篇:Zabbix4.4配置MySQL监控;