首页 > 代码库 > elk systemd管理
elk systemd管理
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管理
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。