milvus-logo
Star
0
Forks
0
快速开始

Manage Milvus Connections

Milvus Docs 需要你的帮助

本文档暂时没有中文版本,欢迎你成为社区贡献者,协助中文技术文档的翻译。
你可以通过页面右边的 编辑 按钮直接贡献你的翻译。更多详情,参考 贡献指南。如需帮助,你可以 提交 GitHub Issue

This topic describes how to connect to and disconnect from a Milvus server.

Ensure to connect to Milvus server before any operations.

Below example connects to a Milvus server with host as localhost and port as 19530 and disconnects from it.

Connect to a Milvus server

Construct a Milvus connection. Ensure to connect to Milvus server before any operations.

# Run `python3` in your terminal to operate in the Python interactive mode.
from pymilvus import connections
connections.connect(alias="default", host='localhost', port='19530')
import { MilvusClient } from "@zilliz/milvus2-sdk-node";
const address = "localhost:19530";
const milvusClient = new MilvusClient(address);
connect -h localhost -p 19530 -a default
Parameter Description
alias Alias of the Milvus connection to construct.
host IP address of the Milvus server.
port Port of the Milvus server.
Parameter Description
address Address of the Milvus connection to construct.
Option Full name Description
-h --host (Optional) The host name. The default is "127.0.0.1".
-p --port (Optional) The port number. The default is "19530".
-a --alias (Optional) The alias name of the Milvus link. The default is "default".
-D --disconnect (Optional) Flag to disconnect from the Milvus server specified by an alias. The default alias is "default".
--help n/a Displays help for using the command.

Disconnect from a Milvus server

Disconnect from a Milvus server.

connections.disconnect("default")
await milvusClient.closeConnection();
connect -D
Parameter Description
alias Alias of the Milvus server to disconnect from.

What's next

Having connected to a Milvus server, you can:

For advanced operations, check:

该页面是否对你有帮助?
本页目录