Skip to content

Run Locally

Run a Danube broker directly on your machine. No Docker, no Kubernetes, just a binary.

Download the latest danube-broker and danube-cli binaries from the releases page.

The fastest way to get a broker running locally, no config file needed:

  1. Start the broker

    Terminal 1
    danube-broker --mode standalone --data-dir ./danube-data

    This auto-generates sensible defaults:

    SettingValue
    Broker address127.0.0.1:6650
    Admin address127.0.0.1:50051
    Raft address127.0.0.1:7650
    Raft data./danube-data/raft
    WAL storage./danube-data/wal
    AuthenticationNone
    Storage modeLocal
  2. Produce messages

    Terminal 2
    danube-cli produce \
    -s http://127.0.0.1:6650 \
    -t /default/demo_topic \
    -c 10 \
    -m "Hello, Danube!"
  3. Consume messages

    Terminal 3
    danube-cli consume \
    -s http://127.0.0.1:6650 \
    -t /default/demo_topic \
    -m my_subscription

Data persists across restarts. To start fresh, remove the data directory and re-run.

To run multiple brokers on the same machine, you need a config file. Download the sample config:

Terminal window
curl -O https://raw.githubusercontent.com/danube-messaging/danube/main/config/danube_broker.yml

Give each broker a unique port set and pass --seed-nodes so they discover each other:

Broker 1
danube-broker --config-file danube_broker.yml \
--broker-addr 0.0.0.0:6650 --admin-addr 0.0.0.0:50051 \
--raft-addr 0.0.0.0:7650 --data-dir ./data1/raft \
--seed-nodes "0.0.0.0:7650,0.0.0.0:7651" &
Broker 2
danube-broker --config-file danube_broker.yml \
--broker-addr 0.0.0.0:6651 --admin-addr 0.0.0.0:50052 \
--raft-addr 0.0.0.0:7651 --data-dir ./data2/raft \
--seed-nodes "0.0.0.0:7650,0.0.0.0:7651" &

The broker with the lowest Raft node ID initializes the cluster; the other joins automatically.

Terminal window
# Stop the broker
pkill danube-broker
# Remove data (for a fresh start)
rm -rf ./danube-data
# Verify
ps aux | grep danube-broker