Creating a Replication Channel

For inbound replication, a replication channel connects the source (a MySQL instance or another DB system) to the replica (a DB system), and copies data from the source to the replica.

Using the Console

Use the Console to create a replication channel.

This task requires the following:
Follow these steps to create a replication channel:
  1. Open the navigation menu and select Databases. Under HeatWave MySQL, do one of the following:
    • Click Channels and click Create channel.
    • Click DB systems and from the list of DB systems, click the name of your DB system. Click More Actions, and select Create channel.
    • Click the Actions menu present on the same line as your DB system and select Create channel.
  2. On the Create channel panel, provide the following details:
    • Create in compartment: Create the channel in the same compartment as the target DB system. If you want to create the channel in a compartment other than the current compartment, select the required compartment from the list. If you do not select a different compartment, the current compartment is used.
    • Name: (Optional) Specify a user-friendly display-name for the channel. This name is not related to the Channel name defined in the Target DB system definition. It is used solely to label the channel. If you do not specify a name, one is generated for you in the format, mysqlchannelYYYYMMDDHHMMSS.
    • Enabled automatically upon creation: Specify whether the channel starts automatically on successful creation. It is enabled by default. If you disable this option, you will need to enable the channel manually.
    • Description: (Optional) Specify a user-friendly description of the channel and its purpose.
    • Source connection: Configure the MySQL source from where you want to replicate the data:
      • Hostname: Specify the hostname of the MySQL source. You can either specify an IP address or a fully qualified domain name.
      • Port: (Optional) Specify the port number the MySQL source listens on. The default value is 3306.
      • Username: Specify the replication username for the account that you created on the MySQL source server. The replication channel uses these credentials to connect to the source. See Creating a Replication User On a Source Server.
      • Password: Specify the password for the replication user account.
      • SSL mode: Select the required SSL mode. The selected mode is used to populate the SSL-specific values of the connection to the MySQL Source. Select either of the following SSL modes:
        • Disabled (DISABLED): Establishes an unencrypted connection between the source and target.
        • Required (REQUIRED): (Default) If the server supports encrypted connection, establishes an encrypted connection. The connection attempt fails if an encrypted connection cannot be established.
        • Verify certificate authority (VERIFY_CA): Like the Required mode, establishes an encrypted connection if the server supports encrypted connections and additionally verifies the Certificate Authority certificate configured on the source against the Certificate Authority's X509 certificate (PEM). You have to upload your Certificate Authority's X509 certificate.
        • Verify identity (VERIFY_IDENTITY): Like the Verify certificate authority mode, establishes an encrypted connection, verifies the Certificate Authority's certificate, and additionally verifies the source hostname, which you define in the source SSL certificate, against the hostname that you define in the Hostname field. You have to upload your Certificate Authority's X509 certificate.
        • Certificate authority's X509 certificate (PEM): Enables you to upload the source Certificate Authority's X509 certificate in PEM format. It is displayed only when you select the Verify certificate authority or Verify identity mode. The certificate is used to verify the Certificate Authority's certificate on the source.
    • Replication positioning: Configure the Source GTID settings:
      • Source can use GTID auto-positioning (recommended) : Select this option when the system variable, gtid_mode, is set to ON on the source. It means the source server can provide the replica with GTID information for auto-positioning. See GTIDs.
      • Source cannot use GTID auto-positioning: Select this option when the system variable, gtid_mode, is set to OFF,OFF_PERMISSIVE or ON_PERMISSIVE on the source. It means the source server cannot provide the replica with GTID information for auto-positioning. Specify the following options to convert a transaction that is anonymous to one that has GTIDs:
        Note

        You can select this option for standalone DB systems only. You cannot use this option for high availability DB systems.
        • Manually specify a UUID: Select this option to generate a new UUID or type in your own UUID. See UUID section in GTIDs.
        • Same UUID as target DB system: Select this option to use the same UUID as the target DB System.
        Specify the following:
        • Binary log file name: Specify the binary log file name that contains events that describe database changes. See The Binary Log.
        • Binary log offset: Specify the binary log offset within the binary log file.
    • Target DB system: Configure the DB system to which you want to replicate the data.
      • Applier username: (Optional) Specify the username of the applier user on the target DB system. If you do not specify a username, the administrator account of the DB system is used. See Creating an Applier User On a Target DB System.
        Note

        If specified, the user account must exist in the target DB system. The user account also must contain the REPLICATION_APPLIER privilege and privileges to execute the replicated transactions.
      • Channel name: (Optional) Specify the replication channel name. The target DB System uses the replication channel to communicate with the MySQL Source. If you do not specify a name, replication_channel is used.
      • Tables without primary key: (Optional) Specify how a replication channel handles the creation and alteration of tables with no primary keys.
        • Raise an error (RAISE_ERROR): Raise an error when replicating a CREATE TABLE or ALTER TABLE transaction with no primary key.
        • Allow (ALLOW): (Default) Allow replicating a CREATE TABLE or ALTER TABLE transaction with no primary key.
        • Generate primary key (GENERATE_IMPLICIT_PRIMARY_KEY): Generate an invisible primary key column when replicating any CREATE TABLE or ALTER TABLE statements on InnoDB tables with no primary key.
      • Replication delay: Set the amount of time, in seconds, that the channel waits before applying a transaction received from the source.
      • Target DB system: Select the DB system to use as the replication target. If you create the channel from the DB system details page, or from the Actions menu, the target DB system is automatically selected and you cannot change it. You can view the target DB system at the top of the page.
      • Channel filters: (Optional) Click Show channel filter options to configure the type and value of replication filters for the channel. See Channel Filter Rules.
        • Common filter templates: Select a filter template from the available list to match the source. You can use already existing filter templates that populates the Type and Value.
        • Type: Select the filter type. You can select a variety of filter types such as ignore a database or table and rewrite a database.
        • Value: Provide a value for the filter type. You can populate the value by selecting a common filter template or you can enter a new value.
  3. To create the channel, click Create channel.
    Channel creation begins, and the channel enters Creating state. Provisioning can take several minutes. The channel is not replicating data from the source to the target when it is in this state.
  4. (Optional) To save the resource configuration as a stack, click Save as stack. You can later use the stack to install, configure, and manage the resources through the Resource Manager service. See Managing Stacks.

If you left Enabled automatically upon creation checked, as soon as the channel has been created successfully, it enters Active state and starts replicating data from the source to the target.

If you uncheck the box, the channel enters Inactive state. In that case, when you are ready for the channel to start replicating data, enable it following the steps in Enabling or Disabling a Channel.

Channel Filter Rules

Configure the type and value of channel filters for replication.

Each filter rule can contain only one filter type and value. However, you can add any number of filter rules and the result is the addition of all filter rules. For example, if you create a filter rule with type, REPLICATE_DO_DB, and filter value, mysql1, and another filter rule, with type, REPLICATE_DO_DB, and filter value, mysql2, then both mysql1 and mysql2 databases are replicated.

Table 13-1 Channel Filter Rules

Filter Type Filter Value Details
REPLICATE_DO_DB database Replicates the specified database.
REPLICATE_IGNORE_DB database Restricts the replication of the specified database.
REPLICATE_DO_TABLE database.table Replicates the specified table in the database.
REPLICATE_IGNORE_TABLE database.table Restricts the replication of the specified table in the database.
REPLICATE_WILD_DO_TABLE database.table Replicates the table that matches the specified wildcard pattern.
REPLICATE_WILD_IGNORE_TABLE database.table Restricts the replication of any table that matches the specified wildcard pattern.
REPLICATE_REWRITE_DB from_database->to_database Translates from_database on the source to to_database.

Wildcard Patterns

REPLICATE_WILD_DO_TABLE and REPLICATE_WILD_IGNORE_TABLE support wildcards. Wildcard patterns can contain the % and _ wildcard characters. % represents 0 or more characters and _ represents any single character. For example:

  • A filter value of foo%.bar% in filter type REPLICATE_WILD_DO_TABLE replicates only those tables where the database name starts with foo and the table name starts with bar.
  • A filter value of foo%.% in filter type REPLICATE_WILD_DO_TABLE replicates all tables where the database name starts with foo.
  • A filter value of foo_.bar_ in filter type REPLICATE_WILD_IGNORE_TABLE ignores those tables where the database name contains four characters and starts with foo and the table name contains four character and starts with bar.

If you want to use any of the wildcard characters literally in the database or table names in REPLICATE_WILD_DO_TABLE or REPLICATE_WILD_IGNORE_TABLE, escape them with backslashes (\). For example, my\_db.top\_90\%.