ELKB-filebeat开机启动设置

按照 CentOS下ELK开机自启动的配置 设置好ELK的开机启动。
但是我这里使用的EKB,需要设置filebeat的开机启动,照着格式写了一个filebeat的启动:

#!/bin/bash

# chkconfig: 2345 90 10
# description: filebeat

FB_HOME=/usr/local/ELK/filebeat-5.6.3-linux-x86_64
case $1 in
        start) sudo -iu hadoop $FB_HOME/filebeat&;;
        *) echo "filebeat start" ;;
esac

平时是在filebeat目录下直接这样执行,而放到这里启动服务就报错了:

filebeat2017/11/14 08:21:04.181378 beat.go:346: CRIT Exiting: error loading config file: stat filebeat.yml: no such file or directory
Exiting: error loading config file: stat filebeat.yml: no such file or directory

说找不到配置文件,然后看了下启动filebeat的帮助:

flag provided but not defined: -f
Usage of ./filebeat-5.6.3-linux-x86_64/filebeat:
-E value
Configuration overwrite (default null)
-M value
Module configuration overwrite (default null)
-N Disable actual publishing for testing
-c value
Configuration file, relative to path.config (default filebeat.yml)
-configtest
Test configuration and exit.
-cpuprofile string
Write cpu profile to file
-d string
Enable certain debug selectors
-e Log to stderr and disable syslog/file output
-httpprof string
Start pprof http server
-memprofile string
Write memory profile to this file
-modules string
List of enabled modules (comma separated)
-once
Run filebeat only once until all harvesters reach EOF
-path.config value
Configuration path
-path.data value
Data path
-path.home value
Home path
-path.logs value
Logs path
-setup
Load the sample Kibana dashboards
-strict.perms
Strict permission checking on config files (default true)
-v Log at INFO level
-version
Print the version and exit

-c可以指定filebeat的配置文件。因此修改filebeat的启动文件内容为:

#!/bin/bash

# chkconfig: 2345 90 10
# description: filebeat

FB_HOME=/usr/local/ELK/filebeat-5.6.3-linux-x86_64
case $1 in
        start) sudo -iu hadoop $FB_HOME/filebeat -c $FB_HOME/filebeat/filebeat.yml&;;
        *) echo "filebeat start" ;;
esac

$FB_HOME/filebeat/filebeat.yml 这里写配置文件的路径,设置成功.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值