gpt4 book ai didi

Mysql 复制落后于 Update_rows_log_event::ha_update_row(-1)

转载 作者:行者123 更新时间:2023-11-30 22:01:16 28 4
gpt4 key购买 nike

我设法(在此处的一些帮助下)设置了从运行 mysql 5.6 (centos 6) 的主服务器到运行 Mariadb 10.1.22 (Centos 7) 的从属服务器的复制。

我现在的问题是,我有另一台服务器具有确切的 mariadb 版本和规范,但它的复制没有 catch ,相反它正在增加。

开始时它落后 48000 秒,几分钟后迅速下降到 46000 秒。之后,它正在稳步增加。 ATM的写入几乎回到了48K秒

Show full processlist; 显示 sql 线程花费长达 8 秒的时间运行 Update_rows_log_event::ha_update_row(-1) 从所有谷歌搜索我找不到它的意思。

MariaDB [(none)]> show full processlist;
+-----+------------------+---------------------------------------+--------------+---------+------+------------------------------------------+-----------------------+----------+
| Id | User | Host | db | Command | Time | State | Info | Progress |
+-----+------------------+---------------------------------------+--------------+---------+------+------------------------------------------+-----------------------+----------+
| 3 | system user | | NULL | Connect | 3640 | Queueing master event to the relay log | NULL | 0.000 |
| 2 | system user | | NULL | Connect | 5 | Update_rows_log_event::ha_update_row(-1) | NULL | 0.000 |

我还发现了一个简单的 UPDATE table SET timestamp = NOW() WHERE static_ip = 'a-valid-ip' AND process_id = '13217' 最多需要 6 秒,而表具有 static_ip和 process_id 列作为 PK,直接执行该命令需要 0.078 秒。

/etc/my.cnf 的内容

[mysqld]
max_allowed_packet = 1G
max_connections = 600
thread_cache_size = 16
query_cache_size = 64M
tmp_table_size= 512M
max_heap_table_size= 512M
wait_timeout=60

#Innodb Settings
innodb_file_per_table=1
innodb_buffer_pool_size = 25G
innodb_log_file_size = 2048M
innodb_flush_log_at_trx_commit = 0
innodb_file_format = Barracuda
innodb_flush_neighbors = 0

#Log

log-error =/var/log/error.log
tmpdir = /dev/shm


#Replication SLAVE

server-id=6
slave-skip-errors=1062

my.cnf 与运行正常的服务器相同,除了 slave-id。

对正在发生的事情有什么建议/帮助吗?

谢谢。

最佳答案

在 mariadb 人员的帮助下,ha_update_rows 不相关,缓慢的原因是机器上的双磁盘故障。

[root@ser3 ~]# dd if=/dev/zero of=/tmp/output conv=fdatasync bs=384k count=1k;
1024+0 records in
1024+0 records out
402653184 bytes (403 MB) copied, 43.1096 s, 9.3 MB/s

这是一个 SSD。

关于Mysql 复制落后于 Update_rows_log_event::ha_update_row(-1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43256936/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com