A slave with the same server_uuid/server_id as this slave has connected to the master

279 views
Skip to first unread message

Liang Mou

unread,
Mar 29, 2023, 5:18:05 PM3/29/23
to debezium
Hi team,

Sometimes when I deploy a fix into the kafka connect clusters which would rerun the /usr/local/bin/connect-distributed.sh command, sometimes I noticed some connectors failed to restart with an error like 'A slave with the same server_uuid/server_id as this slave has connected to the master'. 

Do you know what's the best way to fix this?


Thanks.



Liang Mou

unread,
Mar 29, 2023, 5:30:39 PM3/29/23
to debezium
Currently my workaround is deleting the connectors and recreate them again ( i use the same server.id), sometimes I need to do this a few times till it worked.

Chris Cranford

unread,
Mar 30, 2023, 8:11:08 AM3/30/23
to debe...@googlegroups.com
Hi Liang -

Can you explain what you mean by "deploy a fix" and why you need to rerun the shell script?

Chris
--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/8a84ec9f-731b-4a83-899a-6a89158432f6n%40googlegroups.com.

S G

unread,
Apr 1, 2023, 9:50:35 AM4/1/23
to debe...@googlegroups.com
you need to have an unique server id for each connector 


Regards,
Srikanth

--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.

Liang Mou

unread,
Apr 1, 2023, 9:50:45 AM4/1/23
to debe...@googlegroups.com
I run connect in a docker container where the shell script will be executed when the container is started. I have a cluster of ec2 hosts where each one runs one such container. When I deploy something, it performs a rolling restart.




Chris Cranford

unread,
Apr 1, 2023, 10:13:15 AM4/1/23
to debe...@googlegroups.com
Ok, so if you're restarting your Kafka Connect runtimes and if the previous runtime hasn't successfully stopped before the new runtime starts; this could easily lead to this situation where you still have an existing MySQL connected to the cluster with that server id.  If you're going to do such rolling restarts, you need to guarantee that the previous Kafka Connect cluster has stopped entirely before proceeding to start the cluster again. 

Hope that helps.
Chris

Liang Mou

unread,
Apr 1, 2023, 11:01:38 AM4/1/23
to debe...@googlegroups.com
Thanks Chris. How to restart a distributed Kafka connect cleanly in case of a deploy (which is not rare) is something I have been searching for, do you happen to know some links you can share with me? 

Chris Cranford

unread,
Apr 2, 2023, 10:11:40 AM4/2/23
to debe...@googlegroups.com
Hi Liang -

When you deploy a new connector in Kafka Connect, the entire process doesn't need to be stopped; Kafka Connect will perform a rebalance anytime a new connector is deployed and/or if a connector's configured is modified.  This rebalance process automatically stops any affected connectors and restarts them.  Where you can find yourself in the same situation with a rebalance is if the previous connector fails to stop within the grace period that is allowed by Kafka Connect.  In that case, Kafka Connect indicates this in the logs and proceeds to restart the connector.  If this happens, then we need to investigate why because normally our connectors shutdown relatively fast and perhaps there is a corner case either with your configuration or with a specific environment scenario we haven't accounted for or considered.

Hope that helps.
Chris
Reply all
Reply to author
Forward
0 new messages