Anonymitaet commented on code in PR #660: URL: https://github.com/apache/pulsar-site/pull/660#discussion_r1281350789
########## docs/concepts-broker-load-balancing-quick-start.md: ########## @@ -0,0 +1,594 @@ +--- +id: concepts-broker-load-balancing-quick-start +title: Quick start +sidebar_label: "Quick start" +--- + +[Broker load balancing](./concepts-broker-load-balancing-overview.md) helps you distribute messages evenly among brokers and ensure efficient utilization of resources across Pulsar clusters. + +This tutorial guides you through the steps for getting started with broker load balancing using Pulsar 3.0.0 in Docker. + +## Prerequisites + +- [Install Pulsar](./getting-started-standalone.md): + + - If you want to run the modular load balancer, use Pulsar 1.7.0 or later versions. + + - If you want to run the extensible load balancer, use Pulsar 3.0.0 or later versions. + +- Install Docker and allocate at least 8 GB of memory. + + +## Configure broker load balancer to run automatically + +If you want to use broker load balancing automatically, follow the steps below. + +### Step 1. Start ZooKeeper, bookie, and broker + +Create a `docker-compose.yaml` file and copy the following code to that file. + +This example starts a ZooKeeper server, a bookie, and 2 brokers, sets the load balancer type to extensible, sets the unloading strategy to [TransferShedder](./concepts-broker-load-balancing-concepts.md#bundle-unloading-strategies), and enables debug mode. + +```yaml +version: '3' +networks: + pulsar: + driver: bridge +services: + # Start ZooKeeper + zookeeper: + image: streamnative/pulsar:3.1.0-SNAPSHOT + container_name: zookeeper + restart: on-failure + networks: + - pulsar + volumes: + - ./data/zookeeper:/pulsar/data/zookeeper + environment: + - metadataStoreUrl=zk:zookeeper:2181 + - PULSAR_MEM=-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m + command: > + bash -c "bin/apply-config-from-env.py conf/zookeeper.conf && \ + bin/generate-zookeeper-config.sh conf/zookeeper.conf && \ + exec bin/pulsar zookeeper" + healthcheck: + test: ["CMD", "bin/pulsar-zookeeper-ruok.sh"] + interval: 10s + timeout: 5s + retries: 30 + + # Initialize cluster metadata + pulsar-init: + container_name: pulsar-init + hostname: pulsar-init + image: streamnative/pulsar:3.1.0-SNAPSHOT + networks: + - pulsar + command: > + bin/pulsar initialize-cluster-metadata \ + --cluster cluster-a \ + --zookeeper zookeeper:2181 \ + --configuration-store zookeeper:2181 \ + --web-service-url http://broker:8080 \ + --broker-service-url pulsar://broker:6650 + depends_on: + zookeeper: + condition: service_healthy + + # Start bookie + bookie: + image: streamnative/pulsar:3.1.0-SNAPSHOT Review Comment: I'll replace streamnative/pulsar:3.1.0-SNAPSHOT with apache/pulsar image once the new one is released -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
