Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Kafka 1.0 Cookbook

You're reading from   Apache Kafka 1.0 Cookbook Over 100 practical recipes on using distributed enterprise messaging to handle real-time data

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781787286849
Length 250 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Raúl Estrada Raúl Estrada
Author Profile Icon Raúl Estrada
Raúl Estrada
Alexey Zinoviev Alexey Zinoviev
Author Profile Icon Alexey Zinoviev
Alexey Zinoviev
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Configuring Kafka FREE CHAPTER 2. Kafka Clusters 3. Message Validation 4. Message Enrichment 5. The Confluent Platform 6. Kafka Streams 7. Managing Kafka 8. Operating Kafka 9. Monitoring and Security 10. Third-Party Tool Integration

Configuring the ZooKeeper settings

Apache Zookeeper is a centralized service for maintaining configuration information providing distributed synchronization. ZooKeeper is used in Kafka for cluster management and to maintain the topics information synchronized.

Getting ready

With your favorite text editor, open your server.properties file copy.

How to do it…

Adjust the following parameters:

zookeeper.connect=127.0.0.1:2181,192.168.0.32:2181
zookeeper.session.timeout.ms=6000
zookeeper.connection.timeout.ms=6000
zookeeper.sync.time.ms=2000

How it works…

Here is an explanation of these settings:

  • zookeeper.connect: Default value: null. This is a comma-separated value in the form of the hostname:port string, indicating the Zookeeper connection. Specifying several connections ensures the Kafka cluster reliability and continuity. When one node fails, Zookeeper uses the chroot path (/chroot/path) to make the data available under that particular path. This enables having the Zookeeper cluster available for multiple Kafka clusters. This path must be created before starting the Kafka cluster, and consumers must use the same string.
  • zookeeper.session.timeout.ms: Default value: 6000. Session timeout means that if in this time period a heartbeat from the server is not received, it is considered dead. This parameter is fundamental, since if it is long and if the server is dead the whole system will experience problems. If it is small, a living server could be considered dead.
  • zookeeper.connection.timeout.ms: Default value: 6000. This is the maximum time that the client will wait while establishing a connection to Zookeeper.
  • zookeeper.sync.time.ms: Default value: 2000. This is the time a Zookeeper follower can be behind its Zookeeper leader.

See also

You have been reading a chapter from
Apache Kafka 1.0 Cookbook
Published in: Dec 2017
Publisher: Packt
ISBN-13: 9781787286849
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime