Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Instant kraft demo #1124

Draft
wants to merge 3 commits into
base: 7.2.1-post
Choose a base branch
from
Draft

WIP: Instant kraft demo #1124

wants to merge 3 commits into from

Conversation

addisonhuddy
Copy link
Contributor

Creating a single node, lightweight KRaft example that is based on the cp-all-in-one-kraft demo. Over time, this demo will evolve as the KRaft tooling improves. The main goal of the example is to show how easy it is to run Kafka in KRaft mode.

Includes

  • docker-compose file
  • readme with instructions on how to run the example.
  • a run script to get around some of the current ZK checks in the Confluent Kafka docker image.

Comment on lines +29 to +31
$ docker compose exec broker kafka-topics --create --topic zookeeper-vacation-ideas --bootstrap-server localhost:9092

$ docker-compose exec broker kafka-producer-perf-test --topic zookeeper-vacation-ideas \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commands used include both docker compose and docker-compose. The former I think relies on later versions of Docker with either Compose included, or via a command-plugins capability.

Maybe we should stick to one. I think our formal docs lean towards docker-compose.

```
$ git clone https://github.com/confluentinc/examples.git && cd examples/instant-kraft

$ docker compose up
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better or worse, our examples seem to usually use docker-compose up -d, i.e. launch detached/daemonized, so the current shell isn't left bound to the command and tailing the logs. Downside is that you have to docker logs or docker-compose logs to see any errors or interesting logging.

Up to you whether you want the -d here, but note that users might struggle with losing their shell prompt, and also unintentionally kill with CTRL-C.


>> cat metadataQuorum/leader
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention CTRL-D to exit the REPL?

$ docker compose up
```

That's it! One container, one process, doing the the broker and controller work. No Zookeeper.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ZooKeeper (camel case) is standard.

Comment on lines +3 to +9
___
.'O o'-._
/ O o_.-`|
/O_.-' O |
|O o O .-`
|o O_.-'
'--`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to be in a code block to appear proper cheesy.

```

## Step 3
Explore the cluster using the new kafka metadata command line tool.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we refer to it inline by name? I don't mind, just asking: kafka-metadata-shell

$ docker compose up
```

That's it! One container, one process, doing the the broker and controller work. No Zookeeper.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doing the the broker and controller work

Remove duplicate "the" and reword. Maybe

One container, one process performing both broker and controller/quorum roles.

```

That's it! One container, one process, doing the the broker and controller work. No Zookeeper.
The key server configure to enable KRaft is the `process.roles`. Here we have the same node doing both the broker and quorum conroller work. Note that this is ok for local development, but in production you should have seperate nodes for the broker and controller quorum nodes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs rewording.

The key server configuration for enabling KRaft is process.roles.

@joel-hamill joel-hamill marked this pull request as draft January 6, 2023 18:56
@joel-hamill
Copy link
Collaborator

@addisonhuddy fyi moved this back to "draft" mode to avoid the stale PR reminders.

Copy link

cla-assistant bot commented Apr 28, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants