In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what are the common Kafka interview questions". The content is simple, easy to understand and clearly organized. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "what are the common Kafka interview questions".
What is Apache Kafka?
Apache Kafka is a publish-subscribe messaging system developed by Apache that is a distributed, partitioned, and repetitive logging service.
Please explain what is the traditional messaging method?
Traditional messaging methods include two:
Queue: In a queue, a group of users can read messages from the server, and each message is sent to one of them.
Publish-subscribe: In this model, messages are broadcast to all users.
3. Please explain what advantages Kafka has over traditional technology?
Apache Kafka has several advantages over traditional messaging technologies:
Fast: A single Kafka agent can handle thousands of clients, processing megabytes of reads and writes per second.
Scalable: Partitioning and simplifying data across a set of machines to support larger data volumes
Persistent: Messages are persistent and replicated across the cluster to prevent data loss.
Design: It provides fault tolerance guarantees and durability
What does broker mean in Kafka?
In Kafka clusters, the broker term is used to refer to servers.
What is the maximum amount of information a Kafka server can receive?
The maximum size of messages that Kafka server can receive is determined by the parameter message.max.bytes. The default value for version 010 is 1000012, which can be configured as broker or topic.
Explain what Kafka's Zookeeper is. Can we use Kafka without Zookeeper?
Zookeeper is an open-source, high-performance coordination service for distributed applications of Kafka.
No, it's impossible to bypass Zookeeper and contact Kafka broker directly. Once Zookeeper stops working, it cannot service client requests.
Zookeeper is mainly used for communication between different nodes in a cluster
In Kafka, it is used to commit offsets, so if a node fails in any case, it can be taken from previously committed offsets.
In addition to this, it performs other activities such as: leader detection, distributed synchronization, configuration management, identifying when new nodes are leaving or connecting, clustering, node real-time status, and so on.
Kafka source code series source code analysis zookeeper in kafka role
Explain how Kafka users consume information.
Passing messages in Kafka is accomplished by using the sendfile API. It supports transferring bytes from sockets to disk, keeping copies through kernel space, and calling kernels between kernel users.
Consumers have a variety of clients:
010: http://kafka.apache.org/0102/javadoc/index.html? org/apache/kafka/clients/consumer/KafkaConsumer.html
082 High Level API and Low Level API:
https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example
https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example
Explain how to improve throughput for remote users.
If the user is located in a different data center than the broker, the socket buffer size may need to be tuned to amortize long network delays.
Explain how you can get accurate information from Kafka during the data production process.
In order to accurately get Kafka's message in the data, you have to follow two things: avoid duplication during data consumption and avoid duplication during data production.
There are two ways to accurately obtain a semantic at data generation time:
Each partition uses a separate writer, and whenever you find a network error, check the last message in that partition to see if your last write was successful.
Include a primary key (UUID or other) in the message and uncopy it among users
Explain how to reduce disturbances in ISR? When does broker leave ISR?
An ISR is a set of fully synchronized copies of messages with the leaders, that is, an ISR contains all submitted messages. ISR should always contain all copies until a real failure occurs. If a copy falls out of the leader, it will be deleted from the ISR.
Why does Kafka need to be copied?
Kafka's information replication ensures that any published messages are not lost and can be used in machine bugs, program bugs, or more commonly software upgrades.
What does it mean if the copy stays in ISR for a long time?
If a copy remains in the ISR for a long time, it indicates that the tracker is unable to retrieve data as quickly as it collects data at the leader.
13. Explain what happens if the preferred copy is not in the ISR?
If the preferred copy is not in the ISR, the controller will not be able to transfer leadership to the preferred copy.
14. Is it possible for message drift to occur after production?
In most queuing systems, a class that is a producer cannot do this; its role is to trigger and forget messages. Broker will do the rest, such as proper metadata processing with id, offsets, etc.
As a user of messages, you can get compensation from Kafka broker. If you look at the SimpleConsumer class, you'll notice that it gets a MultiFetchResponse object that includes offsets as a list. In addition, when you iterate over Kafka messages, you have MessageAndOffset objects that include the offset and the message sent.
15. kafka configuration to improve throughput
The most basic configuration is
Batch.size defaults to a maximum of 16384 bytes for a single batch. If it exceeds this value, it will be sent immediately.
linger.ms Default is 0ms, after which time it will be sent immediately.
If one of the above two conditions is met, send the message immediately or wait.
The above is "What are the common Kafka interview questions?" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.