DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Big Data
  4. Resolve Apache Kafka Starting Issue Installed on Single/Multi-Node Cluster

Resolve Apache Kafka Starting Issue Installed on Single/Multi-Node Cluster

Without integrating Apache Zookeeper, Kafka alone won’t be able to form the complete Kafka cluster.

Gautam Goswami user avatar by
Gautam Goswami
CORE ·
Jan. 12, 23 · Tutorial
Like (1)
Save
Tweet
Share
2.24K Views

Join the DZone community and get the full member experience.

Join For Free

This short article explains how to resolve the error: ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)kafka.common.InconsistentClusterIdException when we start the Apache Kafka installed and configured on a multi-node cluster. You can read the steps for setting up a multi-node Apache Kafka cluster here.

Without integrating Apache Zookeeper, Kafka alone won’t be able to form the complete Kafka cluster. Because ZooKeeper handles the leadership election of Kafka brokers and manages service discovery as well as cluster topology. It also tracks when topics are created or deleted from the cluster and maintains a topic list. Overall, ZooKeeper provides an in-sync view of the Kafka cluster.

The above-mentioned error is quite common and can be encountered while we are updating the server.propertiesfile on each Kafka Broker in the existing cluster to add an additional zookeeper server entry because of the new Kafka Broker addition into the cluster. It might be possible to face this issue on a single node Kafka Broker, too, after a system reboot if performed any configuration changes on the Zookeeper’s zoo.cfg or Kafka’s server. properties file to replace/update the /tmp directory location.

The root cause of the issue is when Zookeeper data are stored in the temporary folder and Kafka logs are stored in the persistent folder or vice versa. Ideally, the default value of dataDir is /tmp/zookeeper  in zoo.cfg  or Zookeeper to store the snapshots, and similarly, the default value of log.dirs in server.properties for Kafka Broker is /tmp/kafka-logs. After the system restarts, files that are stored in that temporary directory get cleaned, and a new cluster ID would be generated due to the complete new registration of the Kafka cluster. Eventually, this configuration mismatch or cluster id number variation causes the above mention error.

There are two ways to resolve the above error quickly, but they are not recommended for the production environment.

Option 1: Update the Cluster ID in the file meta.properties 

The meta.properties file can be located at /tmp/kafka-logs if the value of log.dirskey in server.properties was not updated with a persistent folder location. Open the meta.properties, the contents will be similar as shown below. Replace the cluster.id value with the new cluster ID present in the error log and restart the Kafka server.

Cluster.id

Option 2: Delete /tmp/kafka-logs/meta.properties which saved the wrong cluster.id of last/failed session.

Hope you have enjoyed this read. Please like and share if you feel this composition is valuable.

Apache ZooKeeper cluster kafka Error message Command (computing)

Published at DZone with permission of Gautam Goswami, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • AWS Fargate: Deploying Jakarta EE Applications on Serverless Infrastructures
  • How to Cut the Release Inspection Time From 4 Days to 4 Hours
  • Internal Components of Apache ZooKeeper and Their Importance
  • Handling Automatic ID Generation in PostgreSQL With Node.js and Sequelize

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: