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 automatic DNS lookup for kafka bootstrap servers #3328

Closed
niebayes opened this issue Feb 19, 2024 · 4 comments · Fixed by #3379
Closed

Support automatic DNS lookup for kafka bootstrap servers #3328

niebayes opened this issue Feb 19, 2024 · 4 comments · Fixed by #3379
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@niebayes
Copy link
Contributor

What type of enhancement is this?

User experience

What does the enhancement do?

Amazon MSK users can only obtain bootstrap server addresses in the form of b-1.niebayesmskcluste.vekjkv.c2.kafka.ap-southeast-1.amazonaws.com:9094. However, greptimedb requires addresses in the form of 127.0.0.1:9094. Therefore, we need to support automatic DNS lookup to obtain available bootstrap server addresses.

Implementation challenges

No response

@niebayes niebayes self-assigned this Feb 19, 2024
@niebayes niebayes added good first issue Good for newcomers Size: S and removed size/xs labels Feb 19, 2024
@niebayes niebayes removed their assignment Feb 19, 2024
@tisonkun
Copy link
Collaborator

@niebayes, since you marked this issue as a "good first issue," could you share a permalink to the related code?

@niebayes
Copy link
Contributor Author

niebayes commented Feb 20, 2024

Currently, users are required to provide their own broker_endpoints for Kafka wal, or the default endpoint 127.0.0.1:9092 would be used. See the provisioned example configuration files, for e.g.

# The broker endpoints of the Kafka cluster. ["127.0.0.1:9092"] by default.
# broker_endpoints = ["127.0.0.1:9092"]

However, users may not able to obtain broker endpoints in the form of 127.0.0.1:9092, but in the form of b-1.niebayesmskcluste.vekjkv.c2.kafka.ap-southeast-1.amazonaws.com:9094 which requires DNS lookup.

We want to eliminate the need for users to manually perform DNS lookup and instead perform automatic DNS lookup within greptimedb.

There might have two methods to accomplish this task (Any other solutions are welcome):

  • Check broker endpoints whenever we use them. If they're not in the form of 127.0.0.1:9092, perform a DNS lookup. You're required to investigate public crates on DNS lookup and choose an appropriate one.
  • Modify the deserialization logic for broker_endpoints to perform an automatic DNS lookup when necessary. You may find the serde crate useful.

The definitions of wal configs reside in this file.

@J0HN50N133
Copy link
Contributor

I would like to offer some help. I've found a simple crate dns-lookup and would like to implement it in the second way.

@tisonkun
Copy link
Collaborator

@J0HN50N133 Cool. Go ahead and welcome to ping @niebayes or me as a reviewer when you prepare a patch :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants