Documentation

Setting up CDC for Hosted MySQL

To replicate your hosted MySQL tables Alooma needs row-based replication and retention to be set up to be able to read your MySQL events.

Note

Please consult this article for a list of supported DDL changes.

  1. Verify that your binlog is configured by running the statement below - the value returned should be ROW:

    mysql> SHOW GLOBAL VARIABLES LIKE 'binlog_format';

  2. Verify that your binlog row format is set to FULL:

    mysql> SHOW GLOBAL VARIABLES LIKE 'binlog_row_image';

  3. Verify that your log slave updates option is set to ON:

    mysql> SHOW GLOBAL VARIABLES LIKE 'log_slave_updates';

  4. Verify that your log expiration is set to 7:

    mysql> SHOW GLOBAL VARIABLES LIKE 'expire_logs_days';

If your MySQL is not currently set to row based replication and 7 day retention, you'll need to change the configuration as follows.

  1. Include the following lines in your my.cnf file (under /etc/mysql/). The sample below is for a "vanilla" MySQL 5.6 installation:

    Copy
    [mysqld] 
    log-bin=mysql-bin 
    server-id=1 
    binlog_format = ROW 
    log-slave-updates=true 
  2. To ensure proper replication, configure your system to retain binary logs for a minimum of 7 days (168 hours). Edit your my.cnf file and enter the following line:

    Copy
    expire_logs_days = 7
  3. Make sure to restart your MySQL server to pick up the changes.

  4. Create an Alooma user, similar to the MySQL slave user:

    Copy
    mysql> CREATE USER 'alooma'@'%' IDENTIFIED BY 'YOUR_PASSWORD'; 
    mysql> GRANT REPLICATION SLAVE, SELECT, RELOAD, REPLICATION CLIENT, 
           LOCK TABLES, EXECUTE ON *.* 
    TO 'alooma'@'%'; 
    mysql> FLUSH PRIVILEGES;

That's it, you're ready to continue to connecting to MySQL.

Search results

    No results found