配置完成开始数据导入一直卡着不动

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:4.0
  • 【问题描述】:

如题:
配置完成开始数据导入一直卡着不动,表创建出来了但都是空表,没有数据。请问是什么原因?
log显示如下:
[2020/07/16 09:10:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=1.3871408928362905] [state=writing] [remaining=95h9m53s]
[2020/07/16 09:15:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.9247540600976548] [state=writing] [remaining=142h44m53s]
[2020/07/16 09:20:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.6935628037375875] [state=writing] [remaining=190h19m53s]
[2020/07/16 09:25:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.5548492485403704] [state=writing] [remaining=237h54m53s]
[2020/07/16 09:30:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.462373705897229] [state=writing] [remaining=285h29m53s]
[2020/07/16 09:35:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.39631991758732854] [state=writing] [remaining=333h4m53s]

  1. 请问具体是什么导入? DM,loader,lightining?
  2. 这个是什么日志的信息? 是否还有其他日志,多谢。

1.用dumping 导出的mysql数据,然后配置lightning导入
./tikv-importer -C tikv-importer.toml
./tidb-lightning -config tidb-lightning.toml

2.lightning导入时,有显示日志信息如下
Verbose debug logs will be written to /tmp/lightning.log.2020-07-16T08.58.49+0800.
上面显示的就是此日志信息

