# 下面这个参数的显示是初始化数据库显示的情况
MariaDB [(none)]> SHOW VARIABLES LIKE 'wsrep_cluster_address';
+-----------------------+----------+
| Variable_name | Value |
+-----------------------+----------+
| wsrep_cluster_address | gcomm:// |
+-----------------------+----------+
1 row in set (0.00 sec)
# 如果配置了指向集群地址,上面那个参数值,应该是你指定集群的IP地址
MariaDB [kz]> SHOW VARIABLES LIKE 'wsrep_cluster_address';
+-----------------------+----------------------------+
| Variable_name | Value |
+-----------------------+----------------------------+
| wsrep_cluster_address | gcomm://192.168.1.56:4567 |
+-----------------------+----------------------------+
1 row in set (0.00 sec)
# 此参数查看是否开启
MariaDB [kz]> show status like 'wsrep_ready';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wsrep_ready | ON |
+---------------+-------+
1 row in set (0.00 sec)
# 这个查看wsrep的相关参数
MariaDB [terry]> show status like 'wsrep%';
+----------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------+--------------------------------------+
| wsrep_local_state_uuid | bb5b9e17-66c8-11e3-86ba-96854521d205 | uuid 集群唯一标记
| wsrep_protocol_version | 4 |
| wsrep_last_committed | 16 | sql 提交记录
| wsrep_replicated | 4 | 随着复制发出的次数
| wsrep_replicated_bytes | 692 | 数据复制发出的字节数
| wsrep_received | 18 | 数据复制接收次数
| wsrep_received_bytes | 3070 | 数据复制接收的字节数
| wsrep_local_commits | 4 | 本地执行的 sql
| wsrep_local_cert_failures | 0 | 本地失败事务
| wsrep_local_bf_aborts | 0 |从执行事务过程被本地中断
| wsrep_local_replays | 0 |
| wsrep_local_send_queue | 0 | 本地发出的队列
| wsrep_local_send_queue_avg | 0.142857 | 队列平均时间间隔
| wsrep_local_recv_queue | 0 | 本地接收队列
| wsrep_local_recv_queue_avg | 0.000000 | 本地接收时间间隔
| wsrep_flow_control_paused | 0.000000 |
| wsrep_flow_control_sent | 0 |
| wsrep_flow_control_recv | 0 |
| wsrep_cert_deps_distance | 0.000000 | 并发数量
| wsrep_apply_oooe | 0.000000 |
| wsrep_apply_oool | 0.000000 |
| wsrep_apply_window | 1.000000 |
| wsrep_commit_oooe | 0.000000 |
| wsrep_commit_oool | 0.000000 |
| wsrep_commit_window | 1.000000 |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
| wsrep_cert_index_size | 0 |
| wsrep_causal_reads | 0 |
| wsrep_incoming_addresses | 125.208.28.106:3306,192.168.1.81:3306,192.168.1.56:3306 | 连接中的数据库
| wsrep_cluster_conf_id | 18 |
| wsrep_cluster_size | 3 | 集群成员个数
| wsrep_cluster_state_uuid | bb5b9e17-66c8-11e3-86ba-96854521d205 | 集群 ID
| wsrep_cluster_status | Primary | 主服务器
| wsrep_connected | ON | 当前是否连接中
| wsrep_local_index | 1 |
| wsrep_provider_name | Galera |
| wsrep_provider_vendor | Codership Oy |
| wsrep_provider_version | 2.7(rXXXX) |
| wsrep_ready | ON | 插件是否应用中
+----------------------------+--------------------------------------+