› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
Sor
4.53D
V2EX  ›  MySQL

mysql slave 复制问题

  •  
  •   Sor · Mar 23, 2019 · 5302 views
    This topic created in 2744 days ago, the information mentioned may be changed or developed.

    搭建了个 主从 show slave status; 显示两个 YES, 但是数据就是不同步,Read_Master_log_pos 也不会发生变化

    这是主的日志,从上没有错误日志

    
    2019-03-23T05:36:45.018407Z 40439 [Note] While initializing dump thread for slave with UUID <8d15310a-4d29-11e9-865c-000c2981d89e>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread(39466).
    2019-03-23T05:36:45.018637Z 40439 [Note] Start binlog_dump to master_thread_id(40439) slave_server(2), pos(mysql-bin.000031, 7823661)
    2019-03-23T05:38:36.545521Z 38520 [Note] Aborted connection 38520 to db: 'unconnected' user: 'repl' host: '10.0.0.8' (Failed on my_net_write())
    
    

    主 show processlist; 状态一直会显示 Sending to client

    44547	repl	10.0.0.8:1696		Binlog Dump	437	Sending to client	
    

    目前两台服务器可以用 mysql -h 互相进入控制台

    Supplement 1  ·  Mar 26, 2019
    @514146235 @aoe2ex 感谢回复,问题刚才解决了,我使用命令 减小了网卡的 MTU 值 1500 => 1400, 瞬间就可以同步了
    4 replies  •  2024-02-20 09:41:15 +08:00
    514146235
        1
    514146235  
       Mar 23, 2019
    mysql 的主从同步好像不是实时吧。有时候延迟挺高的。遇到过几分钟都没有同步的时候。
    Sor
        2
    Sor  
    OP
       Mar 23, 2019
    @514146235 这个问题卡了好几天了,我怀疑就是因为 Failed on my_net_write() 这条错误信息,但是不知道怎么处理才行
    aoe2ex
        3
    aoe2ex  
       Mar 23, 2019
    提示网络原因
    ricky077
        4
    ricky077  
       Feb 20, 2024
    op 这个问题还有印象么?我们也是双 yes 但是不同步,不知道是不是 mysql 资源占用高造成的。临时的解决方法
    1.stop slave
    2.reset slave all
    3.change master 到最后执行的一个节点,或者导出 binlog 跳过 1 、2 个事务(后续手动执行)
    4.start slave
    就恢复这一次主从中断了,但是治标不治本
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2592 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:45 · PVG 19:45 · LAX 04:45 · JFK 07:45
    ♥ Do have faith in what you're doing.