Skip to main content
The Canal source connector pulls messages from MySQL to Pulsar topics.

Configuration

The configuration of Canal source connector has the following properties.

Property

Example

Before using the Canal connector, you can create a configuration file through one of the following methods.
  • JSON
  • YAML You can create a YAML file and copy the contents below to your YAML file.

Usage

Here is an example of storing MySQL data using the configuration file as above.
  1. Start a MySQL server.
  2. Create a configuration file mysqld.cnf.
  3. Copy the configuration file mysqld.cnf to MySQL server.
  4. Restart the MySQL server.
  5. Create a test database in MySQL server.
  6. Start a Canal server and connect to MySQL server.
  7. Start Pulsar standalone.
  8. Modify the configuration file canal-mysql-source-config.yaml.
  9. Create a consumer file pulsar-client.py.
  10. Copy the configuration file canal-mysql-source-config.yaml and the consumer file pulsar-client.py to Pulsar server.
  11. Download a Canal connector and start it.
  12. Consume data from MySQL.
  13. Open another window to log in MySQL server.
  14. Create a table, and insert, delete, and update data in MySQL server.