Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions migrate-large-mysql-to-tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment on lines +143 to +154

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The explanation for using a script could be clearer and more instructive. It's good that you're recommending a script over direct nohup usage, but the instructions on how to use the script are a bit vague. Providing a more complete example would be more helpful for users.1

Suggested change
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.
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. To avoid this, it is recommended to save the commands in a script file and then execute it. For example, you can create a script file named `start.sh` with the following content:
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`.
```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, make the script executable and run it to start TiDB Lightning:
```shell
chmod +x start.sh
./start.sh
```

Style Guide References

Footnotes

  1. Instructions should be clear and complete. The suggestion provides a more explicit example of how to create and run the script.


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.
Expand Down