Deleting Broker Data Volumes
Delete broker data volumes to remove persistent MQTT data.
Deleting broker data volumes permanently removes all persistent MQTT data, including client sessions, retained messages, and subscriptions. This operation is typically performed when you need to completely reset the broker state or decommission a broker cluster.
This operation is destructive and cannot be undone. Ensure you have backups if you need to preserve any data.
Deleting Broker Data Volumes on Kubernetes
Prerequisites
kubectl access to the installation with the current context namespace set to the target namespace.
The broker cluster must be scaled down to zero replicas before deleting volumes.
Note the number of replicas that were running before scaling down, as you'll need this to scale back up.
Procedure
Identify all broker data volumes. The number of PersistentVolumeClaims (PVCs) depends on the number of broker replicas that were previously running.
To list all broker data and log volumes, run:
kubectl get pvc -lapp=broker -n ${NAMESPACE}Example output
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
brokerdata-broker-0 Bound pvc-3e4cbb94-0e59-4e93-b90b-3fa120ac4d23 1Gi RWO efs-sc <unset> 11m
brokerdata-broker-1 Bound pvc-1316bdc4-5e27-4319-8a15-69e6e8262e12 1Gi RWO efs-sc <unset> 8m32s
brokerdata-broker-2 Bound pvc-6cdbcb83-e7ad-4381-b3ad-bb31484ae7d0 1Gi RWO efs-sc <unset> 7m58s
brokerlog-broker-0 Bound pvc-5f7704ab-c64f-4f0c-b611-1d6ccf476ada 200Mi RWO efs-sc <unset> 11m
brokerlog-broker-1 Bound pvc-52a2c747-7c20-485b-86e9-60cad9e21a45 200Mi RWO efs-sc <unset> 8m32s
brokerlog-broker-2 Bound pvc-467f2e1f-9e64-4981-9c19-cee42b00dfb5 200Mi RWO efs-sc <unset> 7m58sNote down the number of replicas that were running before scaling down. In the example above, there are 3 replicas (
broker-0,broker-1,broker-2).Delete broker data volumes:
Example
For each PVC that starts with brokerdata, run:
Repeat this command for each brokerdata-* volume you identified in step 1.
Alternative: Automated deletion
To delete all broker data volumes at once, use the following command:
After deleting the data volumes, scale the StatefulSet back to the original number of replicas. Replace
${NUM_REPLICAS}with the number that you noted before scaling down:
The broker pods will restart with fresh, empty data volumes.
Deleting Broker Data Volumes on Docker Compose
The broker container must be stopped before deleting the volume. If the Connectware is running, go to the Connectware installation directory (default:
/opt/connectware) and run:
List all Docker volumes to identify the broker data volume:
Locate the broker data volume in the list. It typically has a name like
<connectware_installation>_brokerData.Delete the broker data volume:
Replace <connectware_brokerData> with the actual volume name from step 2.
Start Connectware again to recreate the broker data volume:
The broker will create a fresh, empty data volume when it restarts.
Last updated
Was this helpful?

