ELK and RabbitMQ在Centos7中加入系统服务脚本

Elasticsearch脚本

1
2
ln -s /usr/local/java/jdk1.8.0_151/bin/java /usr/local/sbin/
vim /etc/systemd/system/elasticsearch.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[Unit]
Description=Elasticsearch
Wants=network-online.target
After=network-online.target

[Service]
User=elk
Group=elk

ExecStart=/a01/apps/elasticsearch/bin/elasticsearch

LimitNOFILE=65536
LimitNPROC=4096

[Install]
WantedBy=multi-user.target

Kibana脚本

1
vim /etc/systemd/system/kibana.service

1
2
3
4
5
6
7
8
9
10
11
[Unit]
Description=Kibana
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/a01/apps/kibana/bin/kibana


[Install]
WantedBy=multi-user.target

Logstash脚本

1
vim /etc/systemd/system/logstash.service

1
2
3
4
5
6
7
8
9
10
11
[Unit]
Description=Logstash
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
ExecStart=/a01/apps/logstash/bin/logstash -f /etc/logstash/

[Install]
WantedBy=multi-user.target

RabbitMQ脚本

1
2
ln -s /a01/apps/erlang/bin/* /usr/bin/
vim /etc/systemd/system/rabbitmq.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[Unit]
Description=RabbitMQ broker
After=network.target
Wants=network.target

[Service]
User=root
Group=root
Type=forking
WorkingDirectory=/a01/apps/rabbitmq
ExecStart=/a01/apps/rabbitmq/sbin/rabbitmq-server -detached
ExecStop=/a01/apps/rabbitmq/sbin/rabbitmqctl stop

[Install]
WantedBy=multi-user.target
博主QQ:1012405802
技术交流QQ群:830339411
版权声明:网站内容有原创和转载,如有侵权,请联系删除,谢谢!!
感谢打赏,93bok因你们而精彩!!(支付宝支持花呗)
0%