[英]Unable to fetch broker ID using kubectl command
我想使用kubectl exec命令獲取集群中的代理ID列表。
我可以從Pod內運行命令並獲取代理ID列表,但是我無需進入就可以找到列表。
我正在使用來自孵化器和Kubernetes發行版的kafka 掌舵圖,以及Mac的docker附帶的。
kubectl exec hissing-warthog-kafka-1 -- /usr/bin/zookeeper-shell hissing-warthog-zookeeper:2181 <<< "ls /brokers/ids"
預期結果:歡迎來到ZooKeeper! 啟用JLine支持
WATCHER ::
WatchedEvent狀態:SyncConnected類型:無路徑:空[zk:hissing-warthog-zookeeper:2181(CONNECTED)0] ls / brokers / ids [0,1,2]
實際結果:連接到hissing-warthog-zookeeper:2181歡迎使用ZooKeeper! 啟用JLine支持
WATCHER ::
WatchedEvent狀態:SyncConnected類型:無路徑:空[zk:hissing-warthog-zookeeper:2181(CONNECTED)0]
它應該以以下方式工作:
kubectl exec hissing-warthog-kafka-1 -- /usr/bin/zookeeper-shell hissing-warthog-zookeeper:2181 -c ls /brokers/ids
希望這可以幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.