show master status
只有在主库上执行才能有效抵输出:



具体文档如下:
# 在127.0.0.:3306主库上执行 tmp@127.0.0.1 ((none))> show variables like '%server%';
+---------------------------------+--------------------------------------+
| Variable_name | Value |
+---------------------------------+--------------------------------------+
| character_set_server | utf8mb4 |
| collation_server | utf8mb4_general_ci |
| innodb_ft_server_stopword_table | |
| server_id | |
| server_id_bits | |
| server_uuid | ceabbacf-0c77-11ea-b49f-2016d8c96b46 |
+---------------------------------+--------------------------------------+
rows in set (0.01 sec)
# 根据show variables like '%server_uuid%';
# 可以获得当前mysql实例的server_uuid值 tmp@127.0.0.1 ((none))> show master status\G;
*************************** . row ***************************
File: mysql-bin.
Position:
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: 108cc4a4-0d40-11ea--2016d8c96b66:-,
c42216ad-0d37-11ea-b163-2016d8c96b56:-,
ceabbacf-0c77-11ea-b49f-2016d8c96b46:-
row in set (0.00 sec) ERROR:
No query specified tmp@127.0.0.1 ((none))> # 根据主库上执行show master status\G;
# Executed_Gtid_Set值表明:每个server_uuid代表一个实例,有多个server_uuid表明这三个实例都曾经当过主库,分别执行的事务个数都确定。在ceabbacf-0c77-11ea-b49f-2016d8c96b46实例上执行了1662590个事务,在c42216ad-0d37-11ea-b163-2016d8c96b56实例上执行了9个事务,在108cc4a4-0d40-11ea--2016d8c96b66实例上执行了5个事务,但是并不知道这些实例之间事务执行的先后顺序,当然同一个实例上的事务肯定是从1开始递增,步长为1.结合该实例上的server_uuid可知道,当前主库实例执行到了ceabbacf-0c77-11ea-b49f-2016d8c96b46:-1662590这个位置上了。 # 根据File: mysql-bin.000013和Position: 269728976可知:当前写的二进制日志文件名称和位置是mysql-bin.:,在文件mysql-bin.000013中有“end_log_pos ”的地方就是这个位置,如下就是截取了mysql-bin.000013日志最后一部分内容: # at
# :: server id end_log_pos GTID last_committed= sequence_number= rbr_only=yes
/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
SET @@SESSION.GTID_NEXT= 'ceabbacf-0c77-11ea-b49f-2016d8c96b46:1662590'/*!*/;
# at
# :: server id end_log_pos Query thread_id= exec_time= error_code=
SET TIMESTAMP=/*!*/;
BEGIN
/*!*/;
# at
# :: server id end_log_pos Rows_query
# update table_name set name='' where id=
# at
# :: server id end_log_pos Table_map: `apple`.`table_name` mapped to number
# at
# :: server id end_log_pos Update_rows: table id flags: STMT_END_F
### UPDATE `apple`.`table_name`
### WHERE
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### @='' /* VARSTRING(1020) meta=1020 nullable=1 is_null=0 */
### SET
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### @='' /* VARSTRING(1020) meta=1020 nullable=1 is_null=0 */
# at
# :: server id end_log_pos Xid =
COMMIT/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
show master status的更多相关文章
- show master status, show slave status中的Executed_Gtid_Set
slave 如果server是slave节点,在server上执行show master staus与show slave status显示的Executed_Gtid_Set是一样的. slave也 ...
- mysql show master status为空值
问题 执行show master status,输出结果为空: mysql> show master status; Empty set (0.00 sec) 原因 mysql没有开启日志. 查 ...
- c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - prepare to find start position just show master status
2018-12-27 08:39:49.808 [destination = example , address = /127.0.0.1:3308 , EventParser] WARN c.a.o ...
- show master status empty解决方案
The following MySQL error might occur if you are using MySQL replication and binary logs. mysql> ...
- show master/slave status求根溯源
show master/slave status分别是查看主数据库以及副数据库的状态,是一种能查看主从复制运行情况的方式. 这里仅仅讨论linux下的nysql5.7.13版本的执行情况 一.show ...
- MySQL show master / slave status 命令参数
一.show master status 二.show slave status Slave_IO_State SHOW PROCESSLIST输出的State字段的拷贝.SHOW PROCESSLI ...
- Windows下搭建MySQL Master Slave
一.背景 服务器上放了很多MySQL数据库,为了安全,现在需要做Master/Slave方案,因为操作系统是Window的,所以没有办法使用keepalived这个HA工具,但是我们可以接受人工进行切 ...
- Slave作为其它Slave的Master时使用
主从配置需要注意的点 (1)主从服务器操作系统版本和位数一致: (2) Master和Slave数据库的版本要一致: (3) Master和Slave数据库中的数据要一致: (4) Master开启二 ...
- mysql slave to master
1, 在maste A上面创建专门用于备份的用户Bshow master statusget log_file and log_pos 2,CHANGE MASTER TO MASTER_HOST=' ...
随机推荐
- Python-爬虫-爬取知乎的标题和当页显示的文字
# coding:utf-8 import requests from bs4 import BeautifulSoup quesNumStr = str(input("请输入搜索关键字:& ...
- day26-多态、封装、反射
#!/usr/bin/env python # -*- coding:utf-8 -*- # ----------------------------------------------------- ...
- Spring Boot Server容器配置
参数配置容器 server.xx开头的是所有servlet容器通用的配置,server.tomcat.xx开头的是tomcat特有的参数,其它类似. 所有参数绑定配置类:org.springframe ...
- 7_API调用
0 查看 kifastcallentry 里面具体怎么调用 首先是 切换了 fs 为kpcr的选择子 然后 构造了 一个trap frame(保存3环-->0环 切换的上下文:如果0环不使用就没 ...
- axios调用接口
axios调用接口 1. 按照axiosnpm install --save-dev axios2.在main.js 引入axios, 设置全局属性$http 指向axios main.js impo ...
- PHP Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct()
laravel 项目的根目录下 运行composer update之后,报了包含 PHP Catchable fatal error: Argument 2 passed to Illuminate\ ...
- python实现操作excel,数据写入excel的一行或者一列
# _*_ coding:utf-8 _*_ import random import xlwt,string class ImportData(object): def create_num(sel ...
- css----7渐变
linear-gradient(90deg,red 10%,yellow 20%,green 30%) <!DOCTYPE html> <html> <head> ...
- openwrt xfrp移植
对开源软件表示支持 https://github.com/KunTengRom/xfrp 上传编译,选择 cp .config xxx make 刷机 客户端配置文件: /tmp/etc# cat x ...
- LR调试脚本的时候报错Error -27796:(已解决)
LR调试bbs脚本的时候报错: 1.Error -27796: Failed to connect to server "192.168.211.128:80": [10060] ...