Question:
How do I correctly register the SqlServer connector with Kafka Connect to connect to a standalone SQL Server Instance? Note: I am NOT running
The problem is in the reference to the localhost. If you run the Connect in Docker container then the localhost is the localhost of the container not of the machine. Try exposing the SQL Server on docker0 interface or all intefaces and then use docker0 IP in the registration request.
The solution for a non-production environment is to use host.docker.internal. This is found on Docker's website here: https://docs.docker.com/docker-for-windows/networking/. See section titled I WANT TO CONNECT FROM A CONTAINER TO A SERVICE ON THE HOST. I will need to look into the Docker0 that is recommended in Jiri's answer.
The correct JSON is as follows:
{
"name": "LT-LS231-mssqlserver-connector",
"config": {
"connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
"database.server.name": "staging",
"database.hostname": "host.docker.internal",
"database.port": "1433",
"database.user": "svc_kafka",
"database.password": "*********",
"database.dbname": "Test",
"table.whitelist": "dbo.Posts",
"database.history.kafka.bootstrap.servers": "kafka:9092",
"database.history.kafka.topic": "dbhistory.Posts"
}
}