【 TiDB 使用环境】生产
【 TiDB 版本】V5.4.0
【遇到的问题】使用dumpling从mysql库中导出的几张表结构和数据,想使用tidb-lightning导入到tidb集群中,这两张表已经存在,且有数据,导入的数据想以append追加的方式,导入到tidb集群中的这两张表中。需要做哪些配置呢?
【复现路径】目前的配置如下:
【问题现象及影响】
使用dumpling从mysql库中导出的几张表结构和数据,想使用tidb-lightning导入到tidb集群中,这两张表已经存在,且有数据,导入的数据想以append追加的方式,导入到tidb集群中的这两张表中。需要做哪些配置呢?
我的关键点配置如下:
[[routes]]
schema-pattern = “car”
table-pattern = “es_charge_bill”
target-schema = “car_news”
target-table = “es_charge_bill”
[[routes]]
schema-pattern = “car”
table-pattern = “es_charge_owner_fee”
target-schema = “car_news”
target-table = “es_charge_owner_fee”
±–±-----------------------------------------------------------------------------------------------±------------±-------+
| # | CHECK ITEM | TYPE | PASSED |
±–±-----------------------------------------------------------------------------------------------±------------±-------+
| 1 | Source csv files size is proper | performance | true |
±–±-----------------------------------------------------------------------------------------------±------------±-------+
| 2 | checkpoints are valid | critical | true |
±–±-----------------------------------------------------------------------------------------------±------------±-------+
3 | table schemas are valid | critical | true |
±–±-----------------------------------------------------------------------------------------------±------------±-------+
| 4 | table(s) [car_news
.es_charge_bill
, car_news
.es_charge_owner_fee
] are not empty | critical | false |
±–±-----------------------------------------------------------------------------------------------±------------±-------+
| 5 | Cluster is available | critical | true |
±–±-----------------------------------------------------------------------------------------------±------------±-------+
| 6 | Lightning has the correct storage permission | critical | true |
±–±-----------------------------------------------------------------------------------------------±------------±-------+
Error: tidb-lightning pre-check failed: table(s) [car_news
.es_charge_bill
, car_news
.es_charge_owner_fee
] are not empty
tidb lightning encountered error: tidb-lightning pre-check failed: table(s) [car_news
.es_charge_bill
, car_news
.es_charge_owner_fee
] are not empty
从日志报错来看,是提示我这两张表不为空,我的这两张表确实里面有数据。我想保留这2张表中的数据的前提下,导入时,以append追加的形式插入新数据到这两张表中。应该如何配置实现呢?
【附件】
- 相关日志、配置文件、Grafana 监控(https://metricstool.pingcap.com/)
- TiUP Cluster Display 信息
- TiUP CLuster Edit config 信息
- TiDB-Overview 监控
- 对应模块的 Grafana 监控(如有 BR、TiDB-binlog、TiCDC 等)
- 对应模块日志(包含问题前后 1 小时日志)
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。