This topic describes how to confirm that the topics selected when you create a Milvus data source cover all the topics required for incremental synchronization.
Check the number of topics
Query the number of Milvus DML channels by checking the
dmlChannelNumparameter in the Milvus database. The default value is 16, which is recorded in themilvus.yamlfile.The format of the topics automatically created in the Milvus database is as follows:
${msgChannel.chanNamePrefix.cluster}-${msgChannel.chanNamePrefix.rootCoordDml}_{num}Note
The value of {num} ranges from 0 to dmlChannelNum - 1.
Check whether the number of topics automatically created in the Milvus database corresponds to the
dmlChannelNumparameter. After all topics are created, there are 16 topics by default.by-dev-rootcoord-dml_0 by-dev-rootcoord-dml_1 by-dev-rootcoord-dml_10 by-dev-rootcoord-dml_11 by-dev-rootcoord-dml_12 by-dev-rootcoord-dml_13 by-dev-rootcoord-dml_14 by-dev-rootcoord-dml_15 by-dev-rootcoord-dml_2 by-dev-rootcoord-dml_3 by-dev-rootcoord-dml_4 by-dev-rootcoord-dml_5 by-dev-rootcoord-dml_6 by-dev-rootcoord-dml_7 by-dev-rootcoord-dml_8 by-dev-rootcoord-dml_9If the number of topics does not match the value of the
dmlChannelNumparameter, you can create a collection and specify the number of shards asdmlChannelNum.
Create a collection and specify the number of shards
You can create a collection and specify the number of shards by using Python, Java, or Attu.
Python
client.create_collection(
collection_name="collection_name",
schema=schema,
# highlight-next-line
num_shards=16
)
Java
CreateCollectionReq createRequest = CreateCollectionReq.builder()
.collectionName("collection_name")
.collectionSchema(collectionSchema) // The schema of the collection.
.numShards(16)
.build();
client.createCollection(createRequest);
Attu
Connect to the Milvus server by using Attu.
In the Databases section, click the name of the database in which you want to create a collection.
On the Collections tab, click Create Collection.
Configure the parameters and specify the number of shards.
After the parameters are configured, click Create.