MySQL中Galera cluster集群常用参数有哪些
这篇文章主要介绍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 |
+---------------+-------+
以上是“MySQL中Galera cluster集群常用参数有哪些”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341