还有一个tikv-importer.log 如下:(IP和端口信息已做处理)
[2020/07/16 09:02:22.361 +08:00] [INFO] [util.rs:398] [“connecting to PD endpoint”] [endpoints=10.1.1.1:1111]
[2020/07/16 09:02:22.361 +08:00] [INFO] [] [“New connected subchannel at 0x7f04c9a743d0 for subchannel 0x7f04c342da00”]
[2020/07/16 09:02:22.362 +08:00] [INFO] [util.rs:398] [“connecting to PD endpoint”] [endpoints=http://10.1.1.1:1111]
[2020/07/16 09:02:22.362 +08:00] [INFO] [] [“New connected subchannel at 0x7f04c9a74430 for subchannel 0x7f04c342da00”]
[2020/07/16 09:02:22.363 +08:00] [INFO] [util.rs:398] [“connecting to PD endpoint”] [endpoints=http://10.1.1.1:1111]
[2020/07/16 09:02:22.363 +08:00] [INFO] [] [“New connected subchannel at 0x7f04c9a74400 for subchannel 0x7f04c342da00”]
[2020/07/16 09:02:22.364 +08:00] [INFO] [util.rs:457] [“connected to PD leader”] [endpoints=http://10.1.1.1:1111]
[2020/07/16 09:02:22.364 +08:00] [INFO] [util.rs:386] [“all PD endpoints are consistent”] [endpoints=“["10.1.1.1:1111"]”]
[2020/07/16 09:02:22.377 +08:00] [INFO] [import.rs:56] [“import engine”] [tag=“[ImportJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:22.377 +08:00] [INFO] [prepare.rs:76] [“split and scatter”] [tag=“[PrepareJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:22.377 +08:00] [INFO] [prepare.rs:80] [“get size properties”] [size=392886126] [tag=“[PrepareJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:22.377 +08:00] [INFO] [prepare.rs:138] [“scatter all regions finished”] [takes=444ns] [tag=“[PrepareJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:22.377 +08:00] [INFO] [prepare.rs:94] [“split and scatter completed”] [takes=273.902µs] [ranges=0] [tag=“[PrepareJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:22.377 +08:00] [INFO] [import.rs:194] [“run import threads”] [num_import_jobs=24] [tag=“[ImportJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:31.668 +08:00] [INFO] [import.rs:168] [“dump sst completed”] [sst=“[LazySSTInfo { file_path: "/tidb/data.import/325e369a-f57e-5a2b-8f74-04ad551270a9/.d7fffa7b-20de-4c00-960a-185a3fe965b9:write", file_size: 29427139, range: Range { start: [116, 128, 0, 0, 0, 0, 0, 0, 255, 64, 95, 105, 128, 0, 0, 0, 0, 255, 0, 0, 1, 3, 128, 0, 0, 0, 255, 1, 52, 22, 6, 3, 128, 0, 0, 255, 0, 0, 0, 0, 1, 0, 0, 0, 252, 255, 255, 255, 255, 160, 240, 89, 62], end: [116, 128, 0, 0, 0, 0, 0, 0, 255, 64, 95, 105, 128, 0, 0, 0, 0, 255, 0, 0, 3, 3, 128, 0, 0, 0, 255, 95, 14, 219, 218, 3, 128, 0, 0, 255, 0, 0, 37, 1, 132, 0, 0, 0, 252, 255, 255, 255, 255, 160, 240, 89, 62] }, cf_name: "write" }]”] [range={7480000000000000FF405F698000000000FF0000010380000000FF0134160603800000FF0000000001000000FCFFFFFFFFA0F0593E…}] [takes=9.242s]
[2020/07/16 09:02:31.669 +08:00] [INFO] [import.rs:182] [“dispatch-job done”] [ranges_handled=1] [id=0] [tag=“[ImportJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:31.681 +08:00] [INFO] [import.rs:320] [“import sst”] [sst=“SSTFile { uuid: b39723a5-1329-4080-8a27-7481949b4322, range: 7480000000000000FF405F698000000000FF0000{010380000000FF0134160603800000FF0000000001000000FCFFFFFFFFA0F0593E…030380000000FF5F0EDBDA03800000FF0000250184000000FCFFFFFFFFA0F0593E}, length: 29427139, cf_name: "write" }”] [tag=“[ImportSSTJob 325e369a-f57e-5a2b-8f74-04ad551270a9:0:1]”]
[2020/07/16 09:02:31.684 +08:00] [INFO] [import.rs:363] [“upload and ingest sst”] [region=“RegionInfo { region: Region { id: 29844, range: 7480000000000000FF40{00000000000000F8…5F728000000000FF0573590000000000FA}, region_epoch: RegionEpoch { conf_ver: 5, version: 78 }, peers: [Peer { id: 29845, store_id: 1, is_learner: false }, Peer { id: 29846, store_id: 5, is_learner: false }, Peer { id: 29847, store_id: 4, is_learner: false }] }, leader: Some(Peer { id: 29846, store_id: 5, is_learner: false }) }”] [tag=“[ImportSSTJob 325e369a-f57e-5a2b-8f74-04ad551270a9:0:1]”]
[2020/07/16 09:02:31.686 +08:00] [INFO] [] [“New connected subchannel at 0x7f0235467150 for subchannel 0x7ef7b9a0c380”]
[2020/07/16 09:02:31.792 +08:00] [INFO] [] [“New connected subchannel at 0x7ef7b9a2d630 for subchannel 0x7ef7b9a0c700”]
[2020/07/16 09:02:31.896 +08:00] [INFO] [] [“New connected subchannel at 0x7ef7b9a2d8d0 for subchannel 0x7ef7b9a0ca80”]
[2020/07/16 09:02:32.006 +08:00] [INFO] [import.rs:478] [“ingest completed”] [region_id=29844] [store=5] [takes=7.622375ms] [tag=“[ImportSSTJob 325e369a-f57e-5a2b-8f74-04ad551270a9:0:1]”]
[2020/07/16 09:02:32.006 +08:00] [INFO] [import.rs:346] [“import sst completed”] [takes=325.60607ms] [tag=“[ImportSSTJob 325e369a-f57e-5a2b-8f74-04ad551270a9:0:1]”]
[2020/07/16 09:02:32.006 +08:00] [INFO] [engine.rs:220] [“cleanup SST completed”] [file_path=“"/tidb/data.import/325e369a-f57e-5a2b-8f74-04ad551270a9/.d7fffa7b-20de-4c00-960a-185a3fe965b9:write"”]
[2020/07/16 09:02:32.007 +08:00] [INFO] [import.rs:99] [“import engine completed”] [takes=9.630572423s] [tag=“[ImportJob 325e369a-f57e-5a2b-8f74-04ad551270a9]”]
[2020/07/16 09:02:32.007 +08:00] [INFO] [kv_importer.rs:145] [“import completed”] [uuid=325e369a-f57e-5a2b-8f74-04ad551270a9]
[2020/07/16 09:02:32.024 +08:00] [INFO] [kv_importer.rs:179] [“cleanup completed”] [uuid=325e369a-f57e-5a2b-8f74-04ad551270a9]

  1. 请问dumpling 导出的数据量有多少?
  2. 这里的日志有循环打印吗? 是否有进展,还是说日志停在这里不打印了?方便上传完整的日志吗?多谢。

1.dumping 导出的数据量在200G左右。
2.日志到这里不动了, 并没有循环打印。

能否也提供下 lightning 和 importer 的配置

    # TiKV Importer 配置文件模版

# 日志文件。
log-file = "tikv-importer.log"
# 日志等级:trace、debug、info、warn、error、off。
log-level = "info"

[server]
# tikv-importer 监听的地址,tidb-lightning 需要连到这个地址进行数据写入。
addr = "xxx.xxx.xxx.xxx:6287"

[metric]
# 给 Prometheus 客户端的推送任务名称。
job = "tikv-importer"
# 给 Prometheus 客户端的推送间隔。
interval = "15s"
# Prometheus Pushgateway 地址。
address = ""

[import]
# 存储引擎文档 (engine file) 的文件夹路径。
import-dir = "/tidb/data.import/"

    # TiKV lightning配置文件模版
[lightning]
# 转换数据的并发数,默认为逻辑 CPU 数量,不需要配置。
# 混合部署的情况下可以配置为逻辑 CPU 的 75% 大小。
# region-concurrency =

# 日志
level = "info"
file = "tidb-lightning.log"

[tikv-importer]
# tikv-importer 的监听地址,需改成 tikv-importer 服务器的实际地址。
addr = "xxx.xxx.xxx.xxx:6287"

[mydumper]
# Mydumper 源数据目录。
data-source-dir = "/tidb/backup"

[tidb]
# 目标集群的信息。tidb-server 的监听地址,填一个即可。
host = "xxx.xxx.xxx.xxx"
port = xxx
user = "xxx"
password = "xxx"
# 表架构信息在从 TiDB 的“状态端口”获取。
status-port = 5121

感谢回复,我们再查看下,尽快答复,多谢。

看lightning已经把数据传过去了,麻烦 lightning 打开一下 debug 日志,运行一段时间,然后上传一下 lightning 和 importer 的日志把

能否方便提供一下 这个日志文件里面的内容

/tmp/lightning.log.2020-07-16T08.58.49+0800
(只截取了后半部分的日志 )
等待了大约30分钟,没有反应后,ctrl+c强行中止

[2020/07/16 09:00:48.275 +08:00] [INFO] [restore.go:301] [“restore table schema completed”] [db=test] [takeTime=277.497181ms] []
[2020/07/16 09:00:49.244 +08:00] [INFO] [restore.go:575] [“restore all tables data start”]
[2020/07/16 09:00:49.245 +08:00] [INFO] [restore.go:596] [“restore table start”] [table=cap_record_db.record_down]
[2020/07/16 09:00:49.245 +08:00] [INFO] [restore.go:596] [“restore table start”] [table=cap_record_db.record_down_files]
[2020/07/16 09:00:49.245 +08:00] [INFO] [restore.go:1261] [“load engines and files start”] [table=cap_record_db.record_down]
[2020/07/16 09:00:49.245 +08:00] [INFO] [restore.go:1261] [“load engines and files start”] [table=cap_record_db.record_down_files]
[2020/07/16 09:00:49.245 +08:00] [INFO] [restore.go:1290] [“load engines and files completed”] [table=cap_record_db.record_down] [enginesCnt=2] [filesCnt=1] [takeTime=15.292µs] []
[2020/07/16 09:00:49.245 +08:00] [INFO] [restore.go:1290] [“load engines and files completed”] [table=cap_record_db.record_down_files] [enginesCnt=2] [filesCnt=1] [takeTime=20.871µs] []
[2020/07/16 09:00:49.262 +08:00] [INFO] [backend.go:213] [“open engine”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9]
[2020/07/16 09:00:49.262 +08:00] [INFO] [restore.go:800] [“import whole table start”] [table=cap_record_db.record_down]
[2020/07/16 09:00:49.262 +08:00] [INFO] [restore.go:829] [“restore engine start”] [table=cap_record_db.record_down] [engineNumber=0]
[2020/07/16 09:00:49.262 +08:00] [INFO] [restore.go:906] [“encode kv data and write start”] [table=cap_record_db.record_down] [engineNumber=0]
[2020/07/16 09:00:49.269 +08:00] [INFO] [backend.go:213] [“open engine”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65]
[2020/07/16 09:00:49.269 +08:00] [INFO] [restore.go:800] [“import whole table start”] [table=cap_record_db.record_down_files]
[2020/07/16 09:00:49.269 +08:00] [INFO] [restore.go:829] [“restore engine start”] [table=cap_record_db.record_down_files] [engineNumber=0]
[2020/07/16 09:00:49.269 +08:00] [INFO] [restore.go:906] [“encode kv data and write start”] [table=cap_record_db.record_down_files] [engineNumber=0]
[2020/07/16 09:00:49.275 +08:00] [INFO] [backend.go:213] [“open engine”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029]
[2020/07/16 09:00:49.275 +08:00] [INFO] [restore.go:1737] [“restore file start”] [table=cap_record_db.record_down] [engineNumber=0] [fileIndex=0] [path=/vdncloud/backup/cap_record_db.record_down.0.sql:0]
[2020/07/16 09:00:49.281 +08:00] [INFO] [backend.go:213] [“open engine”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e]
[2020/07/16 09:00:49.281 +08:00] [INFO] [restore.go:1737] [“restore file start”] [table=cap_record_db.record_down_files] [engineNumber=0] [fileIndex=0] [path=/vdncloud/backup/cap_record_db.record_down_files.0.sql:0]
[2020/07/16 09:01:22.066 +08:00] [INFO] [restore.go:1746] [“restore file completed”] [table=cap_record_db.record_down_files] [engineNumber=0] [fileIndex=0] [path=/vdncloud/backup/cap_record_db.record_down_files.0.sql:0] [readDur=7.01366546s] [encodeDur=24.470274041s] [deliverDur=26.207533404s] [checksum="{cksum=8282111285460672050,size=644840226,kvs=11879085}"] [takeTime=32.785322934s] []
[2020/07/16 09:01:22.066 +08:00] [INFO] [restore.go:975] [“encode kv data and write completed”] [table=cap_record_db.record_down_files] [engineNumber=0] [read=2] [written=644840226] [takeTime=32.797545674s] []
[2020/07/16 09:01:22.066 +08:00] [INFO] [backend.go:292] [“engine close start”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e]
[2020/07/16 09:01:26.454 +08:00] [INFO] [backend.go:294] [“engine close completed”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e] [takeTime=4.387564326s] []
[2020/07/16 09:01:26.454 +08:00] [INFO] [restore.go:831] [“restore engine completed”] [table=cap_record_db.record_down_files] [engineNumber=0] [takeTime=37.185240838s] []
[2020/07/16 09:01:26.454 +08:00] [INFO] [restore.go:1350] [“import and cleanup engine start”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e]
[2020/07/16 09:01:26.454 +08:00] [INFO] [backend.go:306] [“import start”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e] [retryCnt=0]
[2020/07/16 09:01:31.428 +08:00] [INFO] [backend.go:309] [“import completed”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e] [retryCnt=0] [takeTime=4.973842263s] []
[2020/07/16 09:01:31.428 +08:00] [INFO] [backend.go:321] [“cleanup start”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e]
[2020/07/16 09:01:31.445 +08:00] [INFO] [backend.go:323] [“cleanup completed”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e] [takeTime=17.298214ms] []
[2020/07/16 09:01:31.445 +08:00] [INFO] [restore.go:1357] [“import and cleanup engine completed”] [engineTag=cap_record_db.record_down_files:0] [engineUUID=4e80455a-9d96-505e-93b9-c93b1a85438e] [takeTime=4.991268014s] []
[2020/07/16 09:01:31.445 +08:00] [INFO] [restore.go:848] [“import whole table completed”] [table=cap_record_db.record_down_files] [takeTime=42.176604021s] []
[2020/07/16 09:01:31.445 +08:00] [INFO] [backend.go:292] [“engine close start”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65]
[2020/07/16 09:01:47.732 +08:00] [INFO] [restore.go:1746] [“restore file completed”] [table=cap_record_db.record_down] [engineNumber=0] [fileIndex=0] [path=/vdncloud/backup/cap_record_db.record_down.0.sql:0] [readDur=16.437776451s] [encodeDur=40.564664045s] [deliverDur=25.804895773s] [checksum="{cksum=232572467004134109,size=892321937,kvs=9700892}"] [takeTime=58.457252702s] []
[2020/07/16 09:01:47.732 +08:00] [INFO] [restore.go:975] [“encode kv data and write completed”] [table=cap_record_db.record_down] [engineNumber=0] [read=2] [written=892321937] [takeTime=58.469843702s] []
[2020/07/16 09:01:47.732 +08:00] [INFO] [backend.go:292] [“engine close start”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029]
[2020/07/16 09:01:52.021 +08:00] [INFO] [backend.go:294] [“engine close completed”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65] [takeTime=20.575570632s] []
[2020/07/16 09:01:52.021 +08:00] [INFO] [restore.go:1350] [“import and cleanup engine start”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65]
[2020/07/16 09:01:52.021 +08:00] [INFO] [backend.go:306] [“import start”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65] [retryCnt=0]
[2020/07/16 09:01:54.292 +08:00] [INFO] [backend.go:294] [“engine close completed”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029] [takeTime=6.55983228s] []
[2020/07/16 09:01:54.292 +08:00] [INFO] [restore.go:831] [“restore engine completed”] [table=cap_record_db.record_down] [engineNumber=0] [takeTime=1m5.029800739s] []
[2020/07/16 09:02:04.581 +08:00] [INFO] [backend.go:309] [“import completed”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65] [retryCnt=0] [takeTime=12.55992825s] []
[2020/07/16 09:02:04.581 +08:00] [INFO] [backend.go:321] [“cleanup start”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65]
[2020/07/16 09:02:04.599 +08:00] [INFO] [backend.go:323] [“cleanup completed”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65] [takeTime=18.326289ms] []
[2020/07/16 09:02:04.599 +08:00] [INFO] [restore.go:1357] [“import and cleanup engine completed”] [engineTag=cap_record_db.record_down_files:-1] [engineUUID=703236b1-5348-56a5-bb9e-79468bf58a65] [takeTime=12.578394408s] []
[2020/07/16 09:02:04.599 +08:00] [INFO] [tidb.go:238] [“alter table auto_increment start”] [table=cap_record_db.record_down_files] [auto_increment=2375837]
[2020/07/16 09:02:04.599 +08:00] [INFO] [restore.go:1350] [“import and cleanup engine start”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029]
[2020/07/16 09:02:04.599 +08:00] [INFO] [backend.go:306] [“import start”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029] [retryCnt=0]
[2020/07/16 09:02:04.674 +08:00] [INFO] [tidb.go:240] [“alter table auto_increment completed”] [table=cap_record_db.record_down_files] [auto_increment=2375837] [takeTime=74.456568ms] []
[2020/07/16 09:02:04.674 +08:00] [INFO] [restore.go:1058] [“local checksum”] [table=cap_record_db.record_down_files] [checksum="{cksum=8282111285460672050,size=644840226,kvs=11879085}"]
[2020/07/16 09:02:04.680 +08:00] [INFO] [restore.go:1424] [“remote checksum start”] [table=cap_record_db.record_down_files]
[2020/07/16 09:02:06.767 +08:00] [INFO] [restore.go:1438] [“remote checksum completed”] [table=cap_record_db.record_down_files] [takeTime=2.087144941s] []
[2020/07/16 09:02:06.771 +08:00] [INFO] [restore.go:1387] [“checksum pass”] [table=cap_record_db.record_down_files] [local="{cksum=8282111285460672050,size=644840226,kvs=11879085}"]
[2020/07/16 09:02:06.771 +08:00] [INFO] [restore.go:1392] [“analyze start”] [table=cap_record_db.record_down_files]
[2020/07/16 09:02:09.697 +08:00] [INFO] [backend.go:309] [“import completed”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029] [retryCnt=0] [takeTime=5.097357548s] []
[2020/07/16 09:02:09.697 +08:00] [INFO] [backend.go:321] [“cleanup start”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029]
[2020/07/16 09:02:09.728 +08:00] [INFO] [backend.go:323] [“cleanup completed”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029] [takeTime=31.331286ms] []
[2020/07/16 09:02:09.728 +08:00] [INFO] [restore.go:1357] [“import and cleanup engine completed”] [engineTag=cap_record_db.record_down:0] [engineUUID=db6f8862-087a-5e51-b5ae-31bc13c27029] [takeTime=5.128861372s] []
[2020/07/16 09:02:09.728 +08:00] [INFO] [restore.go:848] [“import whole table completed”] [table=cap_record_db.record_down] [takeTime=1m20.465938207s] []
[2020/07/16 09:02:09.728 +08:00] [INFO] [backend.go:292] [“engine close start”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9]
[2020/07/16 09:02:22.360 +08:00] [INFO] [backend.go:294] [“engine close completed”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9] [takeTime=12.631864643s] []
[2020/07/16 09:02:22.360 +08:00] [INFO] [restore.go:1350] [“import and cleanup engine start”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9]
[2020/07/16 09:02:22.360 +08:00] [INFO] [backend.go:306] [“import start”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9] [retryCnt=0]
[2020/07/16 09:02:32.011 +08:00] [INFO] [backend.go:309] [“import completed”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9] [retryCnt=0] [takeTime=9.650211891s] []
[2020/07/16 09:02:32.011 +08:00] [INFO] [backend.go:321] [“cleanup start”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9]
[2020/07/16 09:02:32.024 +08:00] [INFO] [backend.go:323] [“cleanup completed”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9] [takeTime=13.408329ms] []
[2020/07/16 09:02:32.024 +08:00] [INFO] [restore.go:1357] [“import and cleanup engine completed”] [engineTag=cap_record_db.record_down:-1] [engineUUID=325e369a-f57e-5a2b-8f74-04ad551270a9] [takeTime=9.66376535s] []
[2020/07/16 09:02:32.024 +08:00] [INFO] [tidb.go:238] [“alter table auto_increment start”] [table=cap_record_db.record_down] [auto_increment=2425225]
[2020/07/16 09:02:32.097 +08:00] [INFO] [tidb.go:240] [“alter table auto_increment completed”] [table=cap_record_db.record_down] [auto_increment=2425225] [takeTime=73.279639ms] []
[2020/07/16 09:02:32.098 +08:00] [INFO] [restore.go:1058] [“local checksum”] [table=cap_record_db.record_down] [checksum="{cksum=232572467004134109,size=892321937,kvs=9700892}"]
[2020/07/16 09:02:32.102 +08:00] [INFO] [restore.go:1424] [“remote checksum start”] [table=cap_record_db.record_down]
[2020/07/16 09:02:34.869 +08:00] [INFO] [restore.go:1438] [“remote checksum completed”] [table=cap_record_db.record_down] [takeTime=2.767561608s] []
[2020/07/16 09:02:34.872 +08:00] [INFO] [restore.go:1387] [“checksum pass”] [table=cap_record_db.record_down] [local="{cksum=232572467004134109,size=892321937,kvs=9700892}"]
[2020/07/16 09:02:34.872 +08:00] [INFO] [restore.go:1392] [“analyze start”] [table=cap_record_db.record_down]
[2020/07/16 09:05:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=2.774340434056363] [state=writing] [remaining=47h34m53s]
[2020/07/16 09:10:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=1.3871408928362905] [state=writing] [remaining=95h9m53s]
[2020/07/16 09:15:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.9247540600976548] [state=writing] [remaining=142h44m53s]
[2020/07/16 09:20:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.6935628037375875] [state=writing] [remaining=190h19m53s]
[2020/07/16 09:25:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.5548492485403704] [state=writing] [remaining=237h54m53s]
[2020/07/16 09:30:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.462373705897229] [state=writing] [remaining=285h29m53s]
[2020/07/16 09:35:49.246 +08:00] [INFO] [restore.go:503] [progress] [files=“2/1144 (0.2%)”] [tables=“0/1552 (0.0%)”] [speed(MiB/s)=0.39631991758732854] [state=writing] [remaining=333h4m53s]
[2020/07/16 09:36:41.864 +08:00] [INFO] [main.go:44] [“got signal to exit”] [signal=interrupt]
[2020/07/16 09:36:41.865 +08:00] [INFO] [restore.go:266] [“user terminated”] [step=2] [error=“context canceled”]
[2020/07/16 09:36:41.865 +08:00] [INFO] [restore.go:276] [“the whole procedure completed”] [takeTime=37m52.465627453s] []
[2020/07/16 09:36:41.865 +08:00] [INFO] [main.go:82] [“tidb lightning exit”]
[2020/07/16 09:36:41.865 +08:00] [WARN] [restore.go:469] [“stopping periodic actions”] [error=“context canceled”]

看起来 lightning 一直在运行progress 进度没有更新可能是解析出错了,麻烦搜一下看看 log 里面有没有 ERROR

貌似没有ERROR,
会不会是因为我把import和lightning部署到同一台机器上导致的,
这两个服务都是在pd这台机器上启动的,但走的不同端口,这个可以部署在同一台机器吗?

从上面的日志里面看,看进度很多 table 已经完成导入了,比如 cap_record_db . record_down 这个,可以在 tidb 里面查询一个这个完成导入表的数据和预期的是否一致, 有可能只是进度显示的有误,实际导入是正常的

@Hacker_MyZ7oaNJ 仔细看了一下上面的日志,上面导入过程中的两个表 cap_record_db.record_down 和 cap_record_db.record_down_files 里面都只有一个 sql 文件,导入实际导入过程的并发性很低。看起来你的需要导入的源文件里面,表很多,但是每个表都不大,因此可以通过修改一下设置调大并发数来加速导入过程, 可以考虑在 tidb-lightning.toml 中增加如下设置:

[lightning]
index-concurrency = 20
table-concurrency = 20

默认只有两个表并发导入,并且 sql 源文件无法被分块并行执行,导致性能较低看起来像是卡住了的样子

在临时目录下还生成了一些执行日志,之前没有看到,刚搜索的时候发现有ERROR,
看来应该是gb2312的问题,这个问题之前手动导入数据的时候遇到过,貌似Tidb现在还只支持UTF-8的编码格式吧? 感觉应该是这个问题吧
多谢各位了哈,一直帮着解决问题。。。。

cap_record_db . record_down 里面是有数据的,应该是全部导入了。

错误日志:

/tmp/lightning.log.2020-07-16T08.40.22+0800
/tmp/lightning.log.2020-07-16T08.50.27+0800
/tmp/lightning.log.2020-07-16T08.51.06+0800
/tmp/lightning.log.2020-07-16T08.51.27+0800
/tmp/lightning.log.2020-07-16T08.58.49+0800

Error如下:
[2020/07/16 08:51:27.644 +08:00] [ERROR] [tidb.go:122] [“create tables failed”] [db=conf] [takeTime=70.158661ms] [error="[parser:1115]Unknown character set: ‘gb2312’"]
[2020/07/16 08:51:27.644 +08:00] [ERROR] [restore.go:301] [“restore table schema failed”] [db=conf] [takeTime=134.734607ms] [error="[parser:1115]Unknown character set: ‘gb2312’"]
[2020/07/16 08:51:27.644 +08:00] [ERROR] [restore.go:270] [“run failed”] [step=1] [error=“restore table schema conf failed: [parser:1115]Unknown character set: ‘gb2312’”]
[2020/07/16 08:51:27.645 +08:00] [ERROR] [restore.go:276] [“the whole procedure failed”] [takeTime=142.433768ms] [error=“restore table schema conf failed: [parser:1115]Unknown character set: ‘gb2312’”]
[2020/07/16 08:51:27.645 +08:00] [ERROR] [main.go:78] [“tidb lightning encountered error stack info”] [error=“restore table schema conf failed: [parser:1115]Unknown character set: ‘gb2312’”] [errorVerbose="[parser:1115]Unknown character set: ‘gb2312’\ngithub.com/pingcap/errors.AddStack\ \t/home/jenkins/agent/workspace/build_lightning_master/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20190809092503-95897b64e011/errors.go:174\ github.com/pingcap/parser/terror.(*Error).GenWithStackByArgs\ \t/home/jenkins/agent/workspace/build_lightning_master/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20200317021010-cd90cc2a7d87/terror/terror.go:243\ngithub.com/pingcap/parser.yyParse\ \t/home/jenkins/agent/workspace/build_lightning_master/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20200317021010-cd90cc2a7d87/parser.go:15254\ github.com/pingcap/parser.(*Parser).Parse\ \t/home/jenkins/agent/workspace/build_lightning_master/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20200317021010-cd90cc2a7d87/yy_parser.go:124\ngithub.com/pingcap/tidb-lightning/lightning/restore.(*TiDBManager).createTableIfNotExistsStmt\ \t/home/jenkins/agent/workspace/build_lightning_master/go/src/github.com/pingcap/tidb-lightning/lightning/restore/tidb.go:128\ngithub.com/pingcap/tidb-lightning/lightning/restore.(*TiDBManager).InitSchema\ \t/home/jenkins/agent/workspace/build_lightning_master/go/src/github.com/pingcap/tidb-lightning/lightning/restore/tidb.go:108\ngithub.com/pingcap/tidb-lightning/lightning/restore.(*RestoreController).restoreSchema\ \t/home/jenkins/agent/workspace/build_lightning_master/go/src/github.com/pingcap/tidb-lightning/lightning/restore/restore.go:299\ngithub.com/pingcap/tidb-lightning/lightning/restore.(*RestoreController).Run\ \t/home/jenkins/agent/workspace/build_lightning_master/go/src/github.com/pingcap/tidb-lightning/lightning/restore/restore.go:260\ngithub.com/pingcap/tidb-lightning/lightning.(*Lightning).run\ \t/home/jenkins/agent/workspace/build_lightning_master/go/src/github.com/pingcap/tidb-lightning/lightning/lightning.go:221\ngithub.com/pingcap/tidb-lightning/lightning.(*Lightning).RunOnce\ \t/home/jenkins/agent/workspace/build_lightning_master/go/src/github.com/pingcap/tidb-lightning/lightning/lightning.go:146\ main.main\ \t/home/jenkins/agent/workspace/build_lightning_master/go/src/github.com/pingcap/tidb-lightning/cmd/tidb-lightning/main.go:75\ runtime.main\ \t/usr/local/go/src/runtime/proc.go:203\ runtime.goexit\ \t/usr/local/go/src/runtime/asm_amd64.s:1357\ restore table schema conf failed"]

那看起来导入应该没问题,可以通过上面提到的增加一些并发数来提升速度。然后,charset 这块,目前 tidb 不支持 gb2312 这个 charset, 可以把 schema 文件中的这个编码统一替换成 utf8

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。