View instance synchronization status
After you create a standby, you can inspect replication with the virtual table __all_virtual_server_stat.
-
Log in to the standby.
mysql -h$host -P$port -u$user_name -p$password -D$database_nameParameters:
$host: seekdb host IP. Replace with the real IP, or use the local IP or127.0.0.1.$port: seekdb SQL port. Replace with the real port; default is2881unless you changed it at deploy time.$database_name: Database to connect to.$user_name: Login user. Format:username.$password: Account password.
Example:
mysql -h127.0.0.1 -P2881 -uroot -Doceanbase -
Run the following to view synchronization status.
MySQL [(oceanbase)]> select * from __all_virtual_server_stat\GExample result:
*************************** 1. row ***************************
svr_ip: 127.0.0.1
svr_port: 2882
sql_port: 2881
rpc_port: 2882
cpu_capacity: 16
cpu_capacity_max: 16
cpu_assigned: 3
cpu_assigned_max: 3
mem_capacity: 98779558707
mem_assigned: 98779558707
data_disk_capacity: 91247083520
data_disk_in_use: 88080384
data_disk_health_status: NORMAL
data_disk_abnormal_time: 0
log_disk_capacity: 49389779353
log_disk_assigned: 49389779353
log_disk_in_use: 201326592
rpc_cert_expire_time: 0
rpc_tls_enabled: 0
memory_limit: 98779558707
data_disk_allocated: 134217728
data_disk_assigned: NULL
start_service_time: 1773209560972740
create_time: 1773209083832084
role: STANDBY
switchover_status: NORMAL
log_restore_source: xxx.xxx.xxx.xxx:2882
sync_scn: 1773295213139799000
readable_scn: 1773295213139799000
1 row in setMain columns:
Column Meaning Values role Role PRIMARY or STANDBY log_restore_source Log upstream $IP:$RPC_PORT(empty on primary)sync_scn Log sync position Highest log position replicated readable_scn Readable log position Highest position replayed