摘要:• TiKV 启动时会预留一块空间用于保护磁盘空间。当磁盘剩余空间小于该预留空间时,TiKV 会限制部分写操作。预留空间形式上分为两个部分:预留空间的 80% 用作磁盘空间不足时的运维操作所需要的额外磁盘空间,剩余的 20% 为磁盘临时文件。在回收空间的过程中,如果额外使用的磁盘空间过多,导致存储耗尽时,该临时文件会成为恢复服务的最后一道防御。• 临时文件名为
2025年09月16日
[TiDB]通过purge-threshold参数配置 Raft Engine 的磁盘空间占用大小
摘要:现象:在/data/tidb/tidb-data/tikv-20160目录下,有一个文件夹占用了大量的空间,进行可以看到以下文件:[root@uat-server-2 raft-engine]# ls0000000000000001.rewrite 0000000000000208.raftlog 0000000000000229.raftlog 0000000000000250.raftlog0000000000000188.raftlog 0000000000000209.raftlog 0000000000000230.raftlog 0000000
分类:DataBase
2025年09月08日
MySQL8.0 prefer_ordering_index参数详解
摘要:MySQL 8.0 中的 prefer_ordering_index 参数是一个重要的优化器开关,用于控制优化器在处理包含 ORDER BY、GROUP BY 或 LIMIT 子句的查询时,是否优先使用有序索引。该参数通过 optimizer_switch 系统变量进行控制。参数详解1. 参数作用prefer_ordering_index 参数用于调整优化器对“排序索引”的偏好。该参数的值可以是 on 或 off,默认值为 on 。开启(默认) :prefer_order
分类:DataBase
2025年09月08日
MySQL8.0-监控数据库锁等待SHELL脚本
摘要:cat innodb_lock_wait_monitor_mysql8.0.sh #!/bin/bashuser="abccc"password="123123"host="192.168.1.100"logfile="/server/shell_scripts/mysql/innodb_lock_timeout_monitor/innodb_lock_timeout_monitor_8.0.log"while truedonum=`mysql -u${user} -p${password} -h${host} -e "select count(*) from sys.innodb_lock_
分类:DataBase
2025年09月08日
MySQL5.7-监控数据库锁等待SHELL脚本
摘要:#!/bin/bashuser="root"password="123.123."logfile="/server/shell_scripts/mysql/innodb_lock_timeout_monitor/innodb_lock_timeout_monitor.log"while truedonum=`mysql -u${user} -p${password} -e "select count(*) from information_schema.innodb_lock_waits" |grep -v count`if [[ $num -gt 0 ]];thendate >> ${logfile
分类:DataBase
2025年09月04日
mysql5.7 dump mysql8.0时报错:WARNING: --master-data is deprecated and will be removed in a future versi
摘要:以下是关于MySQL 8.0中--master-data参数被弃用并建议使用--source-data的详细说明:弃用警告:自MySQL 8.0.26版本起,--master-data参数已被弃用,并将在未来的版本中移除。取而代之的是--source-data参数。使用--master-data时,会收到警告信息:“WARNING: --master-data is deprecated and will be removed in a future version. Use --source-data instead.”。替代参数:
分类:DataBase
2025年09月04日
mysql5.7 dump mysql8.0的数据报错-Warning: column statistics not supported by the server.
摘要:在使用MySQL 5.7版本的mysqldump工具时,经常会遇到警告或错误信息:“Warning: column statistics not supported by the server.” 或者 “Unknown table 'COLUMN_STATISTICS' in information_schema (1109)”。这些问题是由于MySQL 8.0引入了新的COLUMN_STATISTICS表,而某些环境或版本可能不支持该表导致的。以下是详细的分析和解决方法:问题原因新特性启用:MySQL 8.0默认
分类:DataBase
2025年08月26日
[TIDB]-DM数据同步组件配置:单库单表同步MySQL数据
摘要:在dm中创建数据源配置文件:cat mysql-replica-01.yaml# MySQL1 Configuration.source-id: "mysql-replica-01"# DM-worker 是否使用全局事务标识符 (GTID) 拉取 binlog。enable-gtid: truefrom: host: "172.16.76.239" user: "tidb_sync" password: "mysql" # 推荐使用加密后的密码 port: 13306 [
分类:DataBase
2025年08月26日
[TIDB]-DM数据同步组件配置:单库多表同步MySQL数据
摘要:在dm中创建数据源配置文件:cat mysql-replica-01.yaml# MySQL1 Configuration.source-id: "mysql-replica-01"# DM-worker 是否使用全局事务标识符 (GTID) 拉取 binlog。enable-gtid: truefrom: host: "172.16.76.239" user: "tidb_sync" password: "mysql" # 推荐使用加密后的密码 port: 13306 c
分类:DataBase
2025年08月26日
[TIDB]通过TiDB DM组件同步MySQL数据库的数据到TiDB数据库
摘要:TiDB安装安装 (略)DM数据同步组件 (略)操作系统环境:[root@uat-server-2 dm-worker-8262]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core)[root@uat-server-2 dm-worker-8262]# uname -aLinux uat-server-2 3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed Feb 23 16:47:03 UTC 2022 x86_64 x86_64 x86_64 GNU/LinuxMySQL数据库版本:5.7.28-log MySQL Community S