Closed zloyded closed 1 year ago
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!!!
i see dns resolver problems with VPN
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'))")
Hello?
IF you correctly read the documentation you would know what you're doing wrong.
Problems with SRV discovery connect:
why attempt connect to localhost?!