重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2183|回复: 0
打印 上一主题 下一主题

mysql-unit之 mysqlrplcheck在mysql 复制环境中的使用

[复制链接]
跳转到指定楼层
楼主
发表于 2014-11-21 11:53:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
 检查一个主库和一个从库的一致性。
[root@mysqldb ~]# mysqlrplcheck --master=root:123@127.0.0.1:3307 --slave=root:123@127.0.0.1:3308;
WARNING: Using a password on the command line interface can be insecure.
# master on 127.0.0.1: ... connected.
# slave on 127.0.0.1: ... connected.
Test Description                                                     Status
---------------------------------------------------------------------------
Checking for binary logging on master                                [pass]
Are there binlog exceptions?                                         [pass]
Replication user exists?                                             [pass]
Checking server_id values                                            [pass]
Checking server_uuid values                                          [pass]
Is slave connected to master?                                        [pass]
Check master information file                                        [pass]
Checking InnoDB compatibility                                        [pass]
Checking storage engines compatibility                               [pass]
Checking lower_case_table_names settings                             [pass]
Checking slave delay (seconds behind master)                         [pass]
# ...done.
[root@mysqldb ~]#


检查主从库的一致性,并且显示主库从库的信息。
[root@mysqldb ~]# mysqlrplcheck --master=root:123@127.0.0.1:3307 --slave=root:123@127.0.0.1:3308 --show-slave-status -vv;
WARNING: Using a password on the command line interface can be insecure.
# master on 127.0.0.1: ... connected.
# slave on 127.0.0.1: ... connected.
Test Description                                                     Status
---------------------------------------------------------------------------
Checking for binary logging on master                                [pass]
Are there binlog exceptions?                                         [pass]
Replication user exists?                                             [pass]
Checking server_id values                                            [pass]

 master id = 1
  slave id = 2

Checking server_uuid values                                          [pass]

 master uuid = 2d5f5c23-70bd-11e4-80ee-000c2947db3a
  slave uuid = 33b5d89c-70bd-11e4-80ee-000c2947db3a

Is slave connected to master?                                        [pass]
Check master information file                                        [pass]

#
# Master information file:
#
               Master_Log_File : mysql1db-bin.000004
           Read_Master_Log_Pos : 191
                   Master_Host : 127.0.0.1
                   Master_User : salve
               Master_Password : 123
                   Master_Port : 3307
                 Connect_Retry : 60
            Master_SSL_Allowed : 0
            Master_SSL_CA_File :
            Master_SSL_CA_Path :
               Master_SSL_Cert :
             Master_SSL_Cipher :
                Master_SSL_Key :
 Master_SSL_Verify_Server_Cert : 0
                     Heartbeat : 1800
                          Bind :
            Ignored_server_ids : 0
                          Uuid : 2d5f5c23-70bd-11e4-80ee-000c2947db3a
                   Retry_count : 86400
                       SSL_CRL :
                  SSL_CRL_Path :
         Enabled_auto_position : 1

Checking InnoDB compatibility                                        [pass]
Checking storage engines compatibility                               [pass]
Checking lower_case_table_names settings                             [pass]

  Master lower_case_table_names: 0
   Slave lower_case_table_names: 0

Checking slave delay (seconds behind master)                         [pass]

#
# Slave status:
#
                Slave_IO_State : Waiting for master to send event
                   Master_Host : 127.0.0.1
                   Master_User : salve
                   Master_Port : 3307
                 Connect_Retry : 60
               Master_Log_File : mysql1db-bin.000004
           Read_Master_Log_Pos : 191
                Relay_Log_File : mysql2db-relay-bin.000009
                 Relay_Log_Pos : 407
         Relay_Master_Log_File : mysql1db-bin.000004
              Slave_IO_Running : Yes
             Slave_SQL_Running : Yes
               Replicate_Do_DB :
           Replicate_Ignore_DB :
            Replicate_Do_Table :
        Replicate_Ignore_Table :
       Replicate_Wild_Do_Table :
   Replicate_Wild_Ignore_Table :
                    Last_Errno : 0
                    Last_Error :
                  Skip_Counter : 0
           Exec_Master_Log_Pos : 191
               Relay_Log_Space : 583
               Until_Condition : None
                Until_Log_File :
                 Until_Log_Pos : 0
            Master_SSL_Allowed : No
            Master_SSL_CA_File :
            Master_SSL_CA_Path :
               Master_SSL_Cert :
             Master_SSL_Cipher :
                Master_SSL_Key :
         Seconds_Behind_Master : 0
 Master_SSL_Verify_Server_Cert : No
                 Last_IO_Errno : 0
                 Last_IO_Error :
                Last_SQL_Errno : 0
                Last_SQL_Error :
   Replicate_Ignore_Server_Ids :
              Master_Server_Id : 1
                   Master_UUID : 2d5f5c23-70bd-11e4-80ee-000c2947db3a
              Master_Info_File : mysql.slave_master_info
                     SQL_Delay : 0
           SQL_Remaining_Delay : None
       Slave_SQL_Running_State : Slave has read all relay log; waiting for the slave I/O thread to update it
            Master_Retry_Count : 86400
                   Master_Bind :
       Last_IO_Error_Timestamp :
      Last_SQL_Error_Timestamp :
                Master_SSL_Crl :
            Master_SSL_Crlpath :
            Retrieved_Gtid_Set : 2d5f5c23-70bd-11e4-80ee-000c2947db3a:1-6
             Executed_Gtid_Set : 2d5f5c23-70bd-11e4-80ee-000c2947db3a:1-6,
33b5d89c-70bd-11e4-80ee-000c2947db3a:1
                 Auto_Position : 1
# ...done.
[root@mysqldb ~]#


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-29 00:03 , Processed in 0.093352 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表