AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 48566
Accepted
IanMulvany
IanMulvany
Asked: 2009-08-01 07:14:37 +0800 CST2009-08-01 07:14:37 +0800 CST 2009-08-01 07:14:37 +0800 CST

检查从主服务器复制的 MySQL 从服务器的状态的最佳方法是什么?

  • 772

具体来说,我有一组 InnoDB 表,我们将它们备份到 MyISAM 表中以提供全文搜索。从属数据库通常落后于主数据库。我正在寻找有关可用于跟踪滞后的诊断或命令的建议。两台机器都在同一个网络上。非常感谢。

mysql replication innodb myisam
  • 2 2 个回答
  • 919 Views

2 个回答

  • Voted
  1. Best Answer
    Jorge Bernal
    2009-08-01T07:25:53+08:002009-08-01T07:25:53+08:00

    SHOW SLAVE STATUS是你的命令

    mysql> SHOW SLAVE STATUS\G
    *************************** 1. row ***************************
                   Slave_IO_State: Waiting for master to send event
                      Master_Host: localhost
                      Master_User: root
                      Master_Port: 3306
                    Connect_Retry: 3
                  Master_Log_File: gbichot-bin.005
              Read_Master_Log_Pos: 79
                   Relay_Log_File: gbichot-relay-bin.005
                    Relay_Log_Pos: 548
            Relay_Master_Log_File: gbichot-bin.005
                 Slave_IO_Running: Yes
                Slave_SQL_Running: Yes
                  Replicate_Do_DB:
              Replicate_Ignore_DB:
                       Last_Errno: 0
                       Last_Error:
                     Skip_Counter: 0
              Exec_Master_Log_Pos: 79
                  Relay_Log_Space: 552
                  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: 8
    Master_SSL_Verify_Server_Cert: No
                    Last_IO_Errno: 0
                    Last_IO_Error:
                   Last_SQL_Errno: 0
                   Last_SQL_Error:
      Replicate_Ignore_Server_Ids: 0
    

    相关部分是:

                   Slave_IO_State: Waiting for master to send event
    

    “等主人……”是你平时最想看到的

                  Master_Log_File: gbichot-bin.005
              Read_Master_Log_Pos: 79
              Exec_Master_Log_Pos: 79
    

    这与主服务器上的“SHOW MASTER STATUS”相结合,可让您比较已传输和正确复制的数量

                 Slave_IO_Running: Yes
                Slave_SQL_Running: Yes
    

    复制是否正在运行?

            Seconds_Behind_Master: 8
    

    滞后估计

                    Last_IO_Errno: 0
                    Last_IO_Error:
                   Last_SQL_Errno: 0
                   Last_SQL_Error:
    

    如果有错误,这表明出了什么问题。还要检查您的错误日志和 SHOW PROCESSLIST 以获取更多信息

    • 8
  2. alexus
    2009-08-01T08:23:49+08:002009-08-01T08:23:49+08:00

    nagios 的插件可以做到这一点

    -bash-3.2# ~nagios/libexec/check_mysql -h | grep 检查从站
     -S, --check-slave
    -bash-3.2#
    
    • 2

相关问题

  • 您如何跟踪和调试 mySQL 性能问题?

  • 在 Linux Xen VPS 上优化 Apache 和 MySQL

  • 如何选择 MySQL 数据库引擎

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    Windows 中执行反向 DNS 查找的命令行实用程序是什么?

    • 14 个回答
  • Marko Smith

    如何检查 Windows 机器上的端口是否被阻塞?

    • 4 个回答
  • Marko Smith

    我应该打开哪个端口以允许远程桌面?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    kch 如何更改我的私钥密码? 2009-08-06 21:37:57 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve