If you want to use the bundle unloading strategy of AvgShedder, OverloadShedder, ThresholdShedder, or UniformLoadShedder.
note
It is not recommended to migrate from the modular or extensible to the simple broker load balancer since the simple broker load balancer is deprecated and no longer in use.
Migrate from simple to modular broker load balancer
You can migrate from the simple to the modular broker load balancer, by manually changing the configuration settings in the broker.conf file or by using the pulsar-admin tool.
You do not need to restart the Pulsar cluster. The new settings will take effect after 1 to 2 minutes.
Migrate from modular to extensible broker load balancer
You can migrate from the modular to the extensible broker load balancer, by manually changing settings in the broker.conf file. During the migration, the lookup and assignment will be redirected to the brokers with the extensible load balancer.
For a rolling migration on Pulsar 5.0 and later, first enable lookup redirection on the existing brokers. Introducing the new load manager without that flag leaves the two types handling lookups independently.
note
Do not change loadManagerClassName through pulsar-admin brokers update-dynamic-config for this migration. Although the setting is dynamic, changing it swaps the manager in place without reconfiguring the leader-election and load-reporting tasks initialized at startup or migrating bundle ownership between the two managers. Use broker.conf and a rolling upgrade of brokers; use the dynamic API to enable and disable migration redirection.
Restart the Pulsar cluster. The new settings will take effect after the restart.
Migrate from extensible to modular broker load balancer
You can migrate from the extensible to the modular broker load balancer, by manually changing the setting in the broker.conf file. During the migration, the lookup and assignment will be redirected to the brokers with the modular load balancer.
For a rolling migration on Pulsar 5.0 and later, first enable lookup redirection on the existing brokers, including when rolling back a migration.
note
Do not change loadManagerClassName through pulsar-admin brokers update-dynamic-config for this migration. Although the setting is dynamic, changing it swaps the manager in place without reconfiguring the leader-election and load-reporting tasks initialized at startup or migrating bundle ownership between the two managers. Use broker.conf and a rolling upgrade of brokers; use the dynamic API to enable and disable migration redirection.
Change the following settings in the broker.conf file:
Update broker load balancer by setting loadManagerClassName to ModularLoadManagerImpl
Update bundle unloading strategy to AvgShedder (the default of the modular load balancer from Pulsar 5.0.0; the 5.0.0-M1/M2 milestones still default to ThresholdShedder), OverloadShedder, ThresholdShedder, or UniformLoadShedder based on your needs.
Restart the Pulsar cluster. The new settings will take effect after the restart.
Enable lookup redirection during a rolling migration
Pulsar 5.0 and later disable migration redirection by default (loadManagerMigrationEnabled=false). Before starting the first broker with a different load manager, enable it dynamically on the existing cluster:
Wait for the setting to propagate before introducing the new type. This flag enables lookup redirection; change loadManagerClassName and its associated strategy settings in the broker configuration and restart the brokers, as described above. Do not change the load manager type through the dynamic configuration API for this migration.
While both load manager types are running, the most recently started broker determines the load manager type to which lookups are redirected, and each type assigns bundles only to brokers of its own type. The modular and extensible ownership stores remain separate. Plan enough capacity in the new pool for new assignments and expect additional ownership changes during migration. Follow Rolling upgrade of brokers to pause automatic rebalancing, control bundle movement, and check each replacement before proceeding.
After all brokers use the intended load manager, disable migration redirection:
Pulsar 4.x performs this redirection without the flag. Choosing the extensible load manager's ownership backend (system topic or metadata store) is a separate migration; do not combine it with a load manager type change in the same rollout.