-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
op-guide, tools: Recommend mydumper from enterprise tools #644
Changes from 11 commits
be9f5bc
5d0ea83
bea41aa
71ca614
ba8306d
b570a53
5091233
5f38b38
ad67d4f
bb3de60
927f26f
e6e8f0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,9 @@ cd tidb-enterprise-tools-latest-linux-amd64 | |
|
||
## Full backup and restoration using `mydumper`/`loader` | ||
|
||
You can use `mydumper` to export data from MySQL and `loader` to import the data into TiDB. | ||
You can use [`mydumper`](../tools/mydumper.md) to export data from MySQL and [`loader`](../tools/loader.md) to import the data into TiDB. | ||
|
||
> **Note**: Although TiDB also supports the official `mysqldump` tool from MySQL for data migration, it is not recommended to use it. Its performance is much lower than `mydumper`/`loader` and it takes much time to migrate large amounts of data. `mydumper`/`loader` is more powerful. For more information, see https://github.com/maxbube/mydumper. | ||
> **Important**: You must use the `mydumper` from the Enterprise Tools package, and not the `mydumper` provided by your operating system's package manager. The upstream version of `mydumper` does not yet handle TiDB correctly ([#155](https://github.com/maxbube/mydumper/pull/155)). Using `mysqldump` is also not recommended, as it is much slower for both backup and restoration. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please delete a space before "Using". |
||
|
||
### Best practices of full backup and restoration using `mydumper`/`loader` | ||
|
||
|
@@ -119,4 +119,4 @@ mysql> select * from t2; | |
| 2 | b | | ||
| 3 | c | | ||
+----+------+ | ||
``` | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: mydumper Instructions | ||
summary: Use mydumper to export data from TiDB. | ||
category: tools | ||
--- | ||
|
||
# mydumper Instructions | ||
|
||
## What is mydumper? | ||
|
||
`mydumper` is a fork of the [mydumper](https://github.com/maxbube/mydumper) project with additional functionality specific to TiDB. It is the recommended method to use for logical backups of TiDB. | ||
|
||
[Download the Binary](http://download.pingcap.org/tidb-enterprise-tools-latest-linux-amd64.tar.gz). | ||
|
||
## What enhancements does this contain over regular mydumper? | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the following sentences, we had better use "Uses", "Includes", and "Allows" instead of "Use", "Include" and "Allow", because these sentences are descriptive (describe something) rather than imperative (tell users to do something). |
||
+ Use `tidb_snapshot` to provide backup consistency instead of `FLUSH TABLES WITH READ LOCK` | ||
|
||
+ Include the hidden `_tidb_rowid` column in `INSERT` statements when present | ||
kennytm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
+ Allow for `tidb_snapshot` to be [configurable](../op-guide/history-read.md#how-tidb-reads-data-from-history-versions) (i.e. backup data as it appeared at an earlier point in time) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allow for -> Allow |
||
|
||
### New parameter description | ||
|
||
``` | ||
-z, --tidb-snapshot: Set the tidb_snapshot to be used for the backup. | ||
Default: NOW()-INTERVAL 1 SECOND. | ||
kennytm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Accepts either a TSO or valid datetime. For example: -z "2016-10-08 16:45:26" | ||
``` | ||
|
||
### Usage example | ||
|
||
Command line parameter: | ||
|
||
``` | ||
./bin/mydumper -h 127.0.0.1 -u root -P 4000 | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a line after it. |
||
## FAQ | ||
|
||
### Is the source code for these changes available? | ||
|
||
Source code for PingCAP's mydumper is [available on GitHub](https://github.com/pingcap/mydumper). | ||
|
||
### Do you plan to make these changes available to upstream mydumper? | ||
|
||
Yes, we intend to make our changes available to upstream mydumper. See [PR #155](https://github.com/maxbube/mydumper/pull/155). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we must keep "## Migrate the data and traffic" and "### Full data export and import". Otherwise, the following will have no corresponding title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! I misunderstood what this part meant. I will submit a new PR to restore.