Internal Cloudserver Is Not Properly Scaled¶
Problem Description¶
The following issues are noticed:
Important lag on the
{ZENKO_ID}.backbeat-lifecycle-bucket-taskstopic.ListObject
ECONNRESETerrors in the bucket processor logs.MongoNetworkErrorerrors in the internal Cloudserver.
Problem Resolution¶
Increase the Internal Cloudserver Number of Replicas¶
Edit the Zenko CR.
[artesca-os@bootstrap ~]$sudo kubectl --kubeconfig /etc/kubernetes/admin.conf edit zenko artesca-data -n zenko
In the
Specsection, search forinternalCloudserver:and edit the number of replicas depending on the platform and the size of the buckets.In the following example, there are
12replicas.Spec: internalCloudserver: replicas: 12
Reset the Bucket Processor Kafka Offsets¶
This manual procedure enables to return to a stable state and to decrease
the lag on the {ZENKO_ID}.backbeat-lifecycle-bucket-tasks topic.
Get the current number of replicas and save that number for later.
[artesca-os@bootstrap ~]$sudo kubectl --kubeconfig /etc/kubernetes/admin.conf -n zenko \ get deploy artesca-data-backbeat-lifecycle-bucket-processor \ -o=jsonpath='{.status.replicas}'
Scale down the number of replicas to
0.[artesca-os@bootstrap ~]$sudo kubectl --kubeconfig /etc/kubernetes/admin.conf -n \ zenko scale deploy artesca-data-backbeat-lifecycle-bucket-processor --replicas=0
Get the Kafka image inside the cluster.
[artesca-os@bootstrap ~]$sudo kubectl --kubeconfig /etc/kubernetes/admin.conf -n zenko \ get kafkacluster -o jsonpath="{...image}" | grep -E -o "[^ ]*kafka:.*"
Spin a debug pod containing all Kafka scripts. Replace the
<KAFKA_IMAGE>variable with the Kafka image from the previous step.[artesca-os@bootstrap ~]$sudo kubectl --kubeconfig /etc/kubernetes/admin.conf run -i --tty \ --rm debug-kafka --image=<KAFKA_IMAGE> --restart=Never -n zenko -- bash
In the debug pod, get the name of the topic.
kafka-topics.sh --bootstrap-server artesca-data-base-queue-0:9092 --list | grep backbeat-lifecycle-bucket-tasks
Example output
c19d1d32-7c40-44c8-8fdd-babd5ab960ad.backbeat-lifecycle-bucket-tasks
Note
If you have multiple Kafka brokers, and not all of them are accessible, you can regroup all brokers using the following command:
[artesca-os@bootstrap ~]$--bootstrap-server artesca-data-base-queue-0:9092,artesca-data-base-queue-1:9092,artesca-data-base-queue-2:9092In the debug pod, get the name of the consumer group.
kafka-consumer-groups.sh --bootstrap-server artesca-data-base-queue-0:9092 --list | grep backbeat-lifecycle-bucket-processor-group
Example output
c19d1d32-7c40-44c8-8fdd-babd5ab960ad.backbeat-lifecycle-bucket-processor-group
Reset the offsets. Replace the
<GROUP>and<TOPIC>variables with the consumer group and topic names from the previous steps.kafka-consumer-groups.sh --bootstrap-server artesca-data-base-queue-0:9092 \ --reset-offsets --to-latest --group <GROUP> --topic <TOPIC> --execute
Exit the debug pod.
Restart the bucket processor. Replace the
<ORIGINAL_REPLICAS>variable with the number of replicas from step 1.[artesca-os@bootstrap ~]$sudo kubectl --kubeconfig /etc/kubernetes/admin.conf -n zenko \ scale deploy artesca-data-backbeat-lifecycle-bucket-processor --replicas=<ORIGINAL_REPLICAS>
Check in the Kafka dashboard that the lag on the
{ZENKO_ID}.backbeat-lifecycle-bucket-taskstopic is now0.
Note
Because Lifecycle Transition also uses the bucket processor, it can face the same issue.

