DEV Community

Michael
Michael

Posted on • Originally published at gbase.cn

Online Switch Between READONLY and NORMAL Mode in GBase 8a

During maintenance tasks like backup or inspection, you often need to switch a gbase database cluster to READONLY mode and back to NORMAL afterwards. This post shows how to perform the switch online with gcadmin — no downtime required.

Tools and Prerequisites

  • Tool: gcadmin, located on any Coordinator node.
  • User: Must be the cluster installation user (default gbase).
  • Pre‑check: Ensure gcware services are running (gcware_services status).
  • Scope: The mode change applies cluster‑wide; no need to repeat per node.

Step‑by‑Step (READONLY → NORMAL)

Step 1: Check the Current Mode

# Cluster‑wide
gcadmin showcluster

# Specific VC in a multi‑VC environment
gcadmin showcluster vc vc1
Enter fullscreen mode Exit fullscreen mode

Look at the VIRTUAL CLUSTER MODE field. Proceed only if it shows READONLY.

Step 2: Switch to Normal Read/Write Mode

# Single VC or whole cluster
gcadmin switchmode normal

# Specific VC
gcadmin switchmode normal vc vc1
Enter fullscreen mode Exit fullscreen mode

The switch takes effect in seconds. The cluster synchronises the new mode to all nodes automatically — no process restart is needed.

Step 3: Verify the Change

Run gcadmin showcluster again. When VIRTUAL CLUSTER MODE shows NORMAL, the cluster is fully writable again.

Production Notes

  • Business impact: An online switch does not interrupt running read queries. Pending write operations queued during READONLY mode are executed automatically after the switch.
  • Node to run on: Any single Coordinator node is enough.
  • Privileges: Only the gbase user can switch modes.
  • Reverse switch: To return to read‑only mode, use gcadmin switchmode readonly [vc vc_name].
  • Troubleshooting: If the command fails, check gcware service health and node status first, then retry.

Companion Commands

# Check all cluster processes
gcluster_services all info
gcware_services all info

# View detailed VC information
gcadmin showvc
Enter fullscreen mode Exit fullscreen mode

The mode‑switch mechanism in GBase 8a is built for high availability. Following the "verify → switch → re‑verify" workflow lets you change cluster modes safely and transparently in a gbase database.

Top comments (0)