跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 日志采集服务需要为 kafka 兜底吗?如果兜底的话,你们都是怎么做的??

发表于

背景

周五的时候另外一个项目组要交接项目给我们组。此项目主要是日志采集的项目。主要就是 logstash 发送日志到采集服务,然后采集服务将日志发送到 Kafka ,每秒钟发送的日志量大概 10000 条,单条不超过 10K 。

架构上采集服务收到日志后,会直接落到本地磁盘,然后有个定时任务去固定的将磁盘上的文件批量发送给 Kafka 。因为他们是为了做断点续传,比如 kafka 挂掉之后,采集服务仍然可以运行,不丢失日志。

疑问

刚交接的时候没感觉有问题,今天越想越不对。作为采集服务,你的 Kafka 就是你的核心依赖啊,你 kafka 挂掉,直接不提供服务/日志没法采集不就好了,或者你发送端重新发送。

  • 如果为每个服务的核心依赖都做兜底,那依赖数据库的是不是每次也要先把数据写到文件中,防止数据库挂掉,保证数据能落到数据库中?
  • 你的项目/服务为 kafka 兜过底吗?
  • 我这个采集服务应不应该支持断点续传?如果支持的话要怎么支持?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.