Architecture Overview
A typical Pulsar cluster includes:- ZooKeeper ensemble (3-5 nodes) - Metadata storage and coordination
- BookKeeper cluster (3+ nodes) - Persistent message storage
- Pulsar brokers (2+ nodes) - Message serving and topic management
- Pulsar proxy (optional) - Load balancing and protocol translation
Prerequisites
- Multiple Linux servers (minimum 3 for ZooKeeper, 3 for BookKeeper, 2 for brokers)
- Java 11 or higher on all nodes
- Network connectivity between all nodes
- Sufficient disk space (especially for BookKeeper nodes)
- At least 8GB RAM per node
Deployment Steps
Deploy ZooKeeper ensemble
On each ZooKeeper node (e.g., zk1, zk2, zk3), configure Create the server ID file:Start ZooKeeper on each node:Verify ZooKeeper is running:
conf/zookeeper.conf:Deploy BookKeeper bookies
On each BookKeeper node, configure Start BookKeeper on each node:Verify bookies are registered:
conf/bookkeeper.conf:Deploy Pulsar brokers
On each broker node, configure Start brokers:Verify brokers are running:
conf/broker.conf:Deploy Pulsar proxy (optional)
For production deployments, deploy proxy nodes for load balancing:Start proxy:
Production Configuration
BookKeeper Tuning
For optimal performance, configure BookKeeper with these settings:Broker Tuning
High Availability Settings
Systemd Service Configuration
Create systemd service files for automatic startup:ZooKeeper Service
BookKeeper Service
Broker Service
Monitoring and Metrics
Prometheus Metrics
Pulsar exposes metrics on port 8080 for brokers and 8000 for bookies:Health Checks
Scaling the Cluster
Adding Brokers
- Install Pulsar on new node
- Configure
conf/broker.confwith cluster settings - Start the broker
- Verify registration:
bin/pulsar-admin brokers list pulsar-cluster
Adding Bookies
- Install Pulsar on new node
- Configure
conf/bookkeeper.conf - Start the bookie:
bin/pulsar-daemon start bookie - Verify:
bin/bookkeeper shell listbookies -rw
Disaster Recovery
Backup Configuration
Cluster Recovery
See the Operations Guide for detailed recovery procedures.Security
Enable TLS
Enable Authentication
Troubleshooting
Broker Not Starting
Check logs:Bookie Not Registering
Check bookie logs and verify disk space:Next Steps
- Configure Geo-Replication for multi-datacenter deployments
- Set up Monitoring with Prometheus and Grafana
- Implement Security with authentication and authorization
- Learn about Tiered Storage for long-term retention