Flushing Kafka topics
You must have kafka to avoid issues related to restore the specified flushed out topic.
Procedure
-
Run the following command to get Kafka
topics.
Example output:oc get kafkatopic |grep file-scan-topic
File-scan-topic isd 10 1 True
- Run the following command to back up Kafka
topic.
Example output:oc get kafkatopic file-scan-topic -o yaml
apiVersion: kafka.strimzi.io/v1beta2 kind: KafkaTopic metadata: resourceVersion: '15457887' name: file-scan-topic namespace: ibm-data-cataloging ownerReferences: - apiVersion: spectrum-discover.ibm.com/v1alpha1 kind: SpectrumDiscover name: discover-instance uid: 52fd9b6c-0823-4f88-b43d-525dd6992b1b labels: strimzi.io/cluster: isd-ssl spec: partitions: 10 replicas: 1
- Run the following command to delete the Kafka topic to flush the data.
oc delete kafkatopic file-scan-topic
- Run the following command to apply the backed-up YAML file on the cluster to recreate the
topic until it deletes the Kafka
topic.
Example output:oc apply -f <topic.yaml>
apiVersion: kafka.strimzi.io/v1beta2 kind: KafkaTopic metadata: resourceVersion: '15457887' name: file-scan-topic namespace: ibm-data-cataloging ownerReferences: - apiVersion: spectrum-discover.ibm.com/v1alpha1 kind: SpectrumDiscover name: discover-instance uid: 52fd9b6c-0823-4f88-b43d-525dd6992b1b labels: strimzi.io/cluster: isd-ssl spec: partitions: 10 replicas: 1