diff --git a/migrate-large-mysql-to-tidb.md b/migrate-large-mysql-to-tidb.md index 73a003ee2b6cc..60cb8bf52021b 100644 --- a/migrate-large-mysql-to-tidb.md +++ b/migrate-large-mysql-to-tidb.md @@ -140,18 +140,19 @@ The target TiKV cluster must have enough disk space to store the imported data. For more information on TiDB Lightning configuration, refer to [TiDB Lightning Configuration](/tidb-lightning/tidb-lightning-configuration.md). -2. Start the import by running `tidb-lightning`. If you launch the program directly in the command line, the process might exit unexpectedly after receiving a SIGHUP signal. In this case, it is recommended to run the program using a `nohup` or `screen` tool. For example: +2. Start the import by running `tidb-lightning`. If you launch the program directly in the command line, the process might exit unexpectedly after receiving a SIGHUP signal. It is not recommended to directly use `nohup` to start a process from the command line. Instead, edit the following script content, for example: If you import data from S3, pass the SecretKey and AccessKey that have access to the S3 storage path as environment variables to the TiDB Lightning node. You can also read the credentials from `~/.aws/credentials`. - {{< copyable "shell-regular" >}} - ```shell + #!/bin/bash export AWS_ACCESS_KEY_ID=${access_key} export AWS_SECRET_ACCESS_KEY=${secret_key} nohup tiup tidb-lightning -config tidb-lightning.toml > nohup.out 2>&1 & ``` + Then use the script to start TiDB Lightning. + 3. After the import starts, you can check the progress of the import by one of the following methods: - `grep` the keyword `progress` in the log. The progress is updated every 5 minutes by default.