{"id":1673,"date":"2023-03-25T22:26:57","date_gmt":"2023-03-25T14:26:57","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1673"},"modified":"2023-04-23T21:50:09","modified_gmt":"2023-04-23T13:50:09","slug":"filebeat-automatic-shutdown-solution","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/filebeat-automatic-shutdown-solution\/","title":{"rendered":"Filebeat\u81ea\u52a8\u5173\u95ed\u95ee\u9898\u89e3\u51b3"},"content":{"rendered":"<h2>\u95ee\u9898\u63cf\u8ff0<\/h2>\n<p>\u7248\u672c\u4fe1\u606f\uff1a<code>filebeat-7.7.0-linux-x86_64.tar.gz<\/code><br \/>\n\u542f\u52a8\u65b9\u5f0f\uff1a<code>nohup .\/filebeat -c filebeat.yml &amp;<\/code><br \/>\n\u5bfc\u81f4\u95ee\u9898\uff1a\u8fd0\u884c\u4e00\u6bb5\u65f6\u5019\u540e\u81ea\u52a8\u5173\u95ed\uff0c\u65e5\u5fd7\u5982\u4e0b<\/p>\n<p><!-- more --><\/p>\n<pre><code>2020-05-26T07:20:52.806+0800    INFO    beater\/filebeat.go:449  Stopping filebeat\n2020-05-26T07:20:52.806+0800    INFO    beater\/crawler.go:138   Stopping Crawler\n2020-05-26T07:20:52.806+0800    INFO    beater\/crawler.go:148   Stopping 1 inputs\n2020-05-26T07:20:52.806+0800    INFO    cfgfile\/reload.go:238   Dynamic config reloader stopped\n2020-05-26T07:20:52.806+0800    INFO    input\/input.go:149  input ticker stopped\n2020-05-26T07:20:52.806+0800    INFO    input\/input.go:167  Stopping Input: 4779968662065981764\n2020-05-26T07:20:52.806+0800    INFO    harvester\/forwarder.go:52   Input outlet closed\n2020-05-26T07:20:52.806+0800    INFO    log\/harvester.go:320    Reader was closed: \/home\/yezhou\/applogs\/eureka-server.log. Closing.\n2020-05-26T07:20:52.806+0800    INFO    beater\/crawler.go:164   Crawler stopped\n2020-05-26T07:20:52.806+0800    INFO    registrar\/registrar.go:367  Stopping Registrar\n2020-05-26T07:20:52.806+0800    INFO    registrar\/registrar.go:293  Ending Registrar\n2020-05-26T07:20:52.835+0800    INFO    [monitoring]    log\/log.go:153  Total non-zero metrics  {&quot;monitoring&quot;: {&quot;metrics&quot;: {&quot;beat&quot;:{&quot;cpu&quot;:{&quot;system&quot;:{&quot;ticks&quot;:27060,&quot;time&quot;:{&quot;ms&quot;:27060}},&quot;total&quot;:{&quot;ticks&quot;:54630,&quot;time&quot;:{&quot;ms&quot;:54631},&quot;value&quot;:54630},&quot;user&quot;:{&quot;ticks&quot;:27570,&quot;time&quot;:{&quot;ms&quot;:27571}}},&quot;handles&quot;:{&quot;limit&quot;:{&quot;hard&quot;:100002,&quot;soft&quot;:100001},&quot;open&quot;:12},&quot;info&quot;:{&quot;ephemeral_id&quot;:&quot;73be5fc1-5dff-4739-8e53-3c3fe50f3fef&quot;,&quot;uptime&quot;:{&quot;ms&quot;:30851737}},&quot;memstats&quot;:{&quot;gc_next&quot;:12299920,&quot;memory_alloc&quot;:7304424,&quot;memory_total&quot;:8235809224,&quot;rss&quot;:42262528},&quot;runtime&quot;:{&quot;goroutines&quot;:24}},&quot;filebeat&quot;:{&quot;events&quot;:{&quot;added&quot;:23527,&quot;done&quot;:23527},&quot;harvester&quot;:{&quot;closed&quot;:4,&quot;open_files&quot;:0,&quot;running&quot;:0,&quot;started&quot;:4}},&quot;libbeat&quot;:{&quot;config&quot;:{&quot;module&quot;:{&quot;running&quot;:0},&quot;reloads&quot;:1,&quot;scans&quot;:1},&quot;output&quot;:{&quot;events&quot;:{&quot;acked&quot;:23515,&quot;batches&quot;:7054,&quot;total&quot;:23515},&quot;type&quot;:&quot;kafka&quot;},&quot;outputs&quot;:{&quot;kafka&quot;:{&quot;bytes_read&quot;:385840,&quot;bytes_write&quot;:6362352}},&quot;pipeline&quot;:{&quot;clients&quot;:0,&quot;events&quot;:{&quot;active&quot;:0,&quot;filtered&quot;:12,&quot;published&quot;:23515,&quot;retry&quot;:2048,&quot;total&quot;:23527},&quot;queue&quot;:{&quot;acked&quot;:23515}}},&quot;registrar&quot;:{&quot;states&quot;:{&quot;cleanup&quot;:2,&quot;current&quot;:4,&quot;update&quot;:23527},&quot;writes&quot;:{&quot;success&quot;:7065,&quot;total&quot;:7065}},&quot;system&quot;:{&quot;cpu&quot;:{&quot;cores&quot;:2},&quot;load&quot;:{&quot;1&quot;:0,&quot;15&quot;:0.05,&quot;5&quot;:0.01,&quot;norm&quot;:{&quot;1&quot;:0,&quot;15&quot;:0.025,&quot;5&quot;:0.005}}}}}}\n2020-05-26T07:20:52.835+0800    INFO    [monitoring]    log\/log.go:154  Uptime: 8h34m11.756256865s\n2020-05-26T07:20:52.835+0800    INFO    [monitoring]    log\/log.go:131  Stopping metrics logging.\n2020-05-26T07:20:52.835+0800    INFO    instance\/beat.go:444    filebeat stopped.<\/code><\/pre>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p>\u81ea\u5b9a\u4e49Service\u65b9\u5f0f\u542f\u52a8<\/p>\n<pre><code class=\"language-bash\">vim \/usr\/lib\/systemd\/system\/filebeat.service\nchmod +x \/usr\/lib\/systemd\/system\/filebeat.service\n\nsystemctl daemon-reload\nsystemctl enable filebeat\nsystemctl start filebeat<\/code><\/pre>\n<pre><code class=\"language-bash\">[Unit]\nDescription=Filebeat is a lightweight shipper for metrics.\nDocumentation=https:\/\/www.elastic.co\/products\/beats\/filebeat\nWants=network-online.target\nAfter=network-online.target\n\n[Service]\nEnvironment=&quot;LOG_OPTS=-e&quot;\nEnvironment=&quot;CONFIG_OPTS=-c \/usr\/local\/filebeat\/filebeat.yml&quot;\nEnvironment=&quot;PATH_OPTS=-path.home \/usr\/local\/filebeat -path.config \/usr\/local\/filebeat -path.data \/usr\/local\/filebeat\/data -path.logs \/usr\/local\/filebeat\/logs&quot;\nExecStart=\/usr\/local\/filebeat\/filebeat $LOG_OPTS $CONFIG_OPTS $PATH_OPTS\nRestart=always\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u63cf\u8ff0 \u7248\u672c\u4fe1\u606f\uff1afilebeat-7.7.0-linux-x86_64.tar.gz \u542f\u52a8\u65b9\u5f0f\uff1anohup [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[345],"tags":[390],"class_list":["post-1673","post","type-post","status-publish","format-standard","hentry","category-elk","tag-filebeat"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1673"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1673\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}