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

make braft PeerId support hostname/dns. #419

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xiaolin310
Copy link

As an implement of Issue
#18

@xiaolin310 xiaolin310 force-pushed the braft-hostname branch 2 times, most recently from cfa1256 to 60b7c0e Compare August 28, 2023 10:57
  * add more constructor for PeerId.
  * modify PeerId operator<.
  * use brpc naming_service_url init channel API to force resolv dns.
  * modify raft_meta log saved format when PeerId type is HostName.
  * init channels only once and save them for future use
* define a struct named HostNameAddr, as an attribute of PeerId
* wrap a function to build naming_service_url, which is used for brpc channel init
* modify logic about channel init with naming service
* minor fix about hostnameAddr port_ type
@kishorenc
Copy link
Contributor

@PFZheng

It would be really useful for braft to support hostname/dns for PeerId as it will allow it to be used on Kubernetes that dynamically assigns IPs.

@gulu-goolu
Copy link

looks fine! but it's complex for me, I think you should replace brpc::Init(server_and_port, nullptr) with brpc::Init(service, "rr", nullptr),because the brpc::Init(service, "rr", nullptr) can compatible with brpc::Init(service_and_port, nullptr).

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

Successfully merging this pull request may close these issues.

3 participants