首页 > 数据库 >MySQL Galera cluster 集群常用参数说明

MySQL Galera cluster 集群常用参数说明

时间:2023-03-01 22:57:23浏览次数:57  
标签:Galera status like show wsrep Value cluster MySQL local

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

标签:Galera,status,like,show,wsrep,Value,cluster,MySQL,local
From: https://www.cnblogs.com/xiaoqi-home/p/17170199.html

相关文章

  • 【数据库原理及应用MySQL】第一章 数据系统的基本原理
    第一章        数据库系统的基本原理1.1.1数据库系统的应用不做详细介绍 1.1.2数据库系统的概念数据(data):是客观事物的符号标识,是可以被计算机识别,存储和加......
  • mysql 执行function时问题处理
    简单介绍一下,当二进制日志启用后,这个变量就会启用。它控制是否可以信任存储函数创建者,不会创建写入二进制日志引起不安全事件的存储函数。如果设置为0(默认值),用户不得创建或......
  • mysql牛客网实战练习
    1、模糊查询字段名like'匹配内容'_:下划线代表匹配任意一个字符;%:百分号代表匹配0个或多个字符;[]:中括号代表匹配其中的任意一个字符;[^]:^尖冒号代表......
  • mysql隔离级别
    最近在公司项目上遇到一个问题,客户使用某个功能经常出现重复数据,后面经排查,发下这个功能因为设计到递归,而且是一个粒度比较大的事务,操作比较耗时,mysql数据库使用了......
  • MySQL数据库架构&SQL注入漏洞
    查找zblog数据库中有哪些表SELECTTABLE_SCHEMA,TABLE_NAMEFROMinformation_schema.`TABLES`WHERETABLE_SCHEMA='zblog';查找目标表(zbp_category)中的字段SELECT6,COLU......
  • 国产计算机开发实践之环境搭建(Java+Mysql+Idea)
    操作系统:统信UOS/麒麟架构:aarch64(命令行uname-m查看)一、Java1.解压安装包(注:在安装包所在路径下输入命令)sudotar-zxvfjdk-8u271-linux-aarch64.tar.gz-C/usr/loca......
  • yum卸载mysql
    查找mysql安装的文件:rpm-qa|grep-imysql卸载查找出的文件:yumremove"文件名"查看是否卸载完成:rpm-qa|grep-imysql查找mysql相......
  • MySQL 查询常用操作(0) —— 查询语句的执行顺序
    MySQL中明确查询语句的执行顺序极其重要,了解执行顺序才不至于犯一些简单错误,例如having后面是否可以使用select中重命名的列名等问题。另外SQL中实际使用最频繁的就是查......
  • 利用python操作数据库MySQL
    一、python操作MySQL的库(包)1.PythonDatabasAPI   Python操作数据库的标准接口为PythonDatabasAPISpecificationV2.0,其定义了在python中操作数据库的方法......
  • 利用python将MySQL数据导出到excel中
    涉及到的相关库:   pymysql、   xlwt库函数(将MySQL一个数据表导出到excel文件的一个表)文件exportexcel.py内容:defexport_to_excel(worksheet,cursor......