[Solved]Error starting the schema registry in Kafka | Big Data | Kafka | Errors

In this article, we will explain how to resolve “SchemaRegistryTimeoutException: Timed out waiting for join group to complete” in Kafka cluster.




Kafka is one of the distributed mechanism for distributed message system. While I am connecting Kafka server & Zookeeper server getting below error in the Confluent Kafka multi node cluster along with Big Data environment.

ERROR : SchemaRegistryTimeoutException in Kafka

Error starting the schema registry (io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication:77)
io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryInitializationException: io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryTimeoutException: Timed out waiting for join group to complete
at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.init(KafkaSchemaRegistry.java:310)
at io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication.initSchemaRegistry(SchemaRegistryRestApplication.java:75)
at io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication.configureBaseApplication(SchemaRegistryRestApplication.java:90)
at io.confluent.rest.Application.configureHandler(Application.java:217)
at io.confluent.rest.ApplicationServer.doStart(ApplicationServer.java:187)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain.main(SchemaRegistryMain.java:43)
Caused by: io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryTimeoutException: Timed out waiting for join group to complete
at io.confluent.kafka.schemaregistry.masterelector.kafka.KafkaGroupMasterElector.init(KafkaGroupMasterElector.java:207)
at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.init(KafkaSchemaRegistry.java:305)

Solution 1:

First, check all services are in the Kafka cluster. In my case Zookeeper goes down.
Step 1 : Check the Zookeeper log files, in that log file it showing “java.netConnectionExeption: Connection refused” .

Step 2: Re-start the Zookeeper service in the cluster using below command:

zk restart

or

sudo /etc/init.d/zookeeper-server start

Step 3: After re-started ZK service then re-start Kafka service.




Note: In case still getting same error try to do below solution 2.

Solution 2:

Step 1: First, delete the all Zookeeper data and rebuild-again

Step 2: After that change Zookeeper service hostname  like localhost:2181. If you have localhost then change into fully qualified domain name (FQDN)

Step 3: Then setting up schema -registry connection like below :

listeners =https://FQDN: PORTNumber
kafkastore.connection.url= FQDN/IP:2181
kafkastore.topic=_schemas
debug=false

Step 4: Restart ZK server & Kafka Server using below commands:

nohup /usr/bin/kafka-server-start /etc/kafka/server.properties > /logdir/server.log 2>&1 &
nohup /usr/bin/zookeeper-server-start /etc/zookeeper/zookeeper_server.properties > /logdir/server.log 2>&1 &

Summary: The above resolutions are very simple to resolve the Kafka time – out exception for Kafka Admins/Developers for Kafka Confluent. Here we provided two solutions with simple steps for this type issues. After setting up schema – registry file then re-start both Zookeeper & Kafka servers in the Confluent Kafka cluster. Currently, Kafka is used for large data streaming with fortune companies in IT market with huge Kafka clusters in the Big Data environment for Kafka Professionals.