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

SRV srv_domain parameter is ignored #276

Closed
zloyded opened this issue Feb 11, 2021 · 5 comments
Closed

SRV srv_domain parameter is ignored #276

zloyded opened this issue Feb 11, 2021 · 5 comments

Comments

@zloyded
Copy link

zloyded commented Feb 11, 2021

Problems with SRV discovery connect:

import etcd

cl = etcd.Client(srv_domain='my_domain.zone')
cl.stats
>>
Connection to etcd failed due to MaxRetryError("HTTPConnectionPool(host='127.0.0.1', port=4001): Max retries exceeded with url: /v2/stats/self (Caused by ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))")

why attempt connect to localhost?!

@zloyded
Copy link
Author

zloyded commented Feb 12, 2021

in __init__ of Client can see defaults

            self,
            host='127.0.0.1',
            port=4001,
...

Why it here? If i need service discovery this code would be ignored, and will try to init connection by host in the defaults!!!

@zloyded zloyded closed this as completed Feb 12, 2021
@zloyded
Copy link
Author

zloyded commented Feb 12, 2021

i see dns resolver problems with VPN

@zloyded zloyded reopened this Feb 26, 2021
@zloyded
Copy link
Author

zloyded commented Feb 26, 2021

okay!
I have correct resolve my SRV record in Python:

srv_domain='_etcd-client._tcp.my_sub.my_company.my_zone'
q = dns.resolver.query(srv_domain, 'SRV')
for h in q:
   print(h.target.to_text(omit_final_dot=True), h.port)
0etcd0002.e.my_co.my_z 2379
0etcd0003.e.my_co.my_z 2379
1etcd0002.e.my_co.my_z 2379

and try to discover

ec = etcd.Client(srv_domain=srv_domain)
ec.stats
>>
EtcdConnectionFailed: Connection to etcd failed due to MaxRetryError("HTTPConnectionPool(host='127.0.0.1', port=4001): Max retries exceeded with url: /v2/stats/self (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1d982b4910>: Failed to establish a new connection: [Errno 111] Connection refused'))")

@zloyded
Copy link
Author

zloyded commented Mar 10, 2021

Hello?

@lavagetto
Copy link
Collaborator

IF you correctly read the documentation you would know what you're doing wrong.

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