baidu / braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Apache License 2.0
3.84k stars 862 forks source link

make braft PeerId support hostname/dns. #419

Open xiaolin310 opened 10 months ago

xiaolin310 commented 10 months ago

As an implement of Issue https://github.com/baidu/braft/issues/18

kishorenc commented 6 months ago

@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 commented 6 months ago

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).