buffer the message When the number of messages reaches a certain threshold, it is sent to broker in bulk; the same is true for consumer, where multiple fetch messages are batched. However, the size of the message volume can be specified by a configuration file. For the Kafka broker side, There seems to be a sendfile system call that can potentially improve the performance of the network IO: Map the file's data into system memory, and the socket reads
Framework. Of course, if you only focus on a few core indicators such as data accumulation in the Kafka, you can also use Kafka system tools. Here is an example of viewing Kafka queue stacking:
As shown in the figure, the group Id,topic and zookeeper connections are specified using the Kafka consumeroffsetchecker, a
1.3 Quick Start Step 1: Download Kafka Click here to download Download and unzip Tar-xzf kafka_2.10-0.8.2.0.tgz CD kafka_2.10-0.8.2.0 Step 2: Start the service Kafka uses ZooKeeper so you need to start the ZooKeeper service first. If you do not have a ZooKeeper service, you can use Kafka to bring your own script to launch an emergency single-point ZooKeeper inst
information) except the actual data, which is not compact enough and wastes space. When the number of message data maintained in the memory increases gradually, GC will be triggered frequently, which will greatly affect the application response speed. Therefore, discard the memory and use the disk to reduce the impact of GC triggering.
In the Kafka thesis, the performance comparison with activemq and other message queues further affirmed the
and are frequently called. The three use zookeeper to manage and coordinate requests and forwarding. Such a high-performance distributed message publishing and subscription system is complete. Note that the process of producer to broker is push, that is, data is pushed to broker, while the process of consumer to broker is pull, the consumer actively pulls data, rather than actively sending data to the consumer through the broker.
Where does such a system reflect its high performance? Let's look
computing framework processing.Basic conceptsrecord (message): Kafka the basic unit of communication, each message is called a recordproducer (producer): The client that sends the message.Consumer (consumer): A client that consumes messages.Consumergroup (consumer group): Each consumer belongs to a specific consumer group.the relationship between consumer and consumer groups :
If A,b,c belongs to the same consumer group, that message can onl
(Org.apache.zookeeper.ClientCnxnSocketNIO)[2015-05-14 17:40:25,210] WARN Session 0x0 for server null, unexpected error, closing socketConnection and attempting reconnect (ORG.APACHE.ZOOKEEPER.CLIENTCNXN)Java.net.SocketException:Address family not supported by protocol Family:connectAt Sun.nio.ch.Net.connect (Native Method)At Sun.nio.ch.SocketChannelImpl.connect (socketchannelimpl.java:532)AtOrg.apache.zookeeper.ClientCnxnSocketNIO.registerAndConnect (clientcnxnsocketnio.java:277)AtOrg.apache.zo
in:Partition LogPartition partition, can be understood as a logical partition, like our computer's disk C:, D:, E: Disk,KAFKA maintains a journal log file for each partition.Each partition is an ordered, non-modifiable, message-composed queue. When the message comes in, it is appended to the log file, which is execut
The company is using partition online. The partition field of a table is incorrect and needs to be rebuilt. It turns out that there is no way to directly fix it using an SQL statement like modifying the primary key field or index field. Instead, you need to create a temporary table with a down time. So I carefully read the document and studied the details of partition
buffer the message, and when the number of messages reaches a certain threshold, bulk send to broker; for consumer, the same is true for bulk fetch of multiple messages. However, the size of the message volume can be specified by a configuration file. For the Kafka broker side, there seems to be a sendfile system call that can potentially improve the performance of network IO: Mapping the file's data into system memory, the socket reads the correspon
multi-subscribed in Kafka, so a topic can have 0, one, or more consumers who subscribe to their data.For each Topic,kafka cluster, maintain a partition log like this:Each partition is an ordered, immutable sequence of records that is continuously added to a structured commit log. The records in the
in:Partition LogPartition partition, can be understood as a logical partition, like our computer's disk C:, D:, E: Disk,KAFKA maintains a journal log file for each partition.Each partition is an ordered, non-modifiable, message-composed queue. When the message comes in, it is appended to the log file, which is execut
Kafka resolution
Www.jasongj.com/2015/01/02/Kafka Depth Analysis
Terminology:brokerThe Kafka cluster contains one or more servers, which are called broker TopicEach message published to the Kafka Cluster has a category, which is called topic. (Physically different topic messages are stored separately, and logically a t
Preface
Kafka is a distributed, multi-partition, multi-replica messaging service. With Message Queuing, producers and consumers interact asynchronously without having to wait for each other. Compared to traditional messaging services, Kafka has the following features:Themes can be scaled horizontally by partitioning (Partitio
data without worrying about where the data is stored)
PartitionPartition is a physical concept, and each topic contains one or more partition.
ProducerResponsible for publishing messages to Kafka broker
ConsumerThe message consumer, the client that reads the message to Kafka broker.
Consumer GroupEach consumer belongs to a specific consumer group
The previous introduction of how to use thrift source production data, today describes how to use Kafka sink consumption data.In fact, in the Flume configuration file has been set up with Kafka sink consumption dataAgent1.sinks.kafkaSink.type =Org.apache.flume.sink.kafka.KafkaSinkagent1.sinks.kafkaSink.topic=TRAFFIC_LOGagent1.sinks.kafkaSink.brokerList=10.208.129.3:9092,10.208.129.4:9092,10.208.129.5:9092ag
distribution at the same time.
partition:topic physical partitions, a topic can be divided into multiple Partition, and each Partition is an ordered queue. The
Segment:partition is physically composed of multiple Segment.
offset: Each partition consists of a sequence of sequential, immutable messages that are appended sequentially to the
/zkserver.sh stopThen to Server1 and server2 to view the status of the cluster, you will find that at this time Server1 (also may be Server2) is leader, and the other is follower.Start the Server0 Zookeeper service again, run the zkserver.sh status check, and discover that the new boot Server0 is also followerAt this point, the installation and high availability validation of the zookeeper cluster is complete.
Attached: Zookeeper the console information is output to the zookeeper
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.