How to install and configure Redpanda on Ubuntu 22.04

Redpanda is a Kafka®-compatible streaming data platform that boasts of being 10x faster and 6x more cost efficient. It is also JVM-free, ZooKeeper®-free, Jepsen-tested and source available. It is distributed as a single binary with everything thus allowing you to deploy in minutes.

It works natively with Kafka tools.

In this guide we will learn how to install Redpanda in Ubuntu 22.04.

Related content:

Installing Redpanda

First start by ensuring that OS packages are up to date

sudo apt update
sudo apt upgrade

Run the setup script to download and install the repo

curl -1sLf 'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/bash.deb.sh' | sudo -E bash

You should see output similar to this

$ curl -1sLf 'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/bash.deb.sh' | sudo -E bash
Executing the  setup script for the 'redpanda/redpanda' repository ...

   OK: Checking for required executable 'curl' ...
   OK: Checking for required executable 'apt-get' ...
   OK: Detecting your OS distribution and release using system methods ...
 ^^^^: ... Detected/provided for your OS/distribution, version and architecture:
 >>>>:
 >>>>: ... distro=ubuntu  version=22.04  codename=jammy  arch=x86_64
 >>>>:
 NOPE: Checking for apt dependency 'apt-transport-https' ...
   OK: Updating apt repository metadata cache ...
   OK: Attempting to install 'apt-transport-https' ...
   OK: Checking for apt dependency 'ca-certificates' ...
   OK: Checking for apt dependency 'gnupg' ...
   OK: Checking for apt signed-by key support ...
   OK: Importing 'redpanda/redpanda' repository GPG key ...
   OK: Checking if upstream install config is OK ...
   OK: Installing 'redpanda/redpanda' repository via apt ...
   OK: Updating apt repository metadata cache ...
   OK: The repository has been installed successfully - You're ready to rock!

Then install redpanda

sudo apt install redpanda

When Redpanda is installed, it is set to run in development mode. To get the most out of the fastest queue in the west, enable production mode by running the following:

sudo rpk redpanda mode production

followed by:

sudo rpk tune all

This will autotune your system to give you the best performance from Redpanda.

Start and Enable redpanda

Start using systemd:

sudo systemctl start redpanda

Verify that Redpanda is up and running:

$ sudo systemctl status redpanda
● redpanda.service - Redpanda, the fastest queue in the West.
     Loaded: loaded (/lib/systemd/system/redpanda.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-02-03 15:44:49 UTC; 9s ago
   Main PID: 3860 (redpanda)
     Status: "redpanda is ready! - v22.3.11 - 9eefb907c43bf1cfeb0783808c224385c857c0d4-dirty"
      Tasks: 4 (limit: 8921)
     Memory: 692.6M
        CPU: 885ms
     CGroup: /redpanda.slice/redpanda.service
             └─3860 /opt/redpanda/bin/redpanda --redpanda-cfg /etc/redpanda/redpanda.yaml --lock-memory=false

Feb 03 15:44:49 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:49,296 [shard 0] cluster - config_manager.cc:126 - Completed bootstrap as leader
Feb 03 15:44:49 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:49,296 [shard 0] cluster - config_manager.cc:106 - Bootstrap complete (version 1)
Feb 03 15:44:49 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:49,314 [shard 0] features - feature_migrator.cc:102 - Successfully applied migration for feature cloud_retention
Feb 03 15:44:54 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:54,267 [shard 0] cluster - members_backend.cc:755 - [update: {{node_id: 0, type: added}}] reconciliation loop - pending reallocation count: 0, finished: false
Feb 03 15:44:54 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:54,267 [shard 0] cluster - members_backend.cc:500 - [update: {{node_id: 0, type: added}}] there are 0 replicas in -1 domain, requested to assign 0 replicas per node
Feb 03 15:44:54 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:54,267 [shard 0] cluster - members_backend.cc:249 - [update: {{node_id: 0, type: added}}] unevenness error: 0, previous error: 1, improvement: 1, min improvement: 0
Feb 03 15:44:54 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:54,267 [shard 0] cluster - members_backend.cc:500 - [update: {{node_id: 0, type: added}}] there are 0 replicas in 0 domain, requested to assign 0 replicas per node
Feb 03 15:44:54 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:54,267 [shard 0] cluster - members_backend.cc:249 - [update: {{node_id: 0, type: added}}] unevenness error: 0, previous error: 1, improvement: 1, min improvement: 0
Feb 03 15:44:54 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:54,267 [shard 0] cluster - members_backend.cc:765 - [update: {{node_id: 0, type: added}}] calculated reallocations: {}
Feb 03 15:44:54 fidle-ubuntu2204 rpk[3860]: INFO  2023-02-03 15:44:54,269 [shard 0] cluster - members_manager.cc:214 - Applying update to members_manager

Now enable redpanda on boot

sudo systemctl enable redpanda

Congratulations, You now have a single-node cluster running Redpanda. The cluster will run on port :9092 and you can access it like you would access kafka.

Installing rpk

Redpanda Keeper (rpk) is a single binary application that provides a way to interact with your Redpanda clusters from the command line.

You can install rpk as part of a bundle that includes redpanda , or you can install the rpk binary separately.

To install the rpk binary as a standalone application, download the rpk archive:

curl -LO https://github.com/redpanda-data/redpanda/releases/latest/download/rpk-linux-amd64.zip

Ensure that you have the folder ~/.local/bin:

mkdir -p ~/.local/bin

Add it to your $PATH:

export PATH="~/.local/bin:$PATH"

Unzip the rpk files to your ~/.local/bin/ directory:

unzip rpk-linux-amd64.zip -d ~/.local/bin/

After the files have been unzipped, run rpk version to display the rpk binary version.

rpk version

The output displays the version number. For example:

v22.3.11 (rev 9eefb907c)

Install Redpanda Console

To connect Redpanda Console to a Kafka cluster running on your local machine or in another Docker container:

docker run --network=host \<br>  -e KAFKA_BROKERS=localhost:9092 \<br>  docker.redpanda.com/vectorized/console:latest

To connect Redpanda Console to a remote Kafka cluster:

docker run -p 8080:8080 \<br>  -e KAFKA_BROKERS=bootstrap.cluster-hash.redpanda.cloud:9092 \<br>  -e KAFKA_TLS_ENABLED=true \<br>  -e KAFKA_SASL_ENABLED=true \<br>  -e KAFKA_SASL_MECHANISM=SCRAM-SHA-256 \<br>  -e KAFKA_SASL_USERNAME=xxx \<br>  -e KAFKA_SASL_PASSWORD=xxx \<br>  docker.redpanda.com/vectorized/console:latest

To install the Redpanda Console package on Debian/Ubuntu, run the following commands:

curl -1sLf \<br>  'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/bash.deb.sh' \<br>  | sudo -E bash<br>  <br>sudo apt-get install redpanda-console

Start the console

sudo systemctl start redpanda-console

The console will run in port 8080 and you can access it in your browser.

That is it, enjoy your Redpanda installation.

comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy