Debezium How do I correctly register the SqlServer connector with Kafka Connect - connection refused

后端 未结 2 755
借酒劲吻你
借酒劲吻你 2021-01-25 02:59

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

相关标签:
2条回答
  • 2021-01-25 03:18

    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.

    0 讨论(0)
  • 2021-01-25 03:23

    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" 
      }
    }
    
    0 讨论(0)
提交回复
热议问题