Skip to content

Commit

Permalink
Replace kafka-topics --zookeeper flags with --bootstrap-server flags …
Browse files Browse the repository at this point in the history
…due to Kafka 3.0.0 deprecation (#110)

* fix(test,bench): replaced zk flag w/ bootstrap-srv

From
https://kafka.apache.org/documentation/#upgrade_300_notable
> The --zookeeper option was removed from the
> kafka-topics and kafka-reassign-partitions
> command line tools. Please use
> --bootstrap-server instead.

So all in our docs regarding kafka-topics commands
we need to replace
`--zookeeper zookeeper-client.zookeeper:2181`
with
`--bootstrap-server kafka-all-broker.kafka:29092`

* Update docs/benchmarks/_index.md

Co-authored-by: Robert Fekete <[email protected]>

---------

Co-authored-by: Darren Lau <[email protected]>
Co-authored-by: Robert Fekete <[email protected]>
  • Loading branch information
3 people committed May 13, 2023
1 parent 75b14e6 commit 0104434
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
18 changes: 15 additions & 3 deletions docs/benchmarks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,23 @@ How to setup the environment for the Kafka Performance Test.
1. Exec into this client and create the `perftest, perftest2, perftes3` topics.
For internal listeners exposed by a headless service (`KafkaCluster.spec.headlessServiceEnabled` is set to `true`):
```bash
kubectl exec -it kafka-test -n kafka bash
./opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-headless.kafka:29092 --topic perftest --create --replication-factor 3 --partitions 3
./opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-headless.kafka:29092 --topic perftest2 --create --replication-factor 3 --partitions 3
./opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-headless.kafka:29092 --topic perftest3 --create --replication-factor 3 --partitions 3
```
For internal listeners exposed by a regular service (`KafkaCluster.spec.headlessServiceEnabled` set to `false`):
```bash
kubectl exec -it kafka-test -n kafka bash
./opt/kafka/bin/kafka-topics.sh --zookeeper zookeeper-client.zookeeper:2181 --topic perftest --create --replication-factor 3 --partitions 3
./opt/kafka/bin/kafka-topics.sh --zookeeper zookeeper-client.zookeeper:2181 --topic perftest2 --create --replication-factor 3 --partitions 3
./opt/kafka/bin/kafka-topics.sh --zookeeper zookeeper-client.zookeeper:2181 --topic perftest3 --create --replication-factor 3 --partitions 3
./opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-all-broker.kafka:29092 --topic perftest --create --replication-factor 3 --partitions 3
./opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-all-broker.kafka:29092 --topic perftest2 --create --replication-factor 3 --partitions 3
./opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-all-broker.kafka:29092 --topic perftest3 --create --replication-factor 3 --partitions 3
```
Monitoring environment is automatically installed. To monitor the infrastructure we used the official Node Exporter dashboard available with id `1860`.
Expand Down
10 changes: 9 additions & 1 deletion docs/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ Topic creation by default is enabled in Apache Kafka, but if it is configured ot

- To create a sample topic from the CLI you can run the following:

For internal listeners exposed by a headless service (`KafkaCluster.spec.headlessServiceEnabled `set to `true`):

```bash
kubectl -n kafka run kafka-topics -it --image=ghcr.io/banzaicloud/kafka:2.13-3.1.0 --rm=true --restart=Never -- /opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-headless.kafka:29092 --topic my-topic --create --partitions 1 --replication-factor 1
```

For internal listeners exposed by a regular service (`KafkaCluster.spec.headlessServiceEnabled` set to `false`):

```bash
kubectl -n kafka run kafka-topics -it --image=ghcr.io/banzaicloud/kafka:2.13-3.1.0 --rm=true --restart=Never -- /opt/kafka/bin/kafka-topics.sh --zookeeper zookeeper-client.zookeeper:2181 --topic my-topic --create --partitions 1 --replication-factor 1
kubectl -n kafka run kafka-topics -it --image=ghcr.io/banzaicloud/kafka:2.13-3.1.0 --rm=true --restart=Never -- /opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-all-broker.kafka:29092 --topic my-topic --create --partitions 1 --replication-factor 1
```

After you have created a topic, produce and consume some messages:
Expand Down

0 comments on commit 0104434

Please sign in to comment.