Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +-------------+
- | |
- | MySQL |
- | |
- +------+------+
- |
- |
- |
- +---------------v------------------+
- | |
- | Kafka Connect |
- | (Debezium, JDBC connectors) |
- | |
- +---------------+------------------+
- |
- |
- |
- |
- +-------v--------+
- | |
- | PostgreSQL |
- | |
- +----------------+
- # Start the application
- export DEBEZIUM_VERSION=0.6
- docker-compose up
- # Start PostgreSQL connector
- curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d @jdbc-sink.json
- # Start MySQL connector
- curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d @source.json
- docker-compose -f docker-compose-jdbc.yaml exec mysql bash -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD inventory -e "select * from customers"'
- +------+------------+-----------+-----------------------+
- | id | first_name | last_name | email |
- +------+------------+-----------+-----------------------+
- | 1001 | Sally | Thomas | sally.thomas@acme.com |
- | 1002 | George | Bailey | gbailey@foobar.com |
- | 1003 | Edward | Walker | ed@walker.com |
- | 1004 | Anne | Kretchmar | annek@noanswer.org |
- +------+------------+-----------+-----------------------+
- docker-compose -f docker-compose-jdbc.yaml exec postgres bash -c 'psql -U $POSTGRES_USER $POSTGRES_DB -c "select * from customers"'
- last_name | id | first_name | email
- -----------+------+------------+-----------------------
- Thomas | 1001 | Sally | sally.thomas@acme.com
- Bailey | 1002 | George | gbailey@foobar.com
- Walker | 1003 | Edward | ed@walker.com
- Kretchmar | 1004 | Anne | annek@noanswer.org
- (4 rows)
- docker-compose -f docker-compose-jdbc.yaml exec mysql bash -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD inventory'
- mysql> delete from customers where id = 1004;
- docker-compose -f docker-compose-jdbc.yaml exec mysql bash -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD inventory -e "select * from customers"'
- +------+------------+-----------+-----------------------+
- | id | first_name | last_name | email |
- +------+------------+-----------+-----------------------+
- | 1001 | Sally | Thomas | sally.thomas@acme.com |
- | 1002 | George | Bailey | gbailey@foobar.com |
- | 1003 | Edward | Walker | ed@walker.com |
- +------+------------+-----------+-----------------------+
- docker-compose -f docker-compose-jdbc.yaml exec postgres bash -c 'psql -U $POSTGRES_USER $POSTGRES_DB -c "select * from customers"'
- last_name | id | first_name | email
- -----------+------+------------+-----------------------
- Thomas | 1001 | Sally | sally.thomas@acme.com
- Bailey | 1002 | George | gbailey@foobar.com
- Walker | 1003 | Edward | ed@walker.com
- Kretchmar | 1004 | Anne | annek@noanswer.org
- (4 rows)
Add Comment
Please, Sign In to add comment