Coder Social home page Coder Social logo

kat's Introduction

KAT

Kafka Admin Tool provides an easy interface to perform admin operations on kafka.

Admin operations available

  • List topics
  • Describe topics
  • Increase replication factor of existing topics
  • Show Config for topics
  • Alter Config for topics
  • Mirror topic configurations from source to destination cluster

Installation

  1. go get -u github.com/gojekfarm/kat
  2. Build the project -- make
  3. Multiple kafka cluster can be created in local environment using docker-compose docker-compose up -d

Using Homebrew

brew tap gojek/stable
brew install kat

Usage

List all topics in a kafka cluster

./kat topic list --broker-list "broker1,broker2"

List all topics with a particular replication factor

./kat topic list --broker-list "broker1,broker2" --replication-factor <r>

Describe topics

./kat topic describe --broker-list "broker1,broker2" --topics "topic1,topic2"

Increase replication factor for topics

./kat topic increase-replication-factor --broker-list "broker1,broker2" --zookeeper "zookeeper1,zookeeper2" --topics "topic1,topic2" --replication-factor <r> --num-of-brokers <n> --kafka-path </path/to/kafka/binary>

Show Config for topics

./kat topic config show --topics "topic1,topic2" --broker-list "broker1,broker2"

Alter Config for topics

./kat topic config alter --topics "topic1,topic2" --broker-list "broker1,broker2" --config "retention.ms=500000000"

Mirror topic configs from source to destination cluster

  • Specify topics to mirror.

./kat mirror --source-broker-ips broker1,broker2 --destination-broker-ips broker1,broker2 --topics topic1,topic2

  • Specify topics to mirror and create the topics if not present on destination cluster. --create-topics true flag is set.

./kat mirror --source-broker-ips broker1,broker2 --destination-broker-ips broker1,broker2 --topics topic1,topic2 --create-topics

  • Mirror all topics and create the topics if not present

./kat mirror --source-broker-ips broker1,broker2 --destination-broker-ips broker1,broker2 --create-topics

-To increase the partition count

./kat mirror --source-broker-ips broker1,broker2 --destination-broker-ips broker1,broker2 --increase-partitions

-To dry run and see the changes before applying the mirror command,

./kat mirror --source-broker-ips broker1,broker2 --destination-broker-ips broker1,broker2 --increase-partitions --dry-run

-To exclude mirroring certain configs,

Help

./kat --help

Future Scope

  • Add support for more admin operations

TODO

Refactoring

  • move sarama deps, and building command/running to a baseCmd and compose it in all cmds
  • get rid of topicutil, move functions to topics struct (group behaviour: list, delete, create, update)
  • mirror, all commands should use same flags (can use config file for default value so we can pass less flags while running)
  • inject custom interface with only required functionality instead of saramaCli ()
  • add golangci lint
  • add make file (vet,lint,goimports,test with race)
  • introduce logrus with log levels
  • helper for executing shell commands
  • beautify the UI for show config command

License

Copyright 2019, GO-JEK Tech (http://gojek.tech)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
  • update the latest release version to https://github.com/gojek/homebrew-tap

kat's People

Contributors

anbarasantr avatar goyalbhumika avatar roobalimsab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.