Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Apache Kafka 1.0 Cookbook

You're reading from  Apache Kafka 1.0 Cookbook

Product type Book
Published in Dec 2017
Publisher Packt
ISBN-13 9781787286849
Pages 250 pages
Edition 1st Edition
Languages
Authors (2):
Alexey Zinoviev Alexey Zinoviev
Raúl Estrada Raúl Estrada
Profile icon Raúl Estrada
View More author details

Table of Contents (18) Chapters

Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Dedication
Preface
1. Configuring Kafka 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

  • From the Kafka perspective, the ZooKeeper parameters are detailed at: http://kafka.apache.org/documentation.html#brokerconfigs
  • The Apache ZooKeeper home page is here: https://zookeeper.apache.org/
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 $15.99/month. Cancel anytime}