Configuration of the data-source-dir parameter for importing external data in lighting

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: lighting导入外部数据参数data-source-dir配置

| username: TiDBer_FMWXa7ja

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path]
[Encountered Problem: Problem Phenomenon and Impact] How to configure the data-source-dir parameter when importing an SQL file from another server using lighting
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: 裤衩儿飞上天 | Original post link

NFS shared data directory or copy the data to the current machine.

| username: tidb菜鸟一只 | Original post link

Why do you need to import the SQL file from another machine? Can’t you just copy it over?

| username: TiDBer_FMWXa7ja | Original post link

The data volume is too large, with over 1 billion records in a single table. The server can’t handle it, so we’re using an intermediate server.

| username: vcdog | Original post link

Then consider using shared storage devices and have the operations colleagues mount it to a specific path for you.

| username: TiDBer_FMWXa7ja | Original post link

This method works.

| username: dba-kit | Original post link

The value of data-source-dir supports S3 addresses, so you can also consider placing it on S3.

| username: tidb菜鸟一只 | Original post link

In that case, mount the remote directory locally using NFS, but the import will be affected by the network bandwidth between the two servers.

| username: dba-kit | Original post link

If you want to extend further, you can set up a MinIO on the intermediate server to act as S3 storage, or directly transfer TiDB-Lightning to the intermediate server and import it there.