Connecting to Milvus service

You can connect to a Milvus service by using a client program or a gRPC URI after provisioning Milvus as a service in IBM® watsonx.data through the web console.

watsonx.data on Red Hat® OpenShift®

Before you begin

To connect to the Milvus service from a client program, make sure that the following items are installed or available:
  • Python and Pymilvus package. See About PyMilvus.
  • Hostname and port for the Milvus server or workstation where the watsonx.data instance is installed.
  • Authorized user credentials to access the Milvus server.
  • Milvus server name.

About this task

Connect to a Milvus service by using the following steps:

Procedure

  1. Provision a Milvus service in watsonx.data through the web console. See Adding a Milvus service.
  2. Obtain a self-signed certificate for the route.
    From the navigation menu, go to Configurations > Connection information > Engine and service connection details, expand the Milvus service from the list. Copy the SSL certificate and save it to the workstation you want to connect to Milvus from.
  3. Run the following commands by using Python SDK (PyMilvus) to connect with Milvus for gRPC route:
    connections.connect(
        alias='default',
        secure=True, server_pem_path="<path/to/grpc_certificate>", server_name="<grpc_route>",
        host='<grpc_route>',
        port='443',
        user='<CPD_username>',
        password='<CPD_password>')

    For example:

    connections.connect(
        alias='default',
        secure=True, server_pem_path="/root/cert/milvus-grpc.crt", server_name="ibm-lh-lakehouse-milvus475.milvus.apps.keyword.cp.fyre.ibm.com",
        host='ibm-lh-lakehouse-milvus475.milvus.apps.keyword.cp.fyre.ibm.com',
        port='443',
        user='admin',
        password='v4B##..##PBY')
    Note:
    • The parameters secure=True and server_pem_path are specific to SSL enabled in Milvus.
    • The route that is obtained with -grpc is the route for the gRPC server. You can also use -rest to obtain the route for the REST server.

      For more information, see Milvus Docs.

    • Use the GRPC endpoints for SDKs and https endpoints for API calls.
    Tip: Milvus can connect to an unactivated storage. The storage is activated only if it has a catalog associated. This is not mandatory.

What to do next

You can perform the following operations after establishing a connection with a Milvus service:

For more information, see Milvus Docs.