Fluentd ubuntu에 서비스 등록하기

2025. 2. 2. 15:51EFK

시스템 서비스 파일 생성

sudo vi /etc/systemd/system/fluentd.service

fluentd.service

[Unit]
Description=Fluentd Service
After=network.target

[Service]
# Run Fluentd as a non-root user if possible (create one if needed)
User={user}
Group={group}

# Full path to the Fluentd executable and configuration file
ExecStart=/usr/local/bin/fluentd -c {fleuntd.conf 파일}

# Optional: restart if Fluentd crashes
Restart=always
RestartSec=5

# Optional: limit the number of file descriptors
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

서비스 등록 및 기동

sudo systemctl daemon-reload

sudo systemctl enable fluentd

sudo systemctl start fluentd

상태확인 및 중지

sudo systemctl system fluentd

sudo systemctl stop fluentd

로그 실시간 확인

sudo journalctl -u fluentd -f