segmentio / topicctl

Tool for declarative management of Kafka topics
MIT License
590 stars 55 forks source link

topicctl get action to fetch controllerid and clusterid #176

Closed ssingudasu closed 8 months ago

ssingudasu commented 8 months ago

Description

topicctl get action currently does not get the Kafka active controller broker id and cluster id

This PR is to implement actions topicctl get controllerid and topicctl get clusterid for the Kafka cluster

Usage

build topicctl

# cd /path/to/topicctl
# go build -o ./build/topicctl -a ./cmd/topicctl

topicctl get controllerid

# ./build/topicctl get controllerid --broker-addr {HOST}:{PORT}
# ./build/topicctl get controllerid --zk-addr {HOST}:{PORT}
# ./build/topicctl get controllerid --zk-addr {HOST}:{PORT} --zk-prefix {ZK_PREFIX}

topicctl get clusterid

# ./build/topicctl get clusterid --broker-addr {HOST}:{PORT}
# ./build/topicctl get clusterid --zk-addr {HOST}:{PORT}
# ./build/topicctl get clusterid --zk-addr {HOST}:{PORT} --zk-prefix {ZK_PREFIX}

local test

# cd /path/to/topicctl
# ./scripts/set_up_net_alias.sh
# docker-compose up -d
# KAFKA_TOPICS_TEST_BROKER_ADMIN=1 go test -count 1 -p 1 ./...

NOTE: