Kafka - Commandes et guide complet CLI pour streaming de données

🏷️ Lignes des commandes 📅 10/04/2026 22:00:00 👤 Mezgani said
Bd Kafka Kafkacli Kafkaconfig Kafkacluster Streaming Realtime Shell Admin Kafka Client Kafka

Maîtrisez Kafka pour le streaming de données en temps réel. Commandes CLI, configuration et gestion de clusters Kafka pour applications modernes.

Ligne de commande :
kafka-topics.sh
Description :

Gère les topics Kafka (création, liste, suppression, description)

Options :
  • --bootstrap-server
  • --command-config
  • --create
  • --delete
  • --list
  • --describe
  • --alter
  • --topic
  • --partitions
  • --replication-factor
  • --config
  • --if-not-exists
  • --if-exists
  • --under-replicated-partitions
  • --unavailable-partitions
  • --at-min-isr-partitions
  • --exclude-internal
  • --help

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --list
Description :

Liste tous les topics

Options :
  • --exclude-internal

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic mon-topic --partitions 3 --replication-factor 1
Description :

Crée un topic avec 3 partitions et réplication 1

Options :
  • --if-not-exists
  • --config

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic mon-topic --config retention.ms=86400000
Description :

Crée un topic avec rétention de 24h

Options :
  • --config

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic compact-topic --config cleanup.policy=compact
Description :

Crée un topic avec politique de compactage

Options :
  • --config

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic mon-topic
Description :

Décrit un topic (partitions, leaders, replicas)

Options :
  • --under-replicated-partitions
  • --unavailable-partitions
  • --at-min-isr-partitions

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --describe
Description :

Décrit tous les topics

Options :
  • --exclude-internal

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic mon-topic --partitions 6
Description :

Augmente le nombre de partitions (ne peut pas diminuer)

Options :
  • --partitions

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic mon-topic --config retention.ms=172800000
Description :

Modifie la configuration d'un topic

Options :
  • --config
  • --delete-config

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic mon-topic --delete-config retention.ms
Description :

Supprime une configuration de topic

Options :
  • --delete-config

Ligne de commande :
kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic mon-topic
Description :

Supprime un topic

Options :
  • --if-exists

Ligne de commande :
kafka-configs.sh
Description :

Gère les configurations des topics, brokers, clients

Options :
  • --bootstrap-server
  • --command-config
  • --entity-type
  • --entity-name
  • --describe
  • --alter
  • --add-config
  • --delete-config
  • --all
  • --help

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name mon-topic --describe
Description :

Affiche la configuration d'un topic

Options :
  • --all

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 1 --describe
Description :

Affiche la configuration d'un broker

Options :
  • --all

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name mon-topic --alter --add-config retention.ms=86400000
Description :

Ajoute/modifie une configuration de topic

Options :
  • --add-config

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name mon-topic --alter --delete-config retention.ms
Description :

Supprime une configuration de topic

Options :
  • --delete-config

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 1 --alter --add-config log.retention.ms=86400000
Description :

Modifie la configuration d'un broker

Options :
  • --add-config

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type users --entity-name alice --describe
Description :

Affiche les quotas d'un utilisateur

Options :
  • --all

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type users --entity-name alice --alter --add-config producer_byte_rate=1048576
Description :

Définit un quota de production (1 Mo/s)

Options :
  • --add-config

Ligne de commande :
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type clients --entity-name clientA --alter --add-config consumer_byte_rate=2097152
Description :

Définit un quota de consommation (2 Mo/s)

Options :
  • --add-config

Ligne de commande :
kafka-console-producer.sh
Description :

Producteur en ligne de commande

Options :
  • --bootstrap-server
  • --topic
  • --producer-property
  • --producer.config
  • --property
  • --sync
  • --compression-codec
  • --batch-size
  • --message-send-max-retries
  • --retry-backoff-ms
  • --request-required-acks
  • --request-timeout-ms
  • --max-block-ms
  • --max-memory-bytes
  • --max-partition-memory-bytes
  • --help

Ligne de commande :
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic mon-topic
Description :

Lance un producteur interactif

Options :
  • --producer-property

Ligne de commande :
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic mon-topic --producer-property acks=all
Description :

Producteur avec accusé de réception 'all'

Options :
  • --producer-property

Ligne de commande :
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic mon-topic --property parse.key=true --property key.separator=:
Description :

Producteur avec clé (format clé:valeur)

Options :
  • --property

Ligne de commande :
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic mon-topic < fichier.txt
Description :

Produit le contenu d'un fichier

Ligne de commande :
kafka-console-consumer.sh
Description :

Consommateur en ligne de commande

Options :
  • --bootstrap-server
  • --topic
  • --whitelist
  • --blacklist
  • --consumer-property
  • --consumer.config
  • --property
  • --partition
  • --offset
  • --group
  • --from-beginning
  • --max-messages
  • --skip-message-on-error
  • --isolation-level
  • --formatter
  • --timeout-ms
  • --enable-systest-events
  • --help

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mon-topic --from-beginning
Description :

Consomme tous les messages depuis le début

Options :
  • --max-messages
  • --timeout-ms

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mon-topic --group mon-groupe
Description :

Consomme avec un groupe de consommateurs

Options :
  • --from-beginning

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mon-topic --partition 0 --offset 10 --max-messages 5
Description :

Consomme depuis une partition et offset spécifiques

Options :
  • --partition
  • --offset
  • --max-messages

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --whitelist "topic-.*"
Description :

Consomme tous les topics correspondant au pattern

Options :
  • --whitelist
  • --blacklist

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mon-topic --property print.key=true --property key.separator=:
Description :

Affiche les clés des messages

Options :
  • --property

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mon-topic --property print.timestamp=true
Description :

Affiche les timestamps des messages

Options :
  • --property

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mon-topic --property print.partition=true
Description :

Affiche les partitions des messages

Options :
  • --property

Ligne de commande :
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mon-topic --property print.offset=true
Description :

Affiche les offsets des messages

Options :
  • --property

Ligne de commande :
kafka-consumer-groups.sh
Description :

Gère les groupes de consommateurs

Options :
  • --bootstrap-server
  • --command-config
  • --list
  • --describe
  • --delete
  • --delete-offsets
  • --reset-offsets
  • --group
  • --all-groups
  • --all-topics
  • --topic
  • --partition
  • --shift-by
  • --to-earliest
  • --to-latest
  • --to-current
  • --to-datetime
  • --to-offset
  • --by-duration
  • --dry-run
  • --execute
  • --export
  • --members
  • --members-verbose
  • --offsets
  • --state
  • --verbose
  • -v
  • --help

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
Description :

Liste tous les groupes de consommateurs

Options :
  • --state

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group mon-groupe
Description :

Décrit un groupe (lag, offset courant, etc.)

Options :
  • --members
  • --members-verbose
  • --offsets
  • --state

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --all-groups
Description :

Décrit tous les groupes

Options :
  • --verbose

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --delete --group mon-groupe
Description :

Supprime un groupe de consommateurs

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group mon-groupe --topic mon-topic --reset-offsets --to-earliest --execute
Description :

Réinitialise les offsets au début

Options :
  • --to-earliest
  • --to-latest
  • --to-datetime
  • --to-offset
  • --shift-by
  • --by-duration
  • --dry-run

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group mon-groupe --topic mon-topic --reset-offsets --to-latest --execute
Description :

Réinitialise les offsets à la fin

Options :
  • --to-latest
  • --dry-run

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group mon-groupe --topic mon-topic --reset-offsets --to-datetime 2024-01-01T00:00:00.000 --execute
Description :

Réinitialise les offsets à une date spécifique

Options :
  • --to-datetime
  • --dry-run

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group mon-groupe --topic mon-topic:0 --reset-offsets --to-offset 100 --execute
Description :

Réinitialise l'offset d'une partition spécifique

Options :
  • --to-offset
  • --dry-run

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group mon-groupe --topic mon-topic --reset-offsets --shift-by -10 --execute
Description :

Décale les offsets de -10

Options :
  • --shift-by
  • --dry-run

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group mon-groupe --topic mon-topic --reset-offsets --by-duration PT1H --execute
Description :

Réinitialise les offsets à il y a 1 heure

Options :
  • --by-duration
  • --dry-run

Ligne de commande :
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --delete-offsets --group mon-groupe --topic mon-topic
Description :

Supprime les offsets d'un groupe pour un topic

Ligne de commande :
kafka-producer-perf-test.sh
Description :

Test de performance du producteur

Options :
  • --topic
  • --num-records
  • --record-size
  • --throughput
  • --producer-props
  • --producer.config
  • --print-metrics
  • --payload-file
  • --transactional-id
  • --transaction-duration-ms
  • --help

Ligne de commande :
kafka-producer-perf-test.sh --topic mon-topic --num-records 100000 --record-size 1024 --throughput -1 --producer-props bootstrap.servers=localhost:9092
Description :

Test de performance (100k messages de 1KB)

Options :
  • --throughput

Ligne de commande :
kafka-producer-perf-test.sh --topic mon-topic --num-records 50000 --record-size 100 --throughput 1000 --producer-props bootstrap.servers=localhost:9092 acks=all
Description :

Test avec débit limité à 1000 msg/s

Options :
  • --throughput
  • --producer-props

Ligne de commande :
kafka-consumer-perf-test.sh
Description :

Test de performance du consommateur

Options :
  • --bootstrap-server
  • --topic
  • --messages
  • --threads
  • --group
  • --fetch-size
  • --socket-buffer-size
  • --show-detailed-stats
  • --reporting-interval
  • --date-format
  • --print-metrics
  • --help

Ligne de commande :
kafka-consumer-perf-test.sh --bootstrap-server localhost:9092 --topic mon-topic --messages 100000 --threads 1
Description :

Test de consommation (100k messages)

Options :
  • --group
  • --fetch-size
  • --show-detailed-stats

Ligne de commande :
kafka-reassign-partitions.sh
Description :

Réassigne les partitions entre brokers

Options :
  • --bootstrap-server
  • --command-config
  • --zookeeper
  • --reassignment-json-file
  • --topics-to-move-json-file
  • --broker-list
  • --generate
  • --execute
  • --verify
  • --cancel
  • --throttle
  • --replica-alter-log-dirs-throttle
  • --timeout
  • --preserve-throttles
  • --help

Ligne de commande :
kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --topics-to-move-json-file topics.json --broker-list "0,1,2" --generate
Description :

Génère un plan de réassignation

Options :
  • --generate

Ligne de commande :
kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file plan.json --execute
Description :

Exécute un plan de réassignation

Options :
  • --execute
  • --throttle

Ligne de commande :
kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file plan.json --verify
Description :

Vérifie l'état de la réassignation

Options :
  • --verify
  • --preserve-throttles

Ligne de commande :
kafka-preferred-replica-election.sh
Description :

Déclenche l'élection du replica préféré

Options :
  • --bootstrap-server
  • --command-config
  • --zookeeper
  • --path-to-json-file
  • --help

Ligne de commande :
kafka-preferred-replica-election.sh --bootstrap-server localhost:9092
Description :

Lance l'élection pour toutes les partitions

Options :
  • --path-to-json-file

Ligne de commande :
kafka-leader-election.sh
Description :

Déclenche l'élection de leader

Options :
  • --bootstrap-server
  • --command-config
  • --election-type
  • --topic
  • --partition
  • --path-to-json-file
  • --all-topic-partitions
  • --help

Ligne de commande :
kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type preferred --all-topic-partitions
Description :

Élection preferred pour toutes les partitions

Options :
  • --election-type
  • --all-topic-partitions

Ligne de commande :
kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type unclean --topic mon-topic --partition 0
Description :

Élection unclean pour une partition

Options :
  • --election-type
  • --topic
  • --partition

Ligne de commande :
kafka-log-dirs.sh
Description :

Affiche les informations des répertoires de logs

Options :
  • --bootstrap-server
  • --command-config
  • --describe
  • --broker-list
  • --topic-list
  • --help

Ligne de commande :
kafka-log-dirs.sh --bootstrap-server localhost:9092 --describe --broker-list 0,1,2
Description :

Décrit les répertoires de logs des brokers

Options :
  • --describe
  • --broker-list
  • --topic-list

Ligne de commande :
kafka-dump-log.sh
Description :

Affiche le contenu des fichiers de log

Options :
  • --files
  • --max-message-size
  • --print-data-log
  • --print-offset-commit
  • --print-txn-log
  • --deep-iteration
  • --value-deserializer
  • --key-deserializer
  • --offsets-decoder
  • --transaction-log-decoder
  • --help

Ligne de commande :
kafka-dump-log.sh --files /var/lib/kafka/data/mon-topic-0/00000000000000000000.log --print-data-log
Description :

Affiche les messages d'un fichier de log

Options :
  • --print-data-log
  • --deep-iteration

Ligne de commande :
kafka-dump-log.sh --files /var/lib/kafka/data/__consumer_offsets-0/00000000000000000000.log --print-offset-commit
Description :

Affiche les offsets des consommateurs

Options :
  • --print-offset-commit

Ligne de commande :
kafka-delete-records.sh
Description :

Supprime des enregistrements avant un offset

Options :
  • --bootstrap-server
  • --command-config
  • --offset-json-file
  • --help

Ligne de commande :
kafka-delete-records.sh --bootstrap-server localhost:9092 --offset-json-file delete.json
Description :

Supprime les enregistrements selon le fichier JSON

Ligne de commande :
kafka-broker-api-versions.sh
Description :

Affiche les versions d'API supportées par les brokers

Options :
  • --bootstrap-server
  • --command-config
  • --help

Ligne de commande :
kafka-broker-api-versions.sh --bootstrap-server localhost:9092
Description :

Liste les versions d'API des brokers

Ligne de commande :
kafka-metadata-quorum.sh
Description :

Gère le quorum de métadonnées (KRaft)

Options :
  • --bootstrap-server
  • --command-config
  • --status
  • --replicas
  • --describe
  • --snapshot
  • --human-readable
  • --help

Ligne de commande :
kafka-metadata-quorum.sh --bootstrap-server localhost:9092 --status
Description :

Affiche le statut du quorum KRaft

Options :
  • --human-readable

Ligne de commande :
kafka-metadata-quorum.sh --bootstrap-server localhost:9092 --describe --replicas
Description :

Décrit les replicas du quorum

Options :
  • --describe
  • --replicas
  • --human-readable

Ligne de commande :
kafka-storage.sh
Description :

Gère le stockage pour KRaft

Options :
  • random-uuid
  • info
  • format
  • --config
  • --cluster-id
  • --ignore-formatted
  • --help

Ligne de commande :
kafka-storage.sh random-uuid
Description :

Génère un UUID aléatoire pour le cluster

Ligne de commande :
kafka-storage.sh format --config server.properties --cluster-id $(kafka-storage.sh random-uuid)
Description :

Formate le stockage pour KRaft

Options :
  • --config
  • --cluster-id
  • --ignore-formatted

Ligne de commande :
kafka-storage.sh info --config server.properties
Description :

Affiche les informations du stockage

Options :
  • --config

Ligne de commande :
kafka-acls.sh
Description :

Gère les ACLs (Access Control Lists)

Options :
  • --bootstrap-server
  • --command-config
  • --add
  • --remove
  • --list
  • --authorizer-properties
  • --authorizer
  • --principal
  • --allow-principal
  • --deny-principal
  • --operation
  • --topic
  • --group
  • --cluster
  • --transactional-id
  • --delegation-token
  • --resource-pattern-type
  • --host
  • --force
  • --help

Ligne de commande :
kafka-acls.sh --bootstrap-server localhost:9092 --list
Description :

Liste toutes les ACLs

Options :
  • --topic
  • --group
  • --cluster
  • --principal

Ligne de commande :
kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:alice --operation Read --topic mon-topic
Description :

Ajoute une ACL en lecture pour Alice

Options :
  • --add
  • --allow-principal
  • --deny-principal
  • --operation
  • --topic
  • --group
  • --cluster
  • --host

Ligne de commande :
kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:alice --operation Write --topic mon-topic
Description :

Ajoute une ACL en écriture

Options :
  • --add
  • --operation

Ligne de commande :
kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:alice --operation All --topic mon-topic
Description :

Ajoute tous les droits sur un topic

Options :
  • --add
  • --operation

Ligne de commande :
kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:bob --operation Read --group mon-groupe
Description :

Ajoute une ACL sur un groupe

Options :
  • --add
  • --group

Ligne de commande :
kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:admin --operation Create --cluster
Description :

Ajoute une ACL sur le cluster

Options :
  • --add
  • --cluster

Ligne de commande :
kafka-acls.sh --bootstrap-server localhost:9092 --remove --allow-principal User:alice --operation Read --topic mon-topic
Description :

Supprime une ACL

Options :
  • --remove
  • --force

Ligne de commande :
kafka-delegation-tokens.sh
Description :

Gère les tokens de délégation

Options :
  • --bootstrap-server
  • --command-config
  • --create
  • --renew
  • --expire
  • --describe
  • --owner-principal
  • --renewer-principal
  • --max-life-time-period
  • --help

Ligne de commande :
kafka-delegation-tokens.sh --bootstrap-server localhost:9092 --create --owner-principal User:alice --renewer-principal User:admin
Description :

Crée un token de délégation

Options :
  • --create
  • --owner-principal
  • --renewer-principal
  • --max-life-time-period

Ligne de commande :
kafka-delegation-tokens.sh --bootstrap-server localhost:9092 --describe
Description :

Liste les tokens de délégation

Options :
  • --describe
  • --owner-principal

Ligne de commande :
kafka-delegation-tokens.sh --bootstrap-server localhost:9092 --renew --hmac <token>
Description :

Renouvelle un token

Options :
  • --renew
  • --renew-time-period

Ligne de commande :
kafka-delegation-tokens.sh --bootstrap-server localhost:9092 --expire --hmac <token>
Description :

Expire un token

Options :
  • --expire
  • --expiry-time-period

Ligne de commande :
kafka-server-start.sh
Description :

Démarre un broker Kafka

Options :
  • -daemon
  • --override

Ligne de commande :
kafka-server-start.sh config/server.properties
Description :

Démarre un broker avec configuration

Options :
  • -daemon

Ligne de commande :
kafka-server-start.sh -daemon config/server.properties
Description :

Démarre un broker en arrière-plan

Options :
  • -daemon

Ligne de commande :
kafka-server-stop.sh
Description :

Arrête un broker Kafka

Ligne de commande :
zookeeper-server-start.sh
Description :

Démarre ZooKeeper

Options :
  • -daemon

Ligne de commande :
zookeeper-server-start.sh config/zookeeper.properties
Description :

Démarre ZooKeeper avec configuration

Options :
  • -daemon

Ligne de commande :
zookeeper-server-stop.sh
Description :

Arrête ZooKeeper

Ligne de commande :
zookeeper-shell.sh
Description :

Shell interactif ZooKeeper

Options :
  • localhost:2181

Ligne de commande :
zookeeper-shell.sh localhost:2181 ls /brokers/ids
Description :

Liste les brokers enregistrés dans ZooKeeper

Ligne de commande :
zookeeper-shell.sh localhost:2181 get /brokers/ids/0
Description :

Affiche les informations d'un broker

Ligne de commande :
kafka-verifiable-producer.sh
Description :

Producteur vérifiable (pour tests)

Options :
  • --bootstrap-server
  • --topic
  • --max-messages
  • --throughput
  • --producer.config
  • --value-prefix
  • --acks
  • --message-create-time
  • --help

Ligne de commande :
kafka-verifiable-consumer.sh
Description :

Consommateur vérifiable (pour tests)

Options :
  • --bootstrap-server
  • --topic
  • --group-id
  • --max-messages
  • --session-timeout
  • --enable-autocommit
  • --reset-policy
  • --assignment-strategy
  • --consumer.config
  • --verbose
  • --help

Ligne de commande :
kafka-mirror-maker.sh
Description :

Réplication entre clusters Kafka (déprécié, utiliser MirrorMaker 2)

Options :
  • --consumer.config
  • --producer.config
  • --num.streams
  • --whitelist
  • --blacklist
  • --help

Ligne de commande :
connect-standalone.sh
Description :

Lance Kafka Connect en mode standalone

Options :
  • config/connect-standalone.properties
  • config/connect-file-source.properties
  • config/connect-file-sink.properties

Ligne de commande :
connect-distributed.sh
Description :

Lance Kafka Connect en mode distribué

Options :
  • config/connect-distributed.properties

Ligne de commande :
kafka-run-class.sh
Description :

Exécute une classe Java Kafka

Options :
  • <class_name>
  • --help

Ligne de commande :
kafka-run-class.sh kafka.tools.GetOffsetShell
Description :

Outil pour obtenir les offsets

Options :
  • --bootstrap-server
  • --topic
  • --partitions
  • --time
  • --help

Ligne de commande :
kafka-run-class.sh kafka.tools.GetOffsetShell --bootstrap-server localhost:9092 --topic mon-topic --time -1
Description :

Obtient les derniers offsets (-1 = latest, -2 = earliest)

Options :
  • --time
  • --partitions

Ligne de commande :
kafka-run-class.sh kafka.tools.JmxTool
Description :

Collecte les métriques JMX

Options :
  • --object-name
  • --attributes
  • --help

Ligne de commande :
kafka-streams-application-reset.sh
Description :

Réinitialise une application Kafka Streams

Options :
  • --bootstrap-server
  • --application-id
  • --input-topics
  • --intermediate-topics
  • --force
  • --dry-run
  • --help

Ligne de commande :
kafka-streams-application-reset.sh --bootstrap-server localhost:9092 --application-id mon-app --input-topics mon-topic
Description :

Réinitialise une application Streams

Options :
  • --input-topics
  • --intermediate-topics
  • --force
  • --dry-run

Ligne de commande :
kafka-transactions.sh
Description :

Gère les transactions

Options :
  • --bootstrap-server
  • --command-config
  • --list
  • --describe
  • --describe-producers
  • --describe-transactions
  • --describe-consumers
  • --topic
  • --help

Ligne de commande :
kafka-transactions.sh --bootstrap-server localhost:9092 --list
Description :

Liste les transactions actives

Ligne de commande :
kafka-transactions.sh --bootstrap-server localhost:9092 --describe-producers
Description :

Décrit les producteurs transactionnels

Options :
  • --topic

Ligne de commande :
kafka-transactions.sh --bootstrap-server localhost:9092 --describe-transactions --transactional-id <id>
Description :

Décrit une transaction spécifique

Options :
  • --describe-transactions

Ligne de commande :
kafka-features.sh
Description :

Gère les features du cluster

Options :
  • --bootstrap-server
  • --command-config
  • --describe
  • --upgrade
  • --downgrade
  • --feature
  • --help

Ligne de commande :
kafka-features.sh --bootstrap-server localhost:9092 --describe
Description :

Affiche les features supportées

Ligne de commande :
kafka-features.sh --bootstrap-server localhost:9092 --upgrade --feature metadata.version=3.6
Description :

Met à niveau une feature

Options :
  • --upgrade
  • --feature

Ligne de commande :
kafka-client-metrics.sh
Description :

Gère les métriques client

Options :
  • --bootstrap-server
  • --command-config
  • --alter
  • --describe
  • --delete
  • --list
  • --subscription
  • --entity-type
  • --entity-name
  • --help

Ligne de commande :
kafka-cluster.sh
Description :

Gère le cluster Kafka

Options :
  • cluster-id
  • unregister
  • --bootstrap-server
  • --command-config
  • --help

Ligne de commande :
kafka-cluster.sh cluster-id --bootstrap-server localhost:9092
Description :

Affiche l'ID du cluster

Ligne de commande :
kafka-get-offsets.sh
Description :

Obtient les offsets pour un groupe/topic

Options :
  • --bootstrap-server
  • --command-config
  • --topic
  • --group
  • --help

Ligne de commande :
kafka-get-offsets.sh --bootstrap-server localhost:9092 --topic mon-topic --group mon-groupe
Description :

Affiche les offsets d'un groupe