惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Y
Y Combinator Blog
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Jina AI
Jina AI
B
Blog RSS Feed
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
D
Docker

运维监控系列 on 打工人日志

skywalking python agent 安装和配置 windows-exporter 监控 skywalking APM 监控 logstash 多管道部署 nginx exporter 安装配置 prometheus grafana alertmanager 安装配置 prometheus 配置
Logstash 自动重载配置文件
2022-10-31 · via 运维监控系列 on 打工人日志

工作原理

  1. 检测到配置文件变化
  2. 通过停止所有输入停止当前pipline
  3. 用新的配置创建一个新的管道
  4. 检查配置文件语法是否正确
  5. 检查所有的输入和输出是否可以初始化
  6. 检查成功使用新的 pipeline 替换当前的pipeline
  7. 检查失败,使用旧的继续工作.
  8. 在重载过程中,jvm 没有重启.

Logstash 自动重新加载配置

为了可以自动检测配置文件的变动和自动重新加载配置文件,需要在启动的时候使用以下命令:

1./bin/lagstash -f configfile.conf --config.reload.automatic

启动 Logstash 的时候使用--config.reload.automatic-r选项来开启自动重载配置。

修改检测间隔时间

默认检测配置文件的间隔时间是3秒,可以通过以下命令改变

1--config.reload.interval <second>

如果 Logstash 已经运行并且没有开启自动重载,你可以强制 Logstash 重新载入配置文件并且重启管道通过发送一个 SIGHUP 信号。比如:

其中是正在运行的 Logstash 的进程号。

注意!!!

stdin输入插件不支持自动重启.
syslog作为输入源,当重载配置文件时,会崩溃.
解决方法