Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple bootstrap_uri does not work #694

Open
nvp152 opened this issue Aug 7, 2023 · 2 comments
Open

Support for multiple bootstrap_uri does not work #694

nvp152 opened this issue Aug 7, 2023 · 2 comments

Comments

@nvp152
Copy link

nvp152 commented Aug 7, 2023

What can we help you with?

When running kafka in high availability mode, one would typically set up one's clients with a list of bootstrap uri so that the client can cycle through them and find the first one that is willing to handover its broker topology info. It does not appear that Karapace supports this. I can see that if I pass a list karapace will split the string and operate on the first bootstrap uri, however, i don't see it cycling through the various entries.

Am I missing something?

@tvainika
Copy link
Contributor

tvainika commented Aug 7, 2023

Karapace passes bootstrap_uri as a string to underlying libraries, ie aiokafka and kafka-python. Those support comma separated list e.g. server1:9092,server2:9092 as a list of bootstrap servers. However after that it is randomly picked which server to connect first. Does this help your case?

@nvp152
Copy link
Author

nvp152 commented Aug 7, 2023

@tvainika - so it does answer the question that multiple bootstrap_uris are supposed to work. I wanted to make sure that was the case before I reported a bug. So bug there is - if I send a list of 2 bootstrap uris:

- name: KARAPACE_BOOTSTRAP_URI
  value: mykafka-controller-1.mykafka-controller-headless.default.svc.cluster.local:9092,mykafka-controller-0.mykafka-controller-headless.default.svc.cluster.local:9092

and one of them is down, karapace keeps cycling and kafka clients that try to connect to it get this error

 io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Error; error code: 50005

The log cycling i am referring to looks like this:

kafka.conn              schema-reader   WARNING         DNS lookup failed for mykafka-controller-1.mykafka-controller-headless.default.svc.cluster.local:9092, exception was [Errno -2] Name or service not known. Is your advertised.listeners (called advertised.host.name before Kafka 9) correct and resolvable?
kafka.conn              schema-reader   ERROR           DNS lookup failed for mykafka-controller-1.mykafka-controller-headless.default.svc.cluster.local:9092 (AddressFamily.AF_UNSPEC)
karapace.utils          kafka-python-producer-1-network-thread  INFO            Node id bootstrap-1 no longer in cluster metadata, closing connection and requesting update
kafka.conn              kafka-python-producer-1-network-thread  WARNING         DNS lookup failed for mykafka-controller-1.mykafka-controller-headless.default.svc.cluster.local:9092, exception was [Errno -2] Name or service not known. Is your advertised.listeners (called advertised.host.name before Kafka 9) correct and resolvable?
kafka.conn              kafka-python-producer-1-network-thread  ERROR           DNS lookup failed for mykafka-controller-1.mykafka-controller-headless.default.svc.cluster.local:9092 (AddressFamily.AF_UNSPEC)
karapace.utils          schema-reader   INFO            Node id bootstrap-1 no longer in cluster metadata, closing connection and requesting update

@nvp152 nvp152 changed the title Support for multiple bootstrap_uri? Support for multiple bootstrap_uri does not work Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants