CLI Flashcards

(46 cards)

1
Q

Where are Kafka CLI tools typically found, and how do you get help for a tool?

A

Kafka CLI tools are typically provided in the Kafka bin directory. You can view usage by running the tool with no arguments or with –help.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the main connection option modern Kafka CLI commands use?

A

Modern Kafka CLI tools typically connect with –bootstrap-server, which points to one or more brokers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What important CLI migration point should you remember about ZooKeeper?

A

The –zookeeper option was removed from kafka-topics and kafka-reassign-partitions. Use –bootstrap-server instead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What naming difference exists between Apache Kafka scripts and Confluent Platform tools?

A

Apache Kafka docs often show script names like kafka-topics.sh, while Confluent Platform often drops the .sh extension for bundled versions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which CLI tool starts a Kafka server?

A

kafka-server-start starts a Kafka server, usually by passing a server properties file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which CLI tool stops a Kafka server?

A

kafka-server-stop stops a running Kafka server. In newer Kafka versions it can optionally target a broker/controller role or a node ID.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which CLI tool is used to generate a cluster UUID and format storage in KRaft mode?

A

kafka-storage is used to generate a cluster ID and format the log directories for a KRaft cluster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which CLI tool helps inspect metadata quorum status in KRaft?

A

kafka-metadata-quorum describes the metadata quorum status and is useful for debugging KRaft clusters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which CLI tool is used to create, delete, describe, or alter a topic?

A

kafka-topics is the main CLI tool for creating, deleting, describing, and changing topics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the simplest command pattern to create a topic?

A

Use: kafka-topics –create –topic <name> --bootstrap-server <host:port></host:port></name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does kafka-topics –describe show?

A

It shows topic metadata such as partition count, replication factor, leader, replicas, ISR, and configs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which tool should you use to modify topic configuration values on an existing topic?

A

Use kafka-configs for topic configuration changes on existing topics rather than relying on kafka-topics alone.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which CLI tool updates broker and topic configs?

A

kafka-configs updates broker configs and topic configs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can some Kafka broker or topic configs be changed without restarting brokers?

A

Yes. Some broker and topic configs are dynamic and can be changed without restarting, depending on their update mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which CLI tool sends plain records to a Kafka topic from the terminal?

A

kafka-console-producer sends data to Kafka topics from standard input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does kafka-console-producer treat terminal input by default?

A

By default, each line entered in the console producer becomes a separate Kafka record.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which CLI tool reads records from a topic and prints them to standard output?

A

kafka-console-consumer reads data from Kafka topics and writes it to STDOUT.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does –from-beginning do in kafka-console-consumer?

A

It makes the console consumer read available records from the beginning of the topic instead of only new incoming records.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which option is used to pass client properties to a console producer, and which one for a console consumer?

A

Use –producer.config with kafka-console-producer and –consumer.config with kafka-console-consumer.

20
Q

How do you connect console producer/consumer to an SSL-secured cluster?

A

Put SSL properties in a client properties file and pass that file with –producer.config or –consumer.config.

21
Q

What extra pattern is commonly needed when using Kafka CLI tools with Confluent Cloud?

A

You typically provide both –bootstrap-server and a config file containing the required client authentication settings.

22
Q

Which CLI tool is used to inspect consumer groups and lag?

A

kafka-consumer-groups lists, describes, and can delete consumer groups, and it shows current offsets and lag.

23
Q

What does kafka-consumer-groups –describe –group <group> show?</group>

A

It shows per-partition details such as current offset, log-end offset, lag, consumer ID, host, and client ID.

24
Q

What does kafka-consumer-groups –list do?

A

It lists consumer groups in the cluster.

25
When can a consumer group be deleted manually?
Manual deletion succeeds only if the group has no active members.
26
Which CLI tool can reset consumer group offsets?
kafka-consumer-groups can reset offsets using --reset-offsets.
27
What is a key safety rule before resetting offsets?
Consumer instances for that group should be inactive before you run --reset-offsets.
28
What are the execution modes for --reset-offsets?
It can display the planned reset by default, execute it with --execute, or export the result with --export.
29
What are common offset reset targets supported by kafka-consumer-groups?
Common targets include --to-earliest, --to-latest, --to-offset, --to-datetime, --shift-by, --to-current, --by-duration, and --from-file.
30
Which CLI tool provides an interactive way to get topic-partition offsets?
kafka-get-offsets provides a way to get topic-partition offsets.
31
Which CLI tool deletes partition records up to specified offsets?
kafka-delete-records deletes partition records.
32
Which CLI tool initiates leader election for topic partitions?
kafka-leader-election initiates leader election for partitions.
33
Which CLI tool moves topic partitions between replicas?
kafka-reassign-partitions is used to move topic partitions among replicas.
34
Which CLI tool is useful for debugging Kafka log segments directly?
kafka-dump-log parses a log file and dumps its contents to the console.
35
Which CLI tool shows replicas per log directory on a broker?
kafka-log-dirs lists replicas per log directory on a broker.
36
Which CLI tool displays the API versions supported by cluster nodes?
kafka-broker-api-versions displays the API versions of all nodes in the cluster.
37
Which CLI tools are commonly used for throughput/performance testing?
kafka-producer-perf-test tests producer performance, and kafka-consumer-perf-test tests consumer performance.
38
What is kafka-verifiable-producer useful for?
It produces increasing integers and prints JSON send metadata so you can see externally which messages were acknowledged.
39
Which CLI tools are used when you want Avro data with Schema Registry?
Use kafka-avro-console-producer and kafka-avro-console-consumer.
40
Which CLI tools are used for Protobuf data with Schema Registry?
Use kafka-protobuf-console-producer and kafka-protobuf-console-consumer.
41
Which CLI tools are used for JSON Schema data with Schema Registry?
Use kafka-json-schema-console-producer and kafka-json-schema-console-consumer.
42
How are messages entered into the schema-aware console producer tools?
These tools use human-readable JSON encodings for Avro, Protobuf, and JSON Schema messages at the command line.
43
How do you provide a schema inline to a schema-aware console producer?
You pass it with a property such as --property value.schema=''.
44
How can a schema-aware console consumer print schema IDs?
Run the consumer with --property print.schema.ids=true. Examples also often use --property print.key=true.
45
Which CLI tool resets a Kafka Streams application so it can reprocess data?
kafka-streams-application-reset resets a Kafka Streams application and forces reprocessing from the beginning.
46
Which CLI tools are most important to know cold for CCDAK-style practical questions?
kafka-topics, kafka-console-producer, kafka-console-consumer, kafka-consumer-groups, kafka-configs, plus awareness of kafka-reassign-partitions, kafka-delete-records