To establish a connection to a Zilliz Cloud cluster, you will need to provide several relevant parameters. For instance, the PyMilvus SDK's connect method can be used as shown below:
from pymilvus import Connections
conn = Connections.connect(
alias=ALIAS,
host=HOST,
port=PORT,
user=USER,
password=PASSWORD,
timeout=30,
secure=True
)
A connection timeout error may occur in the following scenarios:
-
Poor network conditionsTo address poor network conditions, it is recommended to increase the timeout duration for the connect operation. In the above code,
timeout
is set to30
seconds, meaning that the connect operation will time out if no response is received within 30 seconds after the request has been sent. -
Incorrect connection parametersZilliz Cloud clusters come with TLS enabled, so to connect successfully to your cluster, ensure that you include
secure
in the connect parameters and set it totrue
as shown in the above example. Failure to do so may result in a connection failure and a timeout error prompt. -
Non-whitelisted local IP addressesIf you are attempting to connect to your cluster, you also need to ensure that you have turned off any VPN/Proxy connections, obtained your public IP address (private IP addresses simply do not work), and added that IP address to the whitelist for the clusters you want to connect to.