Create a standby instance
This topic describes how to use OBD to create a one-primary, one-standby seekdb V1.4.0 environment.
Prerequisites
- Use an OBD version and plugin that explicitly support seekdb V1.4.0.
- The primary is managed by OBD and is running normally. To bring a primary that was not deployed by OBD under OBD management, first run
obd seekdb takeover <deployment_name>. - The RPC ports of the primary and standby are mutually reachable, and
enable_rpc_service=trueis set on both instances. - Configure sufficient
memory_budget, data disk space, and log disk space for both instances. In primary/standby mode, OBD configureslog_disk_sizeto three timesmemory_budget. - If RPC TLS is enabled, configure certificates issued by the same CA on both instances before startup.
Create the primary
Run the following command to start the interactive installation workflow for a primary:
obd seekdb install --primary
Follow the prompts to configure the SQL, RPC, and OBShell ports, as well as the data and redo directories. After installation, run:
obd seekdb display <primary_deployment_name>
Verify that the instance version is 1.4.0.0 and its status is running.
Create the standby
Run the following command to start the interactive installation workflow for a standby:
obd seekdb install --standby
In the interactive interface, select the primary created in the previous step and assign different data and redo directories and ports to the standby. If RPC is not enabled on the primary, OBD prompts you to update its configuration and restart it. The restart interrupts existing connections, so schedule a maintenance window in advance.
After installation, display the standby deployment:
obd seekdb display <standby_deployment_name>
Verify the primary and standby
Connect to the primary and standby separately, then execute:
SELECT ROLE, SYNC_SCN, READABLE_SCN
FROM oceanbase.V$OB_SERVER_STAT;
The expected ROLE is PRIMARY on the primary and STANDBY on the standby. After writing data to the primary, wait for SYNC_SCN and READABLE_SCN on the standby to advance, and then verify the data with a read-only query on the standby. Use the internal diagnostic method in View instance synchronization status to inspect the pending role and switchover status only when a role change is abnormal.
In V1.4.0, demoting the primary requires restarting the original primary. Until OBD orchestration for this workflow has been verified, do not assume that a single role-switch command automatically stops the original primary, updates its upstream, and restarts it.
For field descriptions, see View instance synchronization status.