Skip to main content
Version: User Guides (BYOC)

Connect to Cluster

This article offers a systematic guide on connecting to a cluster.

Before you start

Ensure the following prerequisites are met before proceeding:

  • You have deployed a BYOC project. For details, see Deploy BYOC on AWS.

  • You have created a cluster. For details, see Create Cluster.

  • You have installed a Milvus SDK applicable to your use case. For details, see Install SDKs.

📘Notes

For those leaning towards the utilization of RESTful APIs over SDKs, it's important to understand that a continuous connection cannot be established. This is attributed to the HTTP protocol's unidirectional communication mode.

Connect to a cluster

Once your cluster is operational, connect to it utilizing its public endpoint and an authentication token. This token can be a cluster credential that consists of a username and password pair.

# Connect using a MilvusClient object
from pymilvus import MilvusClient
CLUSTER_ENDPOINT="YOUR_CLUSTER_ENDPOINT" # Set your cluster endpoint
TOKEN="YOUR_CLUSTER_TOKEN" # Set your token

# Initialize a MilvusClient instance
# Replace uri and token with your own
client = MilvusClient(
uri=CLUSTER_ENDPOINT, # Cluster endpoint obtained from the console
token=TOKEN # a colon-separated cluster username and password
)