无法连接gke群集中的Zookeeper

2w2cym1i  于 2022-12-09  发布在  Apache
关注(0)|答案(1)|浏览(144)

I am getting the below error while deploying the Apache Zookeeper bitnami charts Unable to connect Zookeeper

To connect to your ZooKeeper server run the following commands:

export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=zookeeper,app.kubernetes.io/instance=zookeeper,app.kubernetes.io/component=zookeeper" -o jsonpath="{.items[0].metadata.name}")
kubectl exec -it $POD_NAME -- zkCli.sh

error:

error: error executing jsonpath "{.items[0].metadata.name}": Error executing template: array index out of bounds: index 0, length 0. Printing more information for debugging the template:
        template was:
                {.items[0].metadata.name}
        object given to jsonpath engine was:
                map[string]interface {}{"apiVersion":"v1", "items":[]interface {}{}, "kind":"List", "metadata":map[string]interface {}{"resourceVersion":"", "selfLink":""}}

error: pod, type/name or --filename must be specified

mw3dktmi

mw3dktmi1#

尝试运行此命令,您将进入POD,并进一步能够运行zkCli.sh文件

kubectl exec -it zookeeper-0 -- /bin/bash

kubectl exec -it zookeeper-0 -- /bin/sh

或者你也可以试一次

kubectl exec -it zookeeper-0 -- zkCli.sh

相关问题