I’m attempting to use the client using EventStoreDB v24.6.0. First, I created multi-cluster using the following documentation:
Next, I’m trying to connect to the cluster using the following Python code:
event_store = EventStoreDBClient(
uri=os.getenv('EVENTSTORE_URL'),
root_certificates=os.getenv('EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH')
)
The .env file contains the following:
EVENTSTORE_URL=esdb+discover://admin:changeit@localhost:2111,localhost:2112,localhost:2113?tls=true&tlsVerifyCert=false
EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/certs/ca
When I attempt to run the Python code, I’m getting the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/esdbclient/client.py", line 258, in _discover_preferred_node
cluster_members = connection.gossip.read(
File "/usr/local/lib/python3.9/site-packages/esdbclient/gossip.py", line 101, in read
raise handle_rpc_error(e) from None
esdbclient.exceptions.ServiceUnavailable: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:2113: Failed to connect to remote host:
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-09-04T05:26:50.463803999+00:00", grpc_status:14
d to connect to remote host: Connection refused"}"
>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/main.py", line 17, in <module>
event_store = EventStoreDBClient(
File "/usr/local/lib/python3.9/site-packages/esdbclient/client.py", line 190, in __init__
self._esdb = self._connect_to_preferred_node()
File "/usr/local/lib/python3.9/site-packages/esdbclient/client.py", line 230, in _connect_to_preferred_node
raise e
File "/usr/local/lib/python3.9/site-packages/esdbclient/client.py", line 224, in _connect_to_preferred_node
preferred, cluster_members, connection = self._discover_preferred_node(
File "/usr/local/lib/python3.9/site-packages/esdbclient/client.py", line 270, in _discover_preferred_node
raise DiscoveryFailed(msg) from last_exception
esdbclient.exceptions.DiscoveryFailed: Failed to read from gossip seed: ['localhost:2111', 'localhost:2112', 'localhost:2113']
Finally, the EventStoreDB appears to be up and operational because the following command generates favorable results:
curl -v --insecure --fail -X GET "https://admin:changeit@[::1]:2113/gossip"