macOS
Redpanda is a modern streaming platform for mission critical workloads. With Redpanda you can get up and running with streaming quickly and be fully compatible with the Kafka ecosystem.
This quick start guide can help you get started with Redpanda for development and testing purposes. For production or benchmarking, set up a production deployment.
Getting Redpanda running
To run Redpanda on MacOS, we’ll use rpk
to bring up Redpanda nodes in Docker containers.
Make sure that you install Docker first.
If you want to customize the containers, you can also set up your own Redpanda containers in Docker.
Installing rpk
You can install rpk
on MacOS either with Homebrew or you can just download the binary.
-
To install
rpk
with Homebrew, run:brew install redpanda-data/tap/redpanda
-
To download the
rpk
binary:-
Download the rpk archive with:
curl -LO https://github.com/redpanda-data/redpanda/releases/latest/download/rpk-darwin-amd64.zip
-
Unpack the archive to
/usr/local/bin
or any location in your$PATH
with:unzip rpk-darwin-amd64.zip
-
Running a redpanda cluster
To run Redpanda in a 3-node cluster, run: rpk container start -n 3
The first time you run rpk container start
, it downloads an image matching the rpk version (you can check it by running rpk version
).
You now have a 3-node cluster running Redpanda!
The command output shows the addresses of the cluster nodes:
$ rpk container start -n 3
Downloading latest version of Redpanda
Starting cluster
Waiting for the cluster to be ready...
NODE ID ADDRESS
0 127.0.0.1:49462
1 127.0.0.1:49468
2 127.0.0.1:49467
You can run rpk
commands to interact with the cluster, for example:
rpk cluster info --brokers 127.0.0.1:49462,127.0.0.1:49468,127.0.0.1:49467
Do some streaming
Here are the basic commands to produce and consume streams:
-
Create a topic. We’ll call it "twitch_chat":
rpk topic create twitch_chat --brokers <broker1_address>,<broker2_address>...
-
Produce messages to the topic:
rpk topic produce twitch_chat --brokers <broker1_address>,<broker2_address>...
Type text into the topic and press Ctrl + D to separate between messages.
Press Ctrl + C to exit the produce command.
-
Consume (or read) the messages in the topic:
rpk topic consume twitch_chat --brokers <broker1_address>,<broker2_address>...
Each message is shown with its metadata, like this:
{ "message": "How do you stream with Redpanda?\n", "partition": 0, "offset": 1, "timestamp": "2021-02-10T15:52:35.251+02:00" }
You’ve just installed Redpanda and done streaming in a few easy steps.
Clean Up
When you are finished with the cluster, you can shutdown and delete the nodes with:
rpk container purge
What’s Next?
-
Our FAQ page shows all of the clients that you can use to do streaming with Redpanda. (Spoiler: Any Kafka-compatible client!)
-
Use the Quick Start Docker Guide to try out Redpanda using Docker.
-
Want to setup a production cluster? Check out our Production Deployment Guide.