Demogorgon314 commented on code in PR #662:
URL: https://github.com/apache/pulsar-site/pull/662#discussion_r1282690648


##########
docs/develop-load-manager.md:
##########
@@ -207,3 +103,216 @@ then all machines are approximately overloaded. In the 
case in which a broker's
 threshold, that broker is not considered for bundle assignment. If all brokers 
are overloaded, the bundle is randomly
 assigned.
 
+## Enablement
+
+You can enable a simple, modular, or extensible load manager by following the 
steps below.
+
+### Enable simple load manager
+
+You can enable the simple load manager using one of the following methods: 
+
+- Method 1
+
+  Update the value of 
[loadManagerClassName](https://github.com/apache/pulsar/blob/782e91fe327efe2c9c9107d6c679c2837d43935b/conf/broker.conf#L1309)
 to `org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl` in 
`conf/broker.conf`.
+
+- Method 2
+  
+  Use the `pulsar-admin` tool. 
+
+   ```shell
+   pulsar-admin brokers update-dynamic-config \
+   --config loadManagerClassName \
+   --value org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl
+   ``` 
+
+  :::note 
+  
+  Any mistakes in specifying the load manager will cause Pulsar to default to 
`SimpleLoadManagerImpl`.
+
+  :::
+
+### Enable modular load manager
+
+You can enable the modular load manager using one of the following methods: 
+
+- Method 1
+
+  Update the value of 
[loadManagerClassName](https://github.com/apache/pulsar/blob/782e91fe327efe2c9c9107d6c679c2837d43935b/conf/broker.conf#L1309)
 to `org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl` in 
`conf/broker.conf`.
+
+- Method 2
+  
+  Use the `pulsar-admin` tool. 
+
+   ```shell
+   pulsar-admin brokers update-dynamic-config \
+   --config loadManagerClassName \
+   --value org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl
+   ```
+
+  :::note 
+  
+  Any mistakes in specifying the load manager will cause Pulsar to default to 
`SimpleLoadManagerImpl`.
+
+  :::
+
+### Enable extensible load manager
+
+You can enable the extensible load manager by updating the value of 
[loadManagerClassName](https://github.com/apache/pulsar/blob/782e91fe327efe2c9c9107d6c679c2837d43935b/conf/broker.conf#L1309)
 to `org.apache.pulsar.broker.loadbalance.impl.ExtensibleLoadManagerImpl` in 
`conf/broker.conf`.
+
+:::note
+
+The pulsar-admin tool is not supported for enabling the extensible load 
manager.
+
+:::
+
+## Verification
+
+If you want to verify which load manager is used, follow the steps below.
+
+### Step 1: check loadManagerClassName
+
+You can use the `pulsar-admin` tool to examine the `loadManagerClassName` 
element.
+
+**Input**
+
+```bash
+bin/pulsar-admin brokers get-all-dynamic-config
+```
+
+**Output**
+
+```bash
+{
+"loadManagerClassName" : 
"org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl"
+}
+```
+
+If there is no `loadManagerClassName` element, then the value of 
[loadManagerClassName](https://github.com/apache/pulsar/blob/782e91fe327efe2c9c9107d6c679c2837d43935b/conf/broker.conf#L1309)
 in the `conf/broker.conf` file is used.
+
+### Step 2: verify load manager (optional) 
+
+To double-check which load manager is used, you can [check the ZooKeeper load 
report](#method-1-check-zookeeper-load-report) or [check monitor-brokers 
output](#method-2-check-monitor-brokers-output).  
+
+#### Method 1: check ZooKeeper load report
+
+Check the ZooKeeper load report. The load report in `/loadbalance/brokers/...`.
+
+```bash
+tbd

Review Comment:
   SimpleLoadManagerImpl:
   ```
   [zk: zookeeper:2181(CONNECTED) 0] ls /loadbalance/brokers
   [broker-1:8080, broker-2:8080]
   [zk: zookeeper:2181(CONNECTED) 1] get /loadbalance/brokers/broker-1:8080
   
{"name":"broker-1:8080","brokerVersionString":"3.1.0-SNAPSHOT","webServiceUrl":"http://broker-1:8080","pulsarServiceUrl":"pulsar://broker-1:6650","persistentTopicsEnabled":true,"nonPersistentTopicsEnabled":true,"timestamp":1691042931108,"msgRateIn":0.0,"msgRateOut":0.0,"numTopics":0,"numConsumers":0,"numProducers":0,"numBundles":0,"protocols":{},"loadManagerClassName":"org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl","startTimestamp":1691042931108,"systemResourceUsage":{"bandwidthIn":{"usage":0.595387281695773,"limit":1.0E7},"bandwidthOut":{"usage":0.5799226769764033,"limit":1.0E7},"cpu":{"usage":6.224803359552059,"limit":800.0},"memory":{"usage":152.0,"limit":2096.0},"directMemory":{"usage":0.0,"limit":256.0}},"bundleStats":{},"bundleGains":[],"bundleLosses":[],"allocatedCPU":0.0,"allocatedMemory":0.0,"allocatedBandwidthIn":0.0,"allocatedBandwidthOut":0.0,"allocatedMsgRateIn":0.0,"allocatedMsgRateOut":0.0,"preAllocatedCPU":0.0,"preAllocatedMemory":0.0,"preAllocate
 
dBandwidthIn":0.0,"preAllocatedBandwidthOut":0.0,"preAllocatedMsgRateIn":0.0,"preAllocatedMsgRateOut":0.0,"underLoaded":true,"overLoaded":false,"loadReportType":"LoadReport","msgThroughputIn":0.0,"msgThroughputOut":0.0,"bandwidthIn":{"usage":0.595387281695773,"limit":1.0E7},"bandwidthOut":{"usage":0.5799226769764033,"limit":1.0E7},"memory":{"usage":152.0,"limit":2096.0},"cpu":{"usage":6.224803359552059,"limit":800.0},"directMemory":{"usage":0.0,"limit":256.0},"lastUpdate":1691042931108}
   ```



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to