Skip to content

Commit

Permalink
tools/dm: update manage-task.md and add precheck.md (#931)
Browse files Browse the repository at this point in the history
* tools/dm: update manage-task.md and add precheck.md

Via: pingcap/docs-cn#1139

* dm: update the links related to precheck.md

* dm: address lilian's comments
  • Loading branch information
yikeke committed Mar 5, 2019
1 parent 7ea07b2 commit be6b62e
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 56 deletions.
53 changes: 0 additions & 53 deletions tools/dm/manage-task.md
Expand Up @@ -82,59 +82,6 @@ Flags:
# Use "dmctl [command] --help" for more information about a command.
```

## Precheck the upstream MySQL instance configuration

To detect possible errors of data synchronization configuration in advance, DM provides the precheck feature. You can use the `check-task` command to precheck whether the upstream MySQL instance configuration satisfies the DM requirements.

The user of the upstream and downstream databases must have the corresponding read and write privileges. DM checks the following privileges and configuration automatically while starting the data synchronization task:

+ Database version

- 5.5 < MySQL version < 5.8
- MariaDB version >= 10.1.2

+ MySQL binlog configuration

- Whether the binlog is enabled (DM requires that the binlog must be enabled)
- Whether `binlog_format=ROW` (DM only supports the binlog synchronization in the ROW format)
- Whether `binlog_row_image=FULL` (DM only supports `binlog_row_image=FULL`)

+ The privileges of the upstream MySQL instance user

The MySQL user in DM configuration needs to have the following privileges at least:

- REPLICATION SLAVE
- REPLICATION CLIENT
- RELOAD
- SELECT

+ The compatibility of the upstream MySQL table schema

TiDB differs from MySQL in compatibility in the following aspects:

- Does not support the foreign key
- [Character set compatibility differs](/sql/character-set-support.md)

+ The consistency check on the upstream MySQL multiple-instance shards

+ The schema consistency of all sharded tables

- Column size
- Column name
- Column position
- Column type
- Primary key
- Unique index

+ The conflict of the auto increment primary keys in the sharded tables

- The check fails in the following two conditions:

- The auto increment primary key exists in the sharded tables and its column type *is not* bigint.
- The auto increment primary key exists in the sharded tables and its column type *is* bigint, but column mapping *is not* configured.

- The check succeeds in other conditions except the two above.

## Manage the data synchronization task

This section describes how to use the task management commands to execute the following operations:
Expand Down
2 changes: 1 addition & 1 deletion tools/dm/overview.md
Expand Up @@ -77,7 +77,7 @@ Before using the DM tool, note the following restrictions:
- 5.5 < MySQL version < 5.8
- MariaDB version >= 10.1.2

Data Migration [prechecks the corresponding privileges and configuration automatically](/tools/dm/manage-task.md#precheck-the-upstream-mysql-instance-configuration) while starting the data synchronization task using dmctl.
Data Migration [prechecks the corresponding privileges and configuration automatically](/tools/dm/precheck.md) while starting the data synchronization task using dmctl.

+ DDL syntax

Expand Down
2 changes: 1 addition & 1 deletion tools/dm/practice.md
Expand Up @@ -111,7 +111,7 @@ To detect possible errors of data synchronization configuration in advance, DM p
- DM automatically checks the corresponding privileges and configuration while starting the data synchronization task.
- You can also use the `check-task` command to manually precheck whether the upstream MySQL instance configuration satisfies the DM requirements.

For details about the precheck feature, see [Precheck the upstream MySQL instance configuration](/tools/dm/manage-task.md#precheck-the-upstream-mysql-instance-configuration).
For details about the precheck feature, see [Precheck the upstream MySQL instance configuration](/tools/dm/precheck.md).

> **Note:** Before starting the data synchronization task for the first time, you should have got the upstream configured. Otherwise, an error is reported while you start the task.
Expand Down
64 changes: 64 additions & 0 deletions tools/dm/precheck.md
@@ -0,0 +1,64 @@
---
title: Precheck the upstream MySQL instance configuration
summary: Use the precheck feature provided by DM to detect errors in the upstream MySQL instance configuration.
category: tools
---

# Precheck the upstream MySQL instance configuration

This document introduces the precheck feature provided by DM. This feature is used to detect possible errors in the upstream MySQL instance configuration when the data replication task is started.

## Command

`check-task` allows you to precheck whether the upstream MySQL instance configuration satisfies the DM requirements.

## Checking items

Upstream and downstream database users must have the corresponding read and write privileges. DM checks the following privileges and configuration automatically while the data replication task is started:

+ Database version

- 5.5 < MySQL version < 5.8
- MariaDB version >= 10.1.2

+ MySQL binlog configuration

- Whether the binlog is enabled (DM requires that the binlog must be enabled)
- Whether `binlog_format=ROW` (DM only supports replication of the binlog in the ROW format)
- Whether `binlog_row_image=FULL` (DM only supports `binlog_row_image=FULL`)

+ The privileges of the upstream MySQL instance users

MySQL users in DM configuration need to have the following privileges at least:

- REPLICATION SLAVE
- REPLICATION CLIENT
- RELOAD
- SELECT

+ The compatibility of the upstream MySQL table schema

TiDB differs from MySQL in compatibility in the following aspects:

- TiDB does not support the foreign key.
- [Character set compatibility differs](/sql/character-set-support.md).

+ The consistency of the sharded tables in the multiple upstream MySQL instances

+ The schema consistency of all sharded tables

- Column size
- Column name
- Column position
- Column type
- Primary key
- Unique index

+ The conflict of the auto increment primary keys in the sharded tables

- The check fails in the following two conditions:

- The auto increment primary key exists in the sharded tables and its column type *is not* bigint.
- The auto increment primary key exists in the sharded tables and its column type *is* bigint, but column mapping *is not* configured.

- The check succeeds in other conditions except the two above.
2 changes: 1 addition & 1 deletion tools/dm/troubleshooting.md
Expand Up @@ -28,7 +28,7 @@ However, you need to reset the data synchronization task in some cases. For deta

For database related passwords in all the DM configuration files, use the passwords encrypted by `dmctl`. If a database password is empty, it is unnecessary to encrypt it. For how to encrypt the plaintext password, see [Encrypt the upstream MySQL user password using dmctl](/tools/dm/deployment.md#encrypt-the-upstream-mysql-user-password-using-dmctl).

In addition, the user of the upstream and downstream databases must have the corresponding read and write privileges. Data Migration also [prechecks the corresponding privileges automatically](/tools/dm/manage-task.md#precheck-the-upstream-mysql-instance-configuration) while starting the data synchronization task.
In addition, the user of the upstream and downstream databases must have the corresponding read and write privileges. Data Migration also [prechecks the corresponding privileges automatically](/tools/dm/precheck.md) while starting the data synchronization task.

### Incompatible DDL statements

Expand Down

0 comments on commit be6b62e

Please sign in to comment.