MySQL Galera cluster集群常用参数说明
1、wsrep_local_state_uuid:
与集群的wsrep_cluster_state_uuid一致
root@[(none)]> show status like '%wsrep_%_state_uuid%';
+--------------------------+--------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------+
| wsrep_local_state_uuid | eebe303f-5262-11e8-9e80-8a8d79151541 |
| wsrep_cluster_state_uuid | eebe303f-5262-11e8-9e80-8a8d79151541 |
+--------------------------+--------------------------------------+
2、wsrep_last_committed:
集群已经提交事务数目,是一个累计值,所有节点应该相等,如果出现不一致,说明事务有延迟,可以用来计算延迟。
root@[(none)]> show status like '%wsrep_last_committed%';
+----------------------+--------+
| Variable_name | Value |
+----------------------+--------+
| wsrep_last_committed | 115562 |
+----------------------+--------+
3、wsrep_replicated:
从本地节点复制出去的写集(write set)数目,wsrep_replicated_bytes为写集的总字节数;可以用于参考节点之间的负载均衡是否平衡;该值较大的节点较为繁忙。
root@[(none)]> show status like '%wsrep_replicated%';
+------------------------+----------+
| Variable_name | Value |
+------------------------+----------+
| wsrep_replicated | 13579 |
| wsrep_replicated_bytes | 35585864 |
+------------------------+----------+
4、wsrep_received:
与wsrep_replicated对应,表示接收来自其他节点的写集(write set)数目.
root@[(none)]> show status like '%wsrep_received%';
+----------------------+----------+
| Variable_name | Value |
+----------------------+----------+
| wsrep_received | 11036 |
| wsrep_received_bytes | 35576367 |
+----------------------+----------+
5、wsrep_local_commits:
从本地节点发出的写集(write set)被提交的数目,不超过wsrep_replicated的数目。
root@[(none)]> show status like '%wsrep_local_commits%';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| wsrep_local_commits | 13582 |
+---------------------+-------+
6、wsrep_local_cert_failures:
同步过程中节点认证失败计数,冲突来自本地提交的事务和同步队列中事务存在锁冲突,则本地验证失败(保证全局数据一致性)。
root@[(none)]> show status like '%wsrep_local_cert_failures%';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| wsrep_local_cert_failures | 0 |
+---------------------------+-------+
7、wsrep_local_bf_aborts:
强制放弃的写集数目,本地事务和同步队列中正在执行的事务存在锁冲突时,将强制保证先提交的事务成功,后者回滚或报错。
root@[(none)]> show status like '%wsrep_local_bf_aborts%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| wsrep_local_bf_aborts | 1 |
+-----------------------+-------+
8、wsrep_local_send_queue:
发送队列的长度。wsrep_local_send_queue_avg:从上次查询状态到目前发送队列的平均长度,>0.0意味着复制过程被节流了。
root@[(none)]> show status like '%wsrep_local_send_queue%';
+----------------------------+----------+
| Variable_name | Value |
+----------------------------+----------+
| wsrep_local_send_queue | 0 |
| wsrep_local_send_queue_max | 2 |
| wsrep_local_send_queue_min | 0 |
| wsrep_local_send_queue_avg | 0.000145 |
+----------------------------+----------+
9、wsrep_local_recv_queue:
接收队列的长度,与wsrep_local_send_queue对应。
root@[(none)]> show status like '%wsrep_local_send_queue%';
+----------------------------+----------+
| Variable_name | Value |
+----------------------------+----------+
| wsrep_local_send_queue | 0 |
| wsrep_local_send_queue_max | 2 |
| wsrep_local_send_queue_min | 0 |
| wsrep_local_send_queue_avg | 0.000145 |
+----------------------------+----------+
10、wsrep_cert_deps_distance:
可以并行执行的写集(write set)的最大seqno与最小seqno之间的平均差值。
root@[(none)]> show status like '%wsrep_cert_deps_distance%';
+--------------------------+-----------+
| Variable_name | Value |
+--------------------------+-----------+
| wsrep_cert_deps_distance | 33.977434 |
+--------------------------+-----------+
11、wsrep_apply_oooe:
队列中事务并发执行占比,值越高意味着效率越高。
root@[(none)]> show status like '%wsrep_apply_oooe%';
+------------------+----------+
| Variable_name | Value |
+------------------+----------+
| wsrep_apply_oooe | 0.006204 |
+------------------+----------+
12、wsrep_commit_window:
平均并发提交窗口大小。
root@[(none)]> show status like '%wsrep_commit_window%';
+---------------------+----------+
| Variable_name | Value |
+---------------------+----------+
| wsrep_commit_window | 1.000423 |
+---------------------+----------+
13、wsrep_local_state:
节点的状态,取值1-6。
取值1:The node starts and establishes a connection to the Primary Component.
取值2:When the node succeeds with a state transfer request, it begins to cache write-sets.
取值3:The node receives a State Snapshot Transfer. It now has all cluster data and begins to apply the cached write-sets.
Here the node enables Flow Control to ensure an eventual decrease in the slave queue.
取值4:The node finishes catching up with the cluster. Its slave queue is now empty and it enables Flow Control to keep it empty.
The node sets the MySQL status variable wsrep_ready to the value 1. The node is now allowed to process transactions.
取值5:The node receives a state transfer request. Flow Control relaxes to DONOR. The node caches all write-sets it cannot apply.
取值6:The node completes the state transfer to joiner node.
root@[(none)]> show status like '%wsrep_local_state%';
+---------------------------+--------------------------------------+
| Variable_name | Value |
+---------------------------+--------------------------------------+
| wsrep_local_state_uuid | eebe303f-5262-11e8-9e80-8a8d79151541 |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
+---------------------------+--------------------------------------+
14、wsrep_incoming_addresses:
集群中其它节点的地址,多个地址之间用逗号分隔。
root@[(none)]> show status like '%wsrep_incoming_addresses%';
+--------------------------+-------------------------- -+
| Variable_name | Value |
+--------------------------+-------------------------- -+
| wsrep_incoming_addresses | IP1:3306,IP2:3306,IP3:3306 |
+--------------------------+----------------------------+
15、wsrep_cluster_conf_id:
集群节点关系改变的次数(每次增加/删除都会+1)。
root@[(none)]> show status like '%wsrep_cluster_conf_id%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| wsrep_cluster_conf_id | 53 |
+-----------------------+-------+
16、wsrep_cluster_size:集群节点个数。
root@[(none)]> show status like '%wsrep_cluster_size%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 3 |
+--------------------+-------+
17、wsrep_cluster_status:
集群的目前状态,取值:PRIMARY(正常)/NON_PRIMARY(不一致)。
root@[(none)]> show status like '%wsrep_cluster_status';
+----------------------+---------+
| Variable_name | Value |
+----------------------+---------+
| wsrep_cluster_status | Primary |
+----------------------+---------+
18、wsrep_connected:
节点是否连接到集群,取值:ON/OFF。
root@[(none)]> show status like 'wsrep_connected';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| wsrep_connected | ON |
+-----------------+-------+
19、wsrep_local_index:
节点id,取值从0开始。This node index in the cluster (base 0).
root@[(none)]> show status like 'wsrep_local_index';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| wsrep_local_index | 0 |
+-------------------+-------+
20、wsrep_ready:
节点是否接收查询,即节点是否可正常使用。
root@[(none)]> show status like '%wsrep_ready%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wsrep_ready | ON |
+---------------+-------+
完整详细的参数说明可参考官方文档:http://galeracluster.com/documentation-webpages/galerastatusvariables.html?highlight=wsrep_local_index#wsrep-local-index
参考:https://www.cnblogs.com/study-hj/p/13669253.html