在关闭之前记录存储刷新管道



我正在使用logstash 5.4.2持久性队列。我有配置文件来获取输入抛出 JDBC 并进行一些转换并将输出存储到 mongo db。但是当我在 logstash 中运行它时,它只插入了几条记录,比如说 6000 条,而实际输出应该是 300000 条记录。主管道关闭。当我看到数据文件夹中的页面文件有更多的记录时。如何在关闭之前或之后将数据刷新到没有管道的输出中。我的日志存储持久性队列设置如下。

pipeline.workers: 2
pipeline.output.workers: 1
pipeline.batch.size: 50
pipeline.batch.delay: 5
pipeline.unsafe_shutdown: false
config.test_and_exit: false
config.reload.automatic: false
queue.type: persisted
queue.page_capacity: 1gb
queue.max_events: 0
queue.max_bytes: 4gb
queue.checkpoint.acks: 1024
queue.checkpoint.writes: 1024
queue.checkpoint.interval: 1000

有没有办法在主管道关闭期间将所有数据从持久性队列刷新到输出,或者无论如何解决方法来处理此问题?

提前感谢!

您的queue.checkpoint.writes设置为1024,这是默认值。您需要将其设置为1,以保证输入事件的最大持久性,即

queue.checkpoint.writes: 1

请记住,这涉及大量磁盘写入,这将严重影响性能。

最新更新