After you purchase the version upgrade service, follow these steps to upgrade PolarDB for PostgreSQL (PolarFlex).
Precautions
Version upgrades involve a cluster restart. Perform this operation during off-peak hours.
The database engine upgrade process involves a cluster switch. Perform this operation during off-peak hours.
The cluster disconnects during the proxy component upgrade. Perform this operation during off-peak hours.
PolarFlex version upgrade
This topic uses an upgrade from version 2.3.2 to 2.3.2.1 as an example.
Create a new version folder for
pdbcliand decompress the new version installation package.mkdir polarflex-2.3.2.1 tar -C polarflex-2.3.2.1 -xf polarflex-2.3.2.1.tar.gzChange to the working directory and run the following installation command. This command requires
sudopermissions../scripts/install.shCheck the
config.yamlfile. Copy theconfig.yamlfile, which contains information such as host IP addresses and parameters, from the oldpolarflexfolder to the newpolarflex-2.3.2.1folder. This action overwrites the currentconfig.yamlfile. Then, confirm that the parameters are as expected.cp polarflex-2.3.2/config.yaml polarflex-2.3.2.1/config.yamlUpgrade the cluster components in the following order.
Upgrade the high availability (HA) component.
pdbcli upgrade cmWait for 10 seconds, and then run
pdbcli statusto check the cluster status. After the HA component is upgraded, a new primary node is elected. You may see the error{"code":500,"msg":"Failed to request cause no CM leader!"}. If this error occurs, wait for the process to complete.Upgrade the database engine.
pdbcli upgrade dbThis process is interactive. Enter
yesto proceed. If you use a single-node cluster, add the--forceparameter. Wait for 10 seconds, and then runpdbcli statusto check the cluster status. The upgrade is successful if the status of all components isRUNNING.Upgrade the proxy component.
pdbcli upgrade proxyThis process is interactive. Enter
yesto proceed. Wait for 10 seconds, and then runpdbcli statusto check the cluster status. The upgrade is successful if the status of all components isRUNNING.
Check the license file.
If you have already installed a license, copy the `license` folder from the previous version's directory to the `polarflex-2.3.2.1` directory. This action overwrites the `license` folder for the new version. Then, confirm that a license file exists in the `license` directory.
cp -r polarflex-2.3.2/license polarflex-2.3.2.1/