我有一個帶有 kafka zookeeper statefulset 的 kubernetes 集群,可以在一個 pod 上正常作業。但是,出于性能原因,我嘗試使用以下命令將 statefulset 擴展到三個 pod:
kubectl scale statefulset <my_zookeper_statefulset> --replicas=3
兩個新的 pod 進入一個錯誤,然后是一個 CrashLoopBackOff,其中包含以下日志:
Detected Zookeeper ID 3
Preparing truststore
Adding /opt/kafka/cluster-ca-certs/ca.crt to truststore /tmp/zookeeper/cluster.truststore.p12 with alias ca
Certificate was added to keystore
Preparing truststore is complete
Looking for the right CA
No CA found. Thus exiting.
有問題的證書存在并且被現有的 pod 使用沒有問題。當我嘗試擴展我的 kafka 代理時,也會發生同樣的錯誤。
Tl; dr:我如何在沒有錯誤的情況下擴展 kafka?
uj5u.com熱心網友回復:
你什么時候用Kafka你不能走這條路。為此,您需要在檔案中配置副本引數。spec資源的屬性示例Kafka:
apiVersion: YourVersion
kind: Kafka
metadata:
name: my-cluster
spec:
kafka:
replicas: 3
其次,您還可以創建ReplicationController 服務以舒適地使用副本。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/445047.html
標籤:Kubernetes 阿帕奇卡夫卡 阿帕奇动物园管理员
