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

推荐订阅源

D
DataBreaches.Net
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
腾讯CDC
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学

运维监控系列 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作为输入源,当重载配置文件时,会崩溃.
解决方法