Connecting my debezium to existing MySQL Database on my Wamp Server

1,733 views
Skip to first unread message

alex davies

unread,
Jun 20, 2018, 3:30:57 AM6/20/18
to debezium
I have a local Wamp server that has a mysql database with tables and data in them, am trying ti connect my debezium to that database and them replicate the data to an another database either on another online server or on the same localhost wamp server.

Gunnar Morling

unread,
Jun 20, 2018, 10:43:37 AM6/20/18
to debezium
Hum, what is your exact question?

alex davies

unread,
Jun 20, 2018, 11:05:28 AM6/20/18
to debezium
I want to sync to databases. When one database is changed, it should be synced with the other and vice versa. Now I want to just connect my docker or run a container that would connect to my localhost wamp server database.

Gunnar Morling

unread,
Jun 20, 2018, 11:09:22 AM6/20/18
to debe...@googlegroups.com
Ok, Debezium could help you with that :)

It's still not clear though what you have tried, whether you ran into any problems doing so etc. You may take a look at our tutorial to get started with Debezium in general: http://debezium.io/docs/tutorial. Also there's an example which streams changes from MySQL into Postgres, which seems similar to what you'd like to achieve: https://github.com/debezium/debezium-examples/tree/master/unwrap-smt#jdbc-sink.



--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+unsubscribe@googlegroups.com.
To post to this group, send email to debe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/bd2cf0d9-65f9-4e92-b9ec-e44050e60edb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

alex davies

unread,
Jun 20, 2018, 1:06:20 PM6/20/18
to debezium
Well am just starting, I have installed and started kafka and zookeeper, in their tutorial they are using their own mysql database
 debezium/mysql0.7 but I wish to use mine and I can't seem to understand how to connect to my own mysql database.

Please I would like some assistance there.

On Wednesday, June 20, 2018 at 4:09:22 PM UTC+1, Gunnar Morling wrote:
Ok, Debezium could help you with that :)

It's still not clear though what you have tried, whether you ran into any problems doing so etc. You may take a look at our tutorial to get started with Debezium in general: http://debezium.io/docs/tutorial. Also there's an example which streams changes from MySQL into Postgres, which seems similar to what you'd like to achieve: https://github.com/debezium/debezium-examples/tree/master/unwrap-smt#jdbc-sink.


2018-06-20 17:05 GMT+02:00 alex davies <daviest...@gmail.com>:
I want to sync to databases. When one database is changed, it should be synced with the other and vice versa. Now I want to just connect my docker or run a container that would connect to my localhost wamp server database.

On Wednesday, June 20, 2018 at 3:43:37 PM UTC+1, Gunnar Morling wrote:
Hum, what is your exact question?

Am Mittwoch, 20. Juni 2018 09:30:57 UTC+2 schrieb alex davies:
I have a local Wamp server that has a mysql database with tables and data in them, am trying ti connect my debezium to that database and them replicate the data to an another database either on another online server or on the same localhost wamp server.

--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.

To post to this group, send email to debe...@googlegroups.com.

Gunnar Morling

unread,
Jun 20, 2018, 3:12:07 PM6/20/18
to debezium
Essentially you'd have to adjust the connector registration JSON from the tutorial so it contains the host name, credentials etc. of your own database. I suggest you give it a try and if you run into any problems, report back with the specific exceptions or error messages you get.

Cheers,

--Gunnar

alex davies

unread,
Jun 20, 2018, 5:24:37 PM6/20/18
to debezium
okay. From your last message, it shed some light on what I was supposed to do and I tired the following,

1) first I started zookeeper
2) I started kafka, I did not start debezium/example-mysql:0.7 because I wish to use my own wamp server DB
3) I started kafka connector and ran the json below through my post man

{ "name": "shopcentra-connector", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "localhost", "database.port": "3306", "database.user": "root", "database.password": "", "database.server.id": "184054", "database.server.name": "dbserver1", "database.whitelist": "shopcentra", "database.history.kafka.bootstrap.servers": "kafka:9092", "database.history.kafka.topic": "dbhistory.shopcentra" } }

The response I got is below

{
    "error_code": 400,
    "message": "Connector configuration is invalid and contains the following 1 error(s):\nA value is required\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"
}

My password field is empty because my username is root and password is empty string, even when I place a value in my string I get the following below

{
    "error_code": 400,
    "message": "Connector configuration is invalid and contains the following 1 error(s):\nUnable to connect: Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"
}

Am not sure as to all the value I entered into my request JSON.

Hopefully you can shed more light on this.

Thanks, I really appreciate this.


Some values I do

Jiri Pechanec

unread,
Jun 21, 2018, 12:55:20 AM6/21/18
to debezium
Hi Alex,

I think you've hit this issue - https://issues.jboss.org/browse/DBZ-743

J.

alex davies

unread,
Jun 21, 2018, 6:37:21 AM6/21/18
to debezium
I made my root user accept a password and changed my json request slightly, below is my request

{ "name": "shopcentra-connector", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "localhost", "database.port": "3306", "database.user": "root", "database.password": "root", "database.server.id": "5444", "database.server.name": "shopcentra", "database.whitelist": "shopcentra", "database.history.kafka.bootstrap.servers": "kafka:9092", "database.history.kafka.topic": "dbhistory.shopcentra" } }

and I still get a bad request in my response, response is below

{
    "error_code": 400,

    "message": "Connector configuration is invalid and contains the following 1 error(s):\nUnable to connect: Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"
}

Jiri Pechanec

unread,
Jun 24, 2018, 11:26:07 PM6/24/18
to debezium
Hi,

please verify you can physically connect from the with Debezium to the target database. You can use docker exect -it <container id> bash comand to lof to it end the try for example curl or telnet to connect to the target host and port.

J.

alex davies

unread,
Jun 25, 2018, 3:24:36 AM6/25/18
to debezium
Hello,

Thanks for checking on my issue, I have not been able to connect to either my WAMP Server localhost or my online hosted database. Am guessing I have to create a mysql container that would either connect to my localhost WAMP Server or my online hosted database before connecting my kafka connector to the mysql container.

So the question is how do I create the mysql container to either my localhost WAMP server database or my online hosted database?

Jiri Pechanec

unread,
Jun 25, 2018, 4:39:13 AM6/25/18
to debezium
Hi,

it looks a like a networking/firewall issue with your Docker installation. Please try first to run a single container just to find and fix the netwokring issues. When this is resolved you should continue with Debezium Images.

J.
Reply all
Reply to author
Forward
0 new messages