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

ZOOKEEPER-2184: Resolve address only on demand. #199

Closed

Conversation

geek101
Copy link

@geek101 geek101 commented Mar 17, 2017

Wrap hostname and port into a new ServerCfg class and fix
all the places to use it instead of InetSocketAddress.

This class can be used in the future to encapsulate other
nice config information for example certificate
fingerprint associated with the host etc.

@adyach
Copy link

adyach commented Jun 16, 2017

@geek101 will it help to update the list of the ip address in case I use load balancer in connection string? I am asking since I have not found when zookeeper updates list of got ip address. In case we have a situation, when all ip address are not valid anymore.

@adyach
Copy link

adyach commented Jun 16, 2017

Seems like this is #150

@geek101
Copy link
Author

geek101 commented Jun 16, 2017

@adyach can you give me an example of a connection string that you are implying this will help me understand the problem better. Since the client code needs ip addresses of the ZK ensemble, does the DNS resolution of this load balancer hostname supposed to return that set of ip addresses?

@adyach
Copy link

adyach commented Jun 16, 2017

your.zookeeper.loadbalancer
The problem is that it is resolved only once when connected, but instances behind load balancer can be replaced.

@geek101
Copy link
Author

geek101 commented Jun 17, 2017

@adyach this patch's goal is to make sure when ever a new connection is being established DNS lookup will be performed. If you have given a hostname in connection string then if the underlying IP is gone the TCP connection will break and new TCP connection will be attempted by Zookeeper code and at this time DNS lookup will again be performed.

I hope this helps if you can post your example of connection string it will be more helpful. Zookeeper connection string is supposed to contain the ZK ensemble set/subset hostnames/ips.

Powell Molleti added 2 commits June 29, 2017 09:17
Wrap hostname and port into a new ServerCfg class and fix
all the places to use it instead of InetSocketAddress.

This class can be used in the future to encapsulate other
nice config information for example certificate
fingerprint associated with the host etc.
The random number returned can be signed hence negative and
for those cases test fails quickly. For a valid ip that is
not reachable ittakes a while longer to declare connection failure.
@geek101 geek101 force-pushed the branch-3.5-hostname-resolve-always branch from dcab629 to 08265b2 Compare July 1, 2017 17:03
@anmolnar anmolnar closed this Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants