Skip to Content
Kafka权威指南
book

Kafka权威指南

by Neha Narkhede, Gwen Shapira, Todd Palino
January 2018
Beginner to intermediate
234 pages
7h 8m
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南
可靠的数据传递
99
下的故障条件做一些测试:
客户端从服务器断开连接(系统管理员可以帮忙模拟网络故障);
首领选举;
依次重启
broker
依次重启消费者;
依次重启生产者。
你对每一个测试场景都会有
期望的行为
,也就是在开发应用程序时所期望看到的行为,然
后运行测试看看真实的结果是否符合预期。例如,在测试“依次重启消费者”这一场景
时,你期望看到“在短暂的再均衡之后出现的重复消息个数不超过
1000
个”。测试结果会
告诉我们应用程序提交偏移量的方式和处理再均衡的方式是否与预期的一样。
6.6.3
 在生产环境监控可靠性
测试应用程序是很重要的,不过它无法代替生产环境的持续监控,这些监控是为了确保数
据按照期望的方式流动。我们将会在第
9
章详细介绍如何监控
Kafka
集群,不过除了监控
集群的健康状况之外,监控客户端和数据流也是很重要的。
首先,
Kafka
Java
客户端包含了
JMX
度量指标,这些指标可以用于监控客户端的状态
和事件。对于生产者来说,最重要的两个可靠性指标是消息的
error-rate
retry-rate
(聚
合过的)。如果这两个指标上升,说明系统出现了问题。除此以外,还要监控生产者日
志——发送消息的错误日志被设为
WARN
级别,可以在“
Got error produce response with
correlation id 5689 on topic-partition [topic-1,3], retrying (two attempts left). Error: ... ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精通機器學習

精通機器學習

Aurélien Géron
精通特征工程

精通特征工程

Alice Zheng, Amanda Casari
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9787115473271