码迷,mamicode.com
首页 > 其他好文 > 详细

elk systemd管理

时间:2017-05-25 11:55:58      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:pid   esc   imp   load   sea   pat   limit   config   star   

1.logstash

/etc/systemd/system/logstash.service
Type=simple
User=logstash
Group=logstash
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with ‘-‘ makes it try to load, but if the file doesn‘t
# exist, it continues onward.
EnvironmentFile=-/etc/default/logstash     #这个配置文件很重要,记得增加JAVACMD路径
EnvironmentFile=-/etc/sysconfig/logstash
ExecStart=/opt/app/logstash/bin/logstash "--path.settings" "/opt/app/logstash/config"
Restart=always
WorkingDirectory=/
Nice=19
LimitNOFILE=16384

[Install]
WantedBy=multi-user.target
/etc/default/logstash

JAVACMD="/opt/app/jdk/bin/java"
LS_HOME="/opt/app/logstash"
LS_SETTINGS_DIR="/opt/app/logstash/config"
LS_PIDFILE="/opt/app/logstash/run/logstash.pid"
LS_USER="logstash"
LS_GROUP="logstash"
LS_GC_LOG_FILE="/data/logs/logstash/gc.log"
LS_OPEN_FILES="16384"
LS_NICE="19"
SERVICE_NAME="logstash"
SERVICE_DESCRIPTION="logstash"

2.kibana

/etc/systemd/system/kibana5.service
[Unit]
Description=kibana

[Service]
Type=simple
User=kibana
Group=kibana
ExecStart=/opt/app/kibana/bin/kibana
Restart=always

[Install]
WantedBy=multi-user.target

3.elasticsearch

/etc/systemd/system/es5.service

[Unit]
Description=es5
#After=network.target

[Service]
Type=simple
User=es
Group=es
EnvironmentFile=-/etc/default/es5
ExecStart=/opt/app/es5/bin/elasticsearch
LimitNOFILE=655350
Restart=on-failure

[Install]
WantedBy=multi-user.target

/etc/default/es5

ES_USER="es"
ES_GROUP="es"
JAVA_HOME="/opt/app/jdk"
LOG_DIR="/data/logs/es5"
MAX_OPEN_FILES=655350
MAX_MAP_COUNT=262144
CONF_DIR="/opt/app/es5/config"
DATA_DIR="/data/es5"
#ES_JAVA_OPTS
#MAX_LOCKED_MEMORY
#RESTART_ON_UPGRADE

 

elk systemd管理

标签:pid   esc   imp   load   sea   pat   limit   config   star   

原文地址:http://www.cnblogs.com/mikeluwen/p/6902388.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!