DEV Community

Michael
Michael

Posted on • Originally published at gbase.cn

Upgrading GBase 8c: Online and Offline Strategies

To improve stability, security, and performance, database upgrades are a core operations task. GBase 8c, the China‑domestically developed database from GBASE, supports both online and offline upgrades with a grey‑release approach — business is unaffected during the process, and you can quickly rollback at the first sign of trouble.

Upgrade Modes

  • Online upgrade: No downtime. Services keep running throughout.
  • Offline upgrade: Business is suspended during the window.

You can upgrade just the HA module, just the database kernel, or both together. Small and major version upgrades follow the same steps.

Offline HA Module Upgrade

  1. Upload and extract the new package.
  2. Prepare the configuration:
   gha_ctl prepare version pkg_path install_prefix [-u 'gbase'] [-p 22] [-c gbase8c] -l dcslist [-t multiple-nodes|single-inst]
Enter fullscreen mode Exit fullscreen mode
  1. Pre‑processing:
   ./gha_ctl upgrade -t catalog V5_S3.0.3B06 -l http://10.0.7.11:2379
Enter fullscreen mode Exit fullscreen mode

Note: Replace upgrade with rollback if downgrading.

  1. Stop all nodes:
   gha_ctl stop all -l http://10.0.7.11:2379
Enter fullscreen mode Exit fullscreen mode
  1. Perform the HA upgrade:
   ./gha_ctl upgrade V5_S3.0.3B06 100.0.7.12 -t ha -l http://10.0.7.11:2379
Enter fullscreen mode Exit fullscreen mode
  1. Start all nodes:
   gha_ctl start all -l http://10.0.7.11:2379
Enter fullscreen mode Exit fullscreen mode
  1. Post‑upgrade configuration:
   gha_ctl upgrade -t catalog-post V5_S3.0.3B06 -l http://10.0.7.11:2379
Enter fullscreen mode Exit fullscreen mode

Online Upgrade

The service stays online. Nodes are upgraded one by one.

  1. Check cluster state:
   gha_ctl monitor all -l https://10.185.102.1:2379 -H -I -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode
  1. Upload and extract the new package:
   tar -zxf GBase8cV5_S3.0.3B06_centos7.6_aarch64.tar.gz
   tar -zxf GBase8cV5_S3.0.3B06_CentOS_aarch64_om.tar.gz
Enter fullscreen mode Exit fullscreen mode
  1. Prepare the new version across nodes:
   gha_ctl prepare V5_S3.0.3B06 /data/mpp/gbase/gbase_pkg_b86 /data/mpp/gbase/gbase_db -l http://10.185.102.1:2379,... -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode
  1. Upgrade HA:
   gha_ctl upgrade V5_S3.0.3B06 -t ha -l http://10.185.102.1:2379,... -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode
  1. Upgrade each node in sequence (example for node1):

a. Switchover primary DN/GTM to standby:

   gha_ctl switchover datanode dn1 dn1_3 dn1_4 -l ... -c gbase8c-cluster01
   gha_ctl switchover gtm gtm3 gtm5 -l ... -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode

b. Stop the standby instances and coordinator:

   gha_ctl stop datanode dn1 dn1_3 -l ... -c gbase8c-cluster01
   gha_ctl stop datanode dn2 dn2_4 -l ... -c gbase8c-cluster01
   gha_ctl stop gtm gtm3 -l ... -c gbase8c-cluster01
   gha_ctl stop coordinator cn3 -l ... -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode

c. Upgrade the database kernel:

   ./gha_ctl upgrade V5_S3.0.3B06 10.185.103.1 -t app -l ... -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode

d. Bring the instances back up:

   gha_ctl start datanode dn1 dn1_3 -l ... -c gbase8c-cluster01
   gha_ctl start datanode dn2 dn2_4 -l ... -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode

Repeat the same pattern for node2, node3, and node4. After all nodes are upgraded, restore the original primary assignments:

   gha_ctl switchover datanode dn2 dn2_4 dn2_3 -l ... -c gbase8c-cluster01
   gha_ctl switchover datanode dn4 dn4_4 dn4_3 -l ... -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode
  1. Validate cluster health and version:
   gha_ctl monitor all -l https://10.185.102.1:2379 -H -I -c gbase8c-cluster01
Enter fullscreen mode Exit fullscreen mode

Data Protection

No data is exported or imported during the upgrade. Take a full backup before starting:

  1. Enable WAL archiving:
   gha_ctl set gtm gtm1 -p archive_command="'scp %p 10.0.1.47:/home/gbase/backup/gtm_wal/%f'" -l http://10.0.1.44:2379/
   gha_ctl set gtm gtm1 -p archive_mode=on -l http://10.0.1.44:2379/
Enter fullscreen mode Exit fullscreen mode
  1. Run a full backup:
   gha_ctl backup all -p /home/gbase/backup -l http://10.0.7.64:2379
Enter fullscreen mode Exit fullscreen mode

The grey‑release methodology and built‑in rollback tools make GBase 8c upgrades a safe, predictable operation in any gbase database environment.

Top comments (0)