栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

filebeat自动退出,如何后台启动filebeat

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

filebeat自动退出,如何后台启动filebeat

最近使用filebeat把日志推送到ES来方便查看日志,我下载的是.tar.gz格式的压缩包,在网上找了后台自动filebeat的命令,得到启动方式:

nohup ./filebeat -e -c filebeat.yml >/dev/null 2>&1 &

启动后正常在kibana看到日志了,也就以为OK了,可是后来发现不定时间后,filebeat就会自动退出,查看日志,也没发现问题(不用关注日志内容,因为最后解决方案和日志内容没关系):

INFO	[monitoring]	log/log.go:145	Non-zero metrics in the last 30s	{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":22740,"time":{"ms":15}},"tot
INFO	[monitoring]	log/log.go:145	Non-zero metrics in the last 30s	{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":22760,"time":{"ms":16}},"tot
INFO	beater/filebeat.go:443	Stopping filebeat
INFO	crawler/crawler.go:139	Stopping Crawler
INFO	crawler/crawler.go:149	Stopping 1 inputs
INFO	cfgfile/reload.go:238	Dynamic config reloader stopped
INFO	input/input.go:149	input ticker stopped
INFO	input/input.go:167	Stopping Input: 16980747810831490809
INFO	crawler/crawler.go:165	Crawler stopped
INFO	registrar/registrar.go:367	Stopping Registrar
INFO	registrar/registrar.go:293	Ending Registrar
INFO	[monitoring]	log/log.go:153	Total non-zero metrics	{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":22830,"time":{"ms":22838}},"total":{"tic
INFO	[monitoring]	log/log.go:154	Uptime: 5h1m4.87624067s
INFO	[monitoring]	log/log.go:131	Stopping metrics logging.
INFO	instance/beat.go:445	filebeat stopped.

然后在网上找了好久,都没有找到原因,最后突然想到是不是因为直接终端退出了,后台任务也跟着退出,然后试了一下,先启动filebeat,然后关闭终端,再进入系统发现,filebeat进程真的也关闭了。

如果启动filebeat后,不要直接关闭终端,而是先执行命令exit后再关闭,此时再进入系统发现进程就还在,这是很久以前看到的一个Redhat工程师分享的一个运维问题发现的。

不过最后还是下载rpm包,然后安装,使用服务的方式启动filebeat就没问题了

yum install filebeat-xxxx.rpm
systemctl start filebeat
systemctl enable filebeat
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/338448.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号