...
Code Block |
---|
$ kubectl exec -it kafka-v2-0 -- rm -rf /opt/kafka-data/logs/* -n kafka-cluster $ kubectl exec -it kafka-v2-1 -- rm -rf /opt/kafka-data/logs/* -n kafka-cluster $ kubectl exec -it kafka-v2-2 -- rm -rf /opt/kafka-data/logs/* -n kafka-cluster |
3. If the pod is in crashlookbackoff state, and the storage is full, use the following workaround:
...
Code Block |
---|
$ kubectl get statefulsets kafka-v2 -n kafka-cluster -oyaml > manifest.yaml |
Scale down the kafka statefulset replica count to zero
Code Block |
---|
$ kubectl scale statefulsets kafka-v2 -n kafka-cluster --replicas=0 |
Make following changes to the copy of the statefulsets manifest file
Modify command line from:
Code Block containers: - command: - sh - -exc - | export KAFKA_BROKER_ID=${HOSTNAME##*-} && \ export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${POD_NAME}.kafka-v2-headless.${POD_NAMESPACE}:9092,EXTERNAL://${HOST_IP}:$((31090 + ${KAFKA_BROKER_ID})) && \ exec /etc/confluent/docker/run
...
Code Block |
---|
$ kubectl scale statefulsets kafka-v2 --replicas=0 -n kafka-cluster |
Make following changes to the copy of the statefulsets manifest file
Modify command line from:
Code Block containers: - command: - sh - -exc - | tail -f /dev/null
...