diff --git a/site/en/adminGuide/switch_milvus_cluster_mq_type-helm.md b/site/en/adminGuide/switch_milvus_cluster_mq_type-helm.md new file mode 100644 index 000000000..13f7e3155 --- /dev/null +++ b/site/en/adminGuide/switch_milvus_cluster_mq_type-helm.md @@ -0,0 +1,260 @@ +--- +id: switch_milvus_cluster_mq_type-helm.md +summary: Learn how to switch the message queue type for a Milvus cluster. +title: Switch MQ Type for Milvus Cluster +--- + +# Switch MQ Type for Milvus Cluster + +This topic describes how to switch the message queue (MQ) type for an existing Milvus cluster deployment. Milvus supports online MQ switching between Pulsar, Kafka, and Woodpecker without downtime. + +
+ +This feature is pending release and is subject to change. Please reach out to Milvus support if you want to try it out or have any questions. + +
+ +## Prerequisites + +- A running Milvus cluster instance installed via [Helm](install_cluster-helm.md). +- The Milvus instance has been upgraded to the latest version that supports this Switch MQ feature (v2.6.14 or later). + +## Switch from builtin/external Pulsar/Kafka to Woodpecker (MinIO) + +Follow these steps to switch the MQ type from Pulsar or Kafka to Woodpecker with MinIO storage. + +### Step 1: Verify the Milvus instance is running + +Before switching, ensure that your Milvus cluster instance is running properly. You can verify this by creating a test collection, inserting data, and running a query. + +### Step 2: Execute the MQ switch + +
+ +If you are switching to Woodpecker for the first time, you can skip this note. Otherwise, when switching repeatedly, make sure to clean up the related data before switching. Residual data may cause unexpected behavior. For example, switching from Woodpecker (MinIO/local) to another MQ and then back to Woodpecker requires cleaning up Woodpecker meta and data first. + +
+ +Run the following command to trigger the switch to Woodpecker: + +```shell +curl -X POST http://:/management/wal/alter \ + -H "Content-Type: application/json" \ + -d '{"target_wal_name": "woodpecker"}' +``` + +
+ +Replace `` and `` with the actual address of your MixCoord service. You can typically use `kubectl port-forward` to expose the MixCoord management interface: + +```shell +kubectl port-forward --address 0.0.0.0 service/my-release-milvus-mixcoord 29091:9091 +``` + +In this case, `mixcoord_addr` is the IP of the machine running the command, and `mixcoord_port` is the forwarded port `29091`. + +
+ +### Step 3: Verify the switch is complete + +The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished: + +```shell +kubectl logs my-release-milvus-mixcoord-68d9889549-vdj8n | grep "successfully updated mq.type configuration in etcd" +``` + +If the switch is successful, the output should look similar to the following: + +``` +[INFO] [coordinator/wal_callbacks.go:90] ["successfully updated mq.type configuration in etcd"] +[targetWALName=WoodPecker] [config=null] [broadcastID=464632819924869973] [configKey=mq.type] [mqTypeValue=woodpecker] +``` + +### Step 4: [Optional] Stop Pulsar pods and clean up Pulsar data + +#### For builtin Pulsar instances + +After confirming the switch to Woodpecker is successful, you can remove the Pulsar pods and their associated PVC data. + +Run the following command to disable Pulsar and enable Woodpecker: + +```shell +helm upgrade my-release zilliztech/milvus \ + --set image.all.tag=v2.6.13 \ + --set pulsarv3.enabled=false \ + --set woodpecker.enabled=true \ + --set streaming.enabled=true \ + --set indexNode.enabled=false +``` + +Run the following commands to delete the Pulsar PVC storage: + +```shell +# Delete Pulsar bookie journal PVCs +kubectl delete pvc my-release-pulsarv3-bookie-journal-my-release-pulsarv3-bookie-0 +kubectl delete pvc my-release-pulsarv3-bookie-journal-my-release-pulsarv3-bookie-1 +kubectl delete pvc my-release-pulsarv3-bookie-journal-my-release-pulsarv3-bookie-2 + +# Delete Pulsar bookie ledger PVCs +kubectl delete pvc my-release-pulsarv3-bookie-ledgers-my-release-pulsarv3-bookie-0 +kubectl delete pvc my-release-pulsarv3-bookie-ledgers-my-release-pulsarv3-bookie-1 +kubectl delete pvc my-release-pulsarv3-bookie-ledgers-my-release-pulsarv3-bookie-2 + +# Delete Pulsar ZooKeeper PVCs +kubectl delete pvc my-release-pulsarv3-zookeeper-data-my-release-pulsarv3-zookeeper-0 +kubectl delete pvc my-release-pulsarv3-zookeeper-data-my-release-pulsarv3-zookeeper-1 +kubectl delete pvc my-release-pulsarv3-zookeeper-data-my-release-pulsarv3-zookeeper-2 +``` + +
+ +If you plan to switch back to Pulsar in the future, you should clean up these data files first to avoid conflicts. Currently, due to Helm chart limitations, it is not possible to switch back to a builtin Pulsar instance. + +
+ +#### For external Pulsar instances + +You can clean up the Milvus-related topics in the external Pulsar instance. The Milvus topic naming format is: + +``` +-dml__ +``` + +For example: `by-dev-rootcoord-dml_10_464633776992639586v0` + +
+ +If you plan to switch back to external Pulsar in the future, you should clean up these topics first to avoid conflicts. + +
+ +## Switch from Woodpecker (MinIO) to external Pulsar/Kafka + +Follow these steps to switch the MQ type from Woodpecker back to external Pulsar or external Kafka. + +### Step 1: Verify the Milvus instance is running + +Before switching, ensure that your Milvus cluster instance is running properly. + +### Step 2: Configure the target MQ connection configuration + +Before triggering the switch, you need to ensure the target MQ service (Pulsar or Kafka) is available and its access configuration is rendered into the Milvus configuration. + +
+ +The exact steps in this section depend on whether you are using an internal (bundled) or external MQ service. + +
+ +If you are using the bundled Pulsar or Kafka deployed by Helm, update your Helm release to enable the target MQ service and disable Woodpecker. +The `streaming.enabled=true` flag is required to enable the Streaming Node, which is a prerequisite for the Switch MQ feature. For example, to switch to Pulsar: + +First, create or edit a `values.yaml` file: + +```yaml +extraConfigFiles: + user.yaml: |+ + pulsar: + address: + port: +``` + +```shell +helm upgrade -i my-release milvus/milvus \ + --set pulsarv3.enabled=true \ + --set woodpecker.enabled=false \ + --set streaming.enabled=true \ + -f values.yaml +``` + +After the upgrade, wait for all pods to be ready. Then, verify that the target MQ access configuration has been rendered into the Milvus configuration. + +### Step 3: Execute the MQ switch + +
+ +Ensure that the target Pulsar/Kafka does not contain Milvus topics from a previous configuration. If this is your first time switching to Pulsar, you can skip this note. Otherwise, clean up the residual Milvus topics with the same names in Pulsar/Kafka first. + +
+ +Run the following command to trigger the switch to Pulsar (replace `pulsar` with `kafka` if switching to Kafka): + +```shell +curl -X POST http://:/management/wal/alter \ + -H "Content-Type: application/json" \ + -d '{"target_wal_name": "pulsar"}' +``` + +
+ +Replace `` and `` with the actual address of your MixCoord service. You can typically use `kubectl port-forward` to expose the MixCoord management interface: + +```shell +kubectl port-forward --address 0.0.0.0 service/my-release-milvus-mixcoord 29091:9091 +``` + +In this case, `mixcoord_addr` is the IP of the machine running the command, and `mixcoord_port` is the forwarded port `29091`. + +
+ +### Step 4: Verify the switch is complete + +The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished: + +```shell +kubectl logs my-release-milvus-mixcoord-68d9889549-vdj8n | grep "successfully updated mq.type configuration in etcd" +``` + +If the switch is successful, the output should look similar to the following: + +``` +[INFO] [coordinator/wal_callbacks.go:90] ["successfully updated mq.type configuration in etcd"] +[targetWALName=pulsar] [config=null] [broadcastID=464632819924869973] [configKey=mq.type] [mqTypeValue=pulsar] +``` + +### Step 5: [Optional] Clean up Woodpecker data on MinIO/S3 and etcd + +Log in to MinIO/S3 and navigate to the corresponding bucket. Delete the Woodpecker data at the following path: + +- Format: `/wp//...` +- Example: typically `files/wp/...` + +Use an etcd tool to delete the Woodpecker metadata. The key-value prefix is as follows: + +- Prefix format: `/...` +- Example: typically `woodpecker/...` + +You can run the following command to view and then clean up the metadata: + +```shell +etcdctl get woodpecker --prefix +``` + +
+ +If you plan to switch back to Woodpecker in the future, you should clean up these data files first to avoid conflicts. + +
+ +## Supported MQ switch scenarios for Helm-installed Milvus Cluster + +| Source MQ | Target MQ | Status | Notes | +|-----------|-----------|--------|-------| +| Builtin Pulsar | Woodpecker (MinIO) | **Supported** | | +| Builtin Pulsar | External Kafka | **Supported** | | +| Builtin Pulsar | Builtin Kafka | **Not supported** | Helm does not support installing two builtin MQ systems simultaneously. | +| External Pulsar | Woodpecker (MinIO) | **Supported** | | +| External Pulsar | External Kafka | **Supported** | | +| Builtin Kafka | Woodpecker (MinIO) | **Supported** | | +| Builtin Kafka | External Pulsar | **Supported** | | +| Builtin Kafka | Builtin Pulsar | **Not supported** | Helm does not support installing two builtin MQ systems simultaneously. | +| External Kafka | Woodpecker (MinIO) | **Supported** | | +| External Kafka | External Pulsar | **Supported** | | +| Builtin/external Pulsar/Kafka | Woodpecker (local) | **Supported but not recommended** | All pods must access the same local disk (e.g., NFS mount), and additional configuration is required. | +| Woodpecker local | Woodpecker MinIO | **Not supported** | Switching between Woodpecker storage modes is not yet supported. May be supported in the future, but not recommended because Woodpecker local mode should not be used in cluster deployments. | + +
+ +Avoid switching MQ types back and forth repeatedly. If you do need to switch, make sure to clean up the related data before each switch. Residual data may cause unexpected behavior. + +
diff --git a/site/en/adminGuide/switch_milvus_cluster_mq_type-operator.md b/site/en/adminGuide/switch_milvus_cluster_mq_type-operator.md index 6b522aa19..3d2940326 100644 --- a/site/en/adminGuide/switch_milvus_cluster_mq_type-operator.md +++ b/site/en/adminGuide/switch_milvus_cluster_mq_type-operator.md @@ -16,10 +16,10 @@ This feature is pending release and is subject to change. Please reach out to Mi ## Prerequisites -- A running Milvus cluster instance installed via [Milvus Operator](install_cluster-milvusoperator.md) or [Helm](install_cluster-helm.md). -- The Milvus instance has been upgraded to the latest version that supports this Switch MQ feature. +- A running Milvus cluster instance installed via [Milvus Operator](install_cluster-milvusoperator.md). +- The Milvus instance has been upgraded to the latest version that supports this Switch MQ feature (v2.6.14 or later). -## Switch from Pulsar/Kafka to Woodpecker (MinIO) +## Switch from builtin/external Pulsar/Kafka to Woodpecker (MinIO) Follow these steps to switch the MQ type from Pulsar or Kafka to Woodpecker with MinIO storage. @@ -27,135 +27,149 @@ Follow these steps to switch the MQ type from Pulsar or Kafka to Woodpecker with Before switching, ensure that your Milvus cluster instance is running properly. You can verify this by creating a test collection, inserting data, and running a query. -### Step 2: (Optional) Verify Woodpecker configuration +### Step 2: Execute the MQ switch -The default Milvus configuration already sets Woodpecker storage type to MinIO, so no additional configuration is required in most cases. - -However, if you have previously customized the Woodpecker configuration, you must ensure that `woodpecker.storage.type` is set to `minio`. Update the Milvus configuration **without** changing the `mqType` value: - -```yaml -woodpecker: - storage: - type: minio -``` +
-- For **Helm**, refer to [Configure Milvus with Helm Charts](configure-helm.md) for instructions on updating configuration. -- For **Milvus Operator**, refer to [Configure Milvus with Milvus Operator](configure_operator.md) for instructions on updating configuration. +If you are switching to Woodpecker for the first time, you can skip this note. Otherwise, when switching repeatedly, make sure to clean up the related data before switching. Residual data may cause unexpected behavior. For example, switching from Woodpecker (MinIO/local) to another MQ and then back to Woodpecker requires cleaning up Woodpecker meta and data first. -### Step 3: Execute the MQ switch +
Run the following command to trigger the switch to Woodpecker: ```shell -curl -X POST http://:9091/management/wal/alter \ +curl -X POST http://:/management/wal/alter \ -H "Content-Type: application/json" \ -d '{"target_wal_name": "woodpecker"}' ```
-Replace `` with the actual address of your MixCoord service. +Replace `` and `` with the actual address of your MixCoord service. You can typically use `kubectl port-forward` to expose the MixCoord management interface: -
+```shell +kubectl port-forward --address 0.0.0.0 service/my-release-milvus-mixcoord 29091:9091 +``` -### Step 4: Verify the switch is complete +In this case, `mixcoord_addr` is the IP of the machine running the command, and `mixcoord_port` is the forwarded port `29091`. -The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished: +However, Milvus Operator currently does not expose the MixCoord service. You need to use `kubectl exec` to enter the MixCoord pod and run the `curl` command from inside the pod. -``` -WAL switch success: switch to finish, re-opening required -AlterWAL broadcast message acknowledged by all vchannels -successfully updated mq.type configuration in etcd -``` - -
+
-In the log messages above, `` is the source MQ type (e.g., `pulsar` or `kafka`), and `` is the target MQ type (`woodpecker`). +### Step 3: Verify the switch is complete -- The first message indicates that the WAL switch from the source to the target has completed. -- The second message indicates that all physical channels have been switched. -- The third message indicates that the `mq.type` configuration has been updated in etcd. +The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished: - +```shell +kubectl logs my-release-milvus-mixcoord-68d9889549-vdj8n | grep "successfully updated mq.type configuration in etcd" +``` -## Switch from Woodpecker (MinIO) to Pulsar or Kafka +If the switch is successful, the output should look similar to the following: -Follow these steps to switch the MQ type from Woodpecker back to Pulsar or Kafka. +``` +[INFO] [coordinator/wal_callbacks.go:90] ["successfully updated mq.type configuration in etcd"] +[targetWALName=WoodPecker] [config=null] [broadcastID=464632819924869973] [configKey=mq.type] [mqTypeValue=woodpecker] +``` -### Step 1: Verify the Milvus instance is running +### Step 4: Update the MQ type in the Operator ConfigMap -Before switching, ensure that your Milvus cluster instance is running properly. +Update the MQ type in the Operator ConfigMap to Woodpecker. First, create a file named `change_configmap.yaml`: -### Step 2: Configure the target MQ +```yaml +apiVersion: milvus.io/v1beta1 +kind: Milvus +metadata: + name: my-release + labels: + app: milvus +spec: + dependencies: + msgStreamType: woodpecker +``` -Before triggering the switch, you need to ensure the target MQ service (Pulsar or Kafka) is available and its access configuration is rendered into the Milvus configuration. +Then apply the configuration update: -
+```shell +kubectl patch -f change_configmap.yaml --patch-file change_configmap.yaml --type merge +``` -The exact steps in this section depend on whether you are using an internal (bundled) or external MQ service. +### Step 5: [Optional] Stop Pulsar pods and clean up Pulsar data -
+#### For builtin Pulsar instances -#### Option A: Internal Pulsar/Kafka (bundled with Helm) +After confirming the switch to Woodpecker is successful, you can remove the Pulsar pods and their associated PVC data. -If you are using the bundled Pulsar or Kafka deployed by Helm, update your Helm release to enable the target MQ service and disable Woodpecker. The `streaming.enabled=true` flag is required to enable the Streaming Node, which is a prerequisite for the Switch MQ feature. For example, to switch to Pulsar: +Run the following command to uninstall Pulsar: ```shell -helm upgrade -i my-release milvus/milvus \ - --set pulsarv3.enabled=true \ - --set woodpecker.enabled=false \ - --set streaming.enabled=true \ - -f values.yaml +helm uninstall my-release-pulsar ``` -After the upgrade, verify that the target MQ access configuration has been rendered into the Milvus configuration. For example, for Pulsar: +Run the following commands to delete the Pulsar PVC storage: -```yaml -pulsar: - address: - port: 6650 +```shell +# Delete Pulsar bookie journal PVCs +kubectl delete pvc my-release-pulsarv3-bookie-journal-my-release-pulsarv3-bookie-0 +kubectl delete pvc my-release-pulsarv3-bookie-journal-my-release-pulsarv3-bookie-1 +kubectl delete pvc my-release-pulsarv3-bookie-journal-my-release-pulsarv3-bookie-2 + +# Delete Pulsar bookie ledger PVCs +kubectl delete pvc my-release-pulsarv3-bookie-ledgers-my-release-pulsarv3-bookie-0 +kubectl delete pvc my-release-pulsarv3-bookie-ledgers-my-release-pulsarv3-bookie-1 +kubectl delete pvc my-release-pulsarv3-bookie-ledgers-my-release-pulsarv3-bookie-2 + +# Delete Pulsar ZooKeeper PVCs +kubectl delete pvc my-release-pulsarv3-zookeeper-data-my-release-pulsarv3-zookeeper-0 +kubectl delete pvc my-release-pulsarv3-zookeeper-data-my-release-pulsarv3-zookeeper-1 +kubectl delete pvc my-release-pulsarv3-zookeeper-data-my-release-pulsarv3-zookeeper-2 ``` -#### Option B: Internal Pulsar/Kafka (managed by Milvus Operator) - -If you are using Milvus Operator, update the Milvus custom resource to include the target MQ access configuration. Refer to [Configure Milvus with Milvus Operator](configure_operator.md) for details on updating Milvus configuration. +
-#### Option C: External Pulsar/Kafka +If you plan to switch back to Pulsar in the future, you should clean up these data files first to avoid conflicts. Currently, due to Helm chart limitations, it is not possible to switch back to a builtin Pulsar instance. -If you are using an external Pulsar or Kafka service, you do not need to change the `mqType`. Simply add the external MQ access configuration to your `values.yaml` and restart the Milvus instance to render the configuration. +
-### Step 3: Execute the MQ switch +#### For external Pulsar instances -Run the following command to trigger the switch to Pulsar (replace `pulsar` with `kafka` if switching to Kafka): +You can clean up the Milvus-related topics in the external Pulsar instance. The Milvus topic naming format is: -```shell -curl -X POST http://:9091/management/wal/alter \ - -H "Content-Type: application/json" \ - -d '{"target_wal_name": "pulsar"}' ``` +-dml__ +``` + +For example: `by-dev-rootcoord-dml_10_464633776992639586v0`
-Replace `` with the actual address of your MixCoord service. +If you plan to switch back to external Pulsar in the future, you should clean up these topics first to avoid conflicts.
-### Step 4: Verify the switch is complete +## Switch from Woodpecker (MinIO) to external Pulsar/Kafka -The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished: +This is currently not supported. When Milvus Operator sets the MQ type to Woodpecker, it does not allow pre-configuring the Pulsar/Kafka connection address in the configuration file, which is required for the switch. -``` -WAL switch success: switch to finish, re-opening required -AlterWAL broadcast message acknowledged by all vchannels -successfully updated mq.type configuration in etcd -``` +## Supported MQ switch scenarios for Operator-installed Milvus Cluster -
+| Source MQ | Target MQ | Status | Notes | +|-----------|-----------|--------|--------------------------------------------------------------------------------------------------------------------------| +| Builtin Pulsar | Woodpecker (MinIO) | **Supported** | | +| Builtin Pulsar | External Kafka | **Not supported** | Milvus Operator does not support pre-configuring the Kafka access address. | +| Builtin Pulsar | Builtin Kafka | **Not supported** | Helm does not support installing two builtin MQ systems simultaneously. | +| External Pulsar | Woodpecker (MinIO) | **Supported** | | +| External Pulsar | External Kafka | **Not supported** | Milvus Operator does not support pre-configuring the Kafka access address. | +| Builtin Kafka | Woodpecker (MinIO) | **Supported** | | +| Builtin Kafka | External Pulsar | **Not supported** | Milvus Operator does not support pre-configuring the Pulsar access address. | +| Builtin Kafka | Builtin Pulsar | **Not supported** | Helm does not support installing two builtin MQ systems simultaneously. | +| External Kafka | Woodpecker (MinIO) | **Supported** | | +| External Kafka | External Pulsar | **Not supported** | Milvus Operator does not support pre-configuring the Pulsar access address. | +| Builtin/external Pulsar/Kafka | Woodpecker (local) | **Supported but not recommended** | All pods must access the same local disk (e.g., NFS mount), and additional configuration is required. | +| Woodpecker local | Woodpecker MinIO | **Not supported** | Switching between Woodpecker storage modes is not yet supported. May be supported in the future, but not recommended because Woodpecker local mode should not be used in cluster deployments. | -In the log messages above, `` is the source MQ type (`woodpecker`), and `` is the target MQ type (e.g., `pulsar` or `kafka`). +
-- The first message indicates that the WAL switch from the source to the target has completed. -- The second message indicates that all physical channels have been switched. -- The third message indicates that the `mq.type` configuration has been updated in etcd. +Avoid switching MQ types back and forth repeatedly. If you do need to switch, make sure to clean up the related data before each switch. Residual data may cause unexpected behavior.
diff --git a/site/en/adminGuide/switch_milvus_standalone_mq_type-operator.md b/site/en/adminGuide/switch_milvus_standalone_mq_type-operator.md deleted file mode 100644 index 8b6dcbeef..000000000 --- a/site/en/adminGuide/switch_milvus_standalone_mq_type-operator.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -id: switch_milvus_standalone_mq_type-operator.md -summary: Learn how to switch the message queue type for Milvus standalone. -title: Switch MQ Type for Milvus Standalone ---- - -# Switch MQ Type for Milvus Standalone - -This topic describes how to switch the message queue (MQ) type for an existing Milvus standalone deployment. Milvus supports online MQ switching without downtime. - -
- -This feature is pending release and is subject to change. Please reach out to Milvus support if you want to try it out or have any questions. - -
- -## Prerequisites - -- A running Milvus Standalone instance installed via [Docker](install_standalone-docker.md) or [Docker Compose](install_standalone-docker-compose.md). -- The Milvus instance has been upgraded to the latest version that supports this Switch MQ feature. - -## General workflow - -The general workflow for switching the MQ type is as follows: - -1. Ensure the Milvus instance is running properly. -2. Confirm the source MQ type and the target MQ type. -3. Configure the target MQ's access settings into the Milvus configuration without changing the `mqType` value. -4. Trigger the switch by calling the WAL alter API. -5. Monitor the logs to verify the switch has completed successfully. - -
- -Before switching, ensure that the target MQ does not contain topics with the same names as those used by the current Milvus instance. This is especially important if the target MQ service has been previously used by another Milvus instance, as conflicting topic names can lead to unexpected behavior. - -
- -## Switch from RocksMQ to Woodpecker (Local Storage) - -This procedure applies to **Milvus Standalone Docker** deployments that use RocksMQ by default. - -### Step 1: Verify the Milvus instance is running - -Ensure your Milvus Standalone Docker instance is running properly. You can verify this by creating a test collection, inserting data, and running a query. - -### Step 2: Configure Woodpecker with local storage - -Update the Milvus configuration to add Woodpecker settings **without** changing the `mqType` value. Create or update the `user.yaml` file with the following content: - -```yaml -woodpecker: - storage: - type: local -``` - -Then restart the Milvus instance to apply the configuration: - -```shell -bash standalone_embed.sh restart -``` - -### Step 3: Execute the MQ switch - -Run the following command to trigger the switch to Woodpecker: - -```shell -curl -X POST http://:9091/management/wal/alter \ - -H "Content-Type: application/json" \ - -d '{"target_wal_name": "woodpecker"}' -``` - -
- -Replace `` with the actual address of your MixCoord service (by default, `localhost` for standalone deployments). - -
- -### Step 4: Verify the switch is complete - -The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished: - -``` -WAL switch success: switch to finish, re-opening required -AlterWAL broadcast message acknowledged by all vchannels -successfully updated mq.type configuration in etcd -``` - -
- -In the log messages above, `` is the source MQ type (`rocksmq`), and `` is the target MQ type (`woodpecker`). - -- The first message indicates that the WAL switch from the source to the target has completed. -- The second message indicates that all physical channels have been switched. -- The third message indicates that the `mq.type` configuration has been updated in etcd. - -
- -## Switch from RocksMQ to Woodpecker (MinIO Storage) - -This procedure applies to **Milvus Standalone Docker Compose** deployments. - -
- -Starting from Milvus v2.6, the default `docker-compose.yaml` already declares `mqType` as Woodpecker. Unless you have modified the default configuration or upgraded from v2.5, this procedure may not be necessary. - -
- -### Step 1: Verify the Milvus instance is running - -Ensure your Milvus Standalone Docker Compose instance is running properly. - -### Step 2: (Optional) Verify Woodpecker configuration - -The default Milvus configuration already sets Woodpecker storage type to MinIO, so no additional configuration is required in most cases. - -However, if you have previously customized the Woodpecker configuration, you must ensure that `woodpecker.storage.type` is set to `minio`. Create or update the `user.yaml` file with the following content: - -```yaml -woodpecker: - storage: - type: minio -``` - -Then restart the Milvus instance to apply the configuration: - -```shell -docker compose down -docker compose up -d -``` - -### Step 3: Execute the MQ switch - -Run the following command to trigger the switch to Woodpecker: - -```shell -curl -X POST http://:9091/management/wal/alter \ - -H "Content-Type: application/json" \ - -d '{"target_wal_name": "woodpecker"}' -``` - -
- -Replace `` with the actual address of your MixCoord service (by default, `localhost` for standalone deployments). - -
- -### Step 4: Verify the switch is complete - -The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished: - -``` -WAL switch success: switch to finish, re-opening required -AlterWAL broadcast message acknowledged by all vchannels -successfully updated mq.type configuration in etcd -``` - -
- -In the log messages above, `` is the source MQ type (`rocksmq`), and `` is the target MQ type (`woodpecker`). - -- The first message indicates that the WAL switch from the source to the target has completed. -- The second message indicates that all physical channels have been switched. -- The third message indicates that the `mq.type` configuration has been updated in etcd. - -
diff --git a/site/en/adminGuide/switch_milvus_standalone_mq_type.md b/site/en/adminGuide/switch_milvus_standalone_mq_type.md new file mode 100644 index 000000000..2e0086c42 --- /dev/null +++ b/site/en/adminGuide/switch_milvus_standalone_mq_type.md @@ -0,0 +1,203 @@ +--- +id: switch_milvus_standalone_mq_type.md +summary: Learn how to switch the message queue type for Milvus standalone. +title: Switch MQ Type for Milvus Standalone +--- + +# Switch MQ Type for Milvus Standalone + +This topic describes how to switch the message queue (MQ) type for an existing Milvus standalone deployment. Milvus supports online MQ switching without downtime. + +
+ +This feature is pending release and is subject to change. Please reach out to Milvus support if you want to try it out or have any questions. + +
+ +## Prerequisites + +- A running Milvus Standalone instance installed via [Docker Compose](install_standalone-docker-compose.md). +- The Milvus instance has been upgraded to the latest version that supports this Switch MQ feature (v2.6.14 or later). + +## General workflow + +The general workflow for switching the MQ type is as follows: + +1. Ensure the Milvus instance is running properly. +2. Confirm the source MQ type and the target MQ type. +3. Configure the target MQ's access settings into the Milvus configuration without changing the `mqType` value. +4. Trigger the switch by calling the WAL alter API. +5. Monitor the logs to verify the switch has completed successfully. + +
+ +Before switching, ensure that the target MQ does not contain topics with the same names as those used by the current Milvus instance. +This is especially important if the target MQ service has been previously used by another Milvus instance, as conflicting topic names can lead to unexpected behavior. + +
+ +## Docker Compose Standalone: Switch from RocksMQ to Woodpecker (Local/MinIO) + +This procedure applies to **Milvus Standalone Docker Compose** deployments that use RocksMQ by default. + +### Step 1: Verify the Milvus instance is running + +Ensure your Milvus Standalone docker compose instance is running properly. You can verify this by creating a test collection, inserting data, and running a query. + +### Step 2: Configure Woodpecker with local storage + +Update the Milvus configuration to add Woodpecker settings **without** changing the `mqType` value. Run `docker exec -it milvus-standalone bash` to enter the container, then edit the `/milvus/configs/user.yaml` file with the following key configuration: + +```yaml +woodpecker: + storage: + type: minio # minio or local +``` + +Then restart the Milvus instance to apply the configuration: + +```shell +docker-compose restart +``` + +### Step 3: Execute the MQ switch + +
+ +If you are switching to Woodpecker for the first time, you can skip this note. Otherwise, when switching repeatedly, make sure to clean up the related data before switching. Residual data may cause unexpected behavior. For example, switching from Woodpecker (MinIO/local) to RocksMQ and then back to Woodpecker requires cleaning up Woodpecker meta and data first. + +
+ +Run the following command to trigger the switch to Woodpecker: + +```shell +curl -X POST http://:/management/wal/alter \ + -H "Content-Type: application/json" \ + -d '{"target_wal_name": "woodpecker"}' +``` + +
+ +This command sends a switch MQ type request to the internal MixCoord component in the standalone instance. Typically, the MixCoord port is `9091`. + +
+ +### Step 4: Verify the switch is complete + +The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished. Run the following command to check the switch progress: + +```shell +docker logs milvus-standalone | grep "successfully updated mq.type configuration in etcd" +``` + +If the switch is successful, the output should look similar to the following: + +``` +[INFO] [coordinator/wal_callbacks.go:90] ["successfully updated mq.type configuration in etcd"] [targetWALName=WoodPecker] +[config=null] [broadcastID=464677797180736841] [configKey=mq.type] [mqTypeValue=woodpecker] +``` + +### Step 5: [Optional] Clean up RocksMQ data + +The RocksMQ data is located in the `volumes/milvus/rdb_data` and `volumes/milvus/rdb_data_meta_kv` directories defined in `docker-compose.yaml`. + +
+ +If you plan to switch back to RocksMQ in the future, you should clean up these data files first to avoid conflicts. + +
+ +## Docker Compose Standalone: Switch from Woodpecker (Local/MinIO) to RocksMQ + +This procedure applies to **Milvus Standalone Docker Compose** deployments that are currently using Woodpecker and want to switch to RocksMQ. + +### Step 1: Verify the Milvus instance is running + +Ensure your Milvus Standalone docker compose instance is running properly. You can verify this by creating a test collection, inserting data, and running a query. + +### Step 2: Execute the MQ switch + +
+ +Ensure that the instance does not have residual RocksMQ data from a previous run. If this is your first time switching to RocksMQ, you can skip this note. Otherwise, clean up the related RocksMQ meta data and data first. + +
+ +Run the following command to trigger the switch to RocksMQ: + +```shell +curl -X POST http://:/management/wal/alter \ + -H "Content-Type: application/json" \ + -d '{"target_wal_name": "rocksmq"}' +``` + +
+ +This command sends a switch MQ type request to the internal MixCoord component in the standalone instance. Typically, the MixCoord port is `9091`. + +
+ +### Step 3: Verify the switch is complete + +The switch process completes automatically. Monitor the Milvus logs for the following key messages to confirm the switch has finished. Run the following command to check the switch progress: + +```shell +docker logs milvus-standalone | grep "successfully updated mq.type configuration in etcd" +``` + +If the switch is successful, the output should look similar to the following: + +``` +[INFO] [coordinator/wal_callbacks.go:90] ["successfully updated mq.type configuration in etcd"] [targetWALName=rocksmq] +[config=null] [broadcastID=464677797180736841] [configKey=mq.type] [mqTypeValue=rocksmq] +``` + +### Step 4: [Optional] Clean up Woodpecker data + +#### Clean up Woodpecker metadata + +Use an etcd tool to delete the Woodpecker metadata. The key-value prefix is as follows: + +- Prefix format: `/...` +- Example: typically `woodpecker/...` + +You can run the following command to view and then clean up the metadata: + +```shell +etcdctl get woodpecker --prefix +``` + +#### Clean up Woodpecker storage data + +If Woodpecker was using **MinIO mode**, delete the log data on object storage. Log in to MinIO and navigate to the corresponding bucket. The data path is as follows: + +- Format: `/wp//...` +- Example: typically `files/wp/...` + +If Woodpecker was using **local mode**, the data is stored on the local disk at `volumes/milvus/data/wp/...`. + +
+ +If you plan to switch back to Woodpecker in the future, you should clean up these data files first to avoid conflicts. + +
+ +## Supported MQ switch scenarios for Milvus Standalone + +**Docker deployment (single container):** MQ switching is not supported because etcd source is not enabled and the `mq.type` config cannot be updated. + +**Docker Compose deployment:** + +| Source MQ | Target MQ | Status | Notes | +|-----------|-----------|--------|-------| +| RocksMQ | Woodpecker (MinIO/local) | **Supported** | | +| Woodpecker (MinIO/local) | RocksMQ | **Supported** | | +| Woodpecker MinIO | Woodpecker local | **Not supported** | Switching between Woodpecker storage modes requires additional metadata handling, which is not yet supported. May be supported in the future. | +| Woodpecker local | Woodpecker MinIO | **Not supported** | Same reason as above. | +| RocksMQ / Woodpecker (MinIO/local) | External Pulsar / Kafka | **Supported but not recommended** | Standalone instances should be kept as simple as possible for ease of operation and maintenance. | + +
+ +Avoid switching MQ types back and forth repeatedly. If you do need to switch, make sure to clean up the related data before each switch. Residual data may cause unexpected behavior. + +
diff --git a/site/en/menuStructure/en.json b/site/en/menuStructure/en.json index 6e918ad61..0510989f1 100644 --- a/site/en/menuStructure/en.json +++ b/site/en/menuStructure/en.json @@ -1807,13 +1807,26 @@ "children": [ { "label": "Milvus Cluster switch MQ Type", - "id": "switch_milvus_cluster_mq_type-operator.md", + "id": "switch_milvus_cluster_mq_type", "order": 0, - "children": [] + "children": [ + { + "label": "Helm Chart", + "id": "switch_milvus_cluster_mq_type-helm.md", + "order": 0, + "children": [] + }, + { + "label": "Milvus Operator", + "id": "switch_milvus_cluster_mq_type-operator.md", + "order": 1, + "children": [] + } + ] }, { "label": "Milvus Standalone switch MQ type", - "id": "switch_milvus_standalone_mq_type-operator.md", + "id": "switch_milvus_standalone_mq_type.md", "order": 1, "children": [] }