Apache Pulsar is comprised of multiple components, ZooKeeper, bookies, and brokers. These components are either stateful or stateless. You do not have to upgrade ZooKeeper nodes unless you have special requirement. While you upgrade, you need to pay attention to bookies (stateful), brokers and proxies (stateless).
The following are some guidelines on upgrading a Pulsar cluster. Read the guidelines before upgrading.
autorecovery
is enabled, you need to disable autorecovery
in the upgrade process, and re-enable it after completing the process.Note: Currently, Apache Pulsar is compatible between versions.
To upgrade an Apache Pulsar cluster, follow the upgrade sequence.
autorecovery
with the following command.bin/bookkeeper shell autorecovery -disable
autorecovery
with the following command.bin/bookkeeper shell autorecovery -enable
While you upgrade ZooKeeper servers, you can do canary test first, and then upgrade all ZooKeeper servers in the cluster.
You can test an upgraded version in one of ZooKeeper servers before upgrading all ZooKeeper servers in your cluster.
To upgrade ZooKeeper server to a new version, complete the following steps:
pulsar zookeeper-shell
to connect to the newly upgraded ZooKeeper server and run a few commands to verify if it works as expected.If issues occur during canary test, you can shut down the problematic ZooKeeper node, revert the binary and configuration, and restart the ZooKeeper with the reverted binary.
After canary test to upgrade one ZooKeeper in your cluster, you can upgrade all ZooKeeper servers in your cluster.
You can upgrade all ZooKeeper servers one by one by following steps in canary test.
While you upgrade bookies, you can do canary test first, and then upgrade all bookies in the cluster. For more details, you can read Apache BookKeeper Upgrade guide.
You can test an upgraded version in one or a small set of bookies before upgrading all bookies in your cluster.
To upgrade bookie to a new version, complete the following steps:
ReadOnly
mode to verify if the bookie of this new version runs well for read workload.bin/pulsar bookie --readOnly
ReadOnly
mode, stop the bookie and restart it in Write/Read
mode.bin/pulsar bookie
If issues occur during the canary test, you can shut down the problematic bookie node. Other bookies in the cluster replaces this problematic bookie node with autorecovery.
After canary test to upgrade some bookies in your cluster, you can upgrade all bookies in your cluster.
Before upgrading, you have to decide whether to upgrade the whole cluster at once, including downtime and rolling upgrade scenarios.
In a rolling upgrade scenario, upgrade one bookie at a time. In a downtime upgrade scenario, shut down the entire cluster, upgrade each bookie, and then start the cluster.
While you upgrade in both scenarios, the procedure is the same for each bookie.
Advanced operations
When you upgrade a large BookKeeper cluster in a rolling upgrade scenario, upgrading one bookie at a time is slow. If you configure rack-aware or region-aware placement policy, you can upgrade bookies rack by rack or region by region, which speeds up the whole upgrade process.
The upgrade procedure for brokers and proxies is the same. Brokers and proxies are stateless
, so upgrading the two services is easy.
You can test an upgraded version in one or a small set of nodes before upgrading all nodes in your cluster.
To upgrade to a new version, complete the following steps:
If issues occur during canary test, you can shut down the problematic broker (or proxy) node. Revert to the old version and restart the broker (or proxy).
After canary test to upgrade some brokers or proxies in your cluster, you can upgrade all brokers or proxies in your cluster.
Before upgrading, you have to decide whether to upgrade the whole cluster at once, including downtime and rolling upgrade scenarios.
In a rolling upgrade scenario, you can upgrade one broker or one proxy at a time if the size of the cluster is small. If your cluster is large, you can upgrade brokers or proxies in batches. When you upgrade a batch of brokers or proxies, make sure the remaining brokers and proxies in the cluster have enough capacity to handle the traffic during upgrade.
In a downtime upgrade scenario, shut down the entire cluster, upgrade each broker or proxy, and then start the cluster.
While you upgrade in both scenarios, the procedure is the same for each broker or proxy.