This walkthrough demonstrates how to deploy a GBase 8c primary‑standby cluster with a virtual IP (VIP) and verify automatic failover. GBase 8c is a China‑domestically developed database from GBASE, designed for transactional workloads.
Environment
| IP | Hostname | Role |
|---|---|---|
| 10.x.x.31 | gbase8c_7_31 | Primary |
| 10.x.x.35 | gbase8c_7_35 | Standby |
| 10.x.x.34 | - | VIP |
Package: GBase8cV5_S5.0.0B28_centos7.8_x86_64.tar.gz
Pre‑Installation (Both Nodes)
- Update
/etc/hostswith hostname entries. - Disable firewall and SELinux.
- Install dependencies:
expect,bzip2. - Create user
gbasewith sudo privileges. - Set up passwordless SSH for both
rootandgbasebetween nodes.
Silent Installation
- On the primary node, create
/data/install_package, upload and extract the tarballs. - Prepare an XML cluster configuration file defining node names, IPs, directories, and CM server settings.
- Run
gs_preinstallas root with the XML file. - Change ownership to
gbase, then rungs_installto complete deployment. - Confirm the cluster is
Normalwithgs_om -t status --detail. You should see one Primary and one Standby datanode.
Configuring the Virtual IP
- Add a VIP resource named
CM_VIPwith the floating address:
cm_ctl res --add --res_name="CM_VIP" --res_attr="resources_type=VIP,float_ip=10.x.x.34"
- Bind each node to an instance of the VIP:
cm_ctl res --edit --res_name="CM_VIP" --add_inst="res_instance_id=6001,node_id=1" --inst_attr="base_ip=10.x.x.31"
cm_ctl res --edit --res_name="CM_VIP" --add_inst="res_instance_id=6002,node_id=2" --inst_attr="base_ip=10.x.x.35"
- Set CM parameters for failover (adjust the gateway to your environment):
cm_ctl set --param --server -k "cms_enable_failover_on2nodes=1"
cm_ctl set --param --server -k "cms_network_isolation_timeout=10"
cm_ctl set --param --server -k "cms_enable_db_crash_recovery=1"
cm_ctl set --param --server -k "third_party_gateway_ip=10.x.x.1"
- Restart the database. Afterwards
cm_ctl showandip ashould display the VIP on the primary.
High Availability Validation
Planned Switchover
Run cm_ctl switchover -n 2 -D /data/gbasedb/database/data/dn on the primary. The standby becomes the new primary, and the VIP floats accordingly. Switch back with -n 1.
Automatic Failover
Reboot the current primary node. The standby automatically promotes to Primary; the VIP drifts to the new primary, and the cluster returns to a healthy state.
This process confirms that your GBase 8c high‑availability setup works correctly. The VIP ensures client connections automatically redirect to the current primary, keeping your gbase database available during both planned and unplanned outages.
Top comments (0)