跳到主要内容
版本:v3.0.x

reconnectToPrimary()

This operation reconnects the client to the primary cluster of a global cluster topology, rebuilding the channel pool when the primary endpoint has changed.

JavaScript
await milvusClient.reconnectToPrimary()

Request Syntax​

JavaScript
await milvusClient.reconnectToPrimary()

PARAMETERS:

This operation has no parameters.

RETURNS:

Promise<boolean>

This method returns a promise that resolves to a boolean indicating whether the client successfully reconnected to the primary cluster.

EXCEPTIONS:

  • MilvusError

    This exception will be raised when any error occurs during this operation.

Example​

JavaScript
import { MilvusClient } from '@zilliz/milvus2-sdk-node';

const milvusClient = new MilvusClient({
address: 'localhost:19530',
token: 'root:Milvus',
});

const reconnected = await milvusClient.reconnectToPrimary();