debezium不包含连接器类型

qybjjes1  于 2021-06-07  发布在  Kafka
关注(0)|答案(2)|浏览(665)

我正在尝试使用debezium连接到本地机器上的mysql数据库。
尝试使用以下命令调用kafka:sudo kafka/bin/connect-standalone.shsh kafka/config/connect-standalone.properties kafka/config/connector.properties
以下是connector.properties中的配置:

{
  "name": "inventory-connector",
  "config": {
    "connector.class": "io.debezium.connector.mysql.MySqlConnector",
    "database.hostname": "127.0.0.1",
    "tasks.max": "1",
    "database.port": "3306",
    "database.user": "debezium",
    "database.password": "Password@123",
    "database.server.id": "1",
    "database.server.name": "fullfillment",
    "database.whitelist": "inventory",
    "database.history.kafka.bootstrap.servers": "localhost:9092",
    "database.history.kafka.topic": "dbhistory.fullfillment",
    "include.schema.changes": "true",
    "type": "null"
  }
}

运行上述命令时出现以下错误:

[2018-12-07 10:58:17,102] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:113)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector config {"config"={, "type"="null", "database.user"="debezium",, "database.port"="3306",, "include.schema.changes"="true",, "database.server.name"="fullfillment",, "connector.class"="io.debezium.connector.mysql.MySqlConnector",, "tasks.max"="1",, "database.history.kafka.topic"="dbhistory.fullfillment",, "database.server.id"="1",, "database.whitelist"="inventory",, "name"="inventory-connector",, "database.hostname"="127.0.0.1",, {=, "database.password"="Password@123",, }=, "database.history.kafka.bootstrap.servers"="localhost:9092",} contains no connector type
    at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:79)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:66)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:110)
Caused by: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector config {"config"={, "type"="null", "database.user"="debezium",, "database.port"="3306",, "include.schema.changes"="true",, "database.server.name"="fullfillment",, "connector.class"="io.debezium.connector.mysql.MySqlConnector",, "tasks.max"="1",, "database.history.kafka.topic"="dbhistory.fullfillment",, "database.server.id"="1",, "database.whitelist"="inventory",, "name"="inventory-connector",, "database.hostname"="127.0.0.1",, {=, "database.password"="Password@123",, }=, "database.history.kafka.bootstrap.servers"="localhost:9092",} contains no connector type
    at org.apache.kafka.connect.runtime.AbstractHerder.validateConnectorConfig(AbstractHerder.java:259)
    at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.putConnectorConfig(StandaloneHerder.java:189)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:107)

任何帮助都将不胜感激。

sshcrbum

sshcrbum1#

您有一个json文件,而不是属性文件。
这是用来和 connect-distributed 模式。并通过http发送到kafka connect restapi

wbgh16ku

wbgh16ku2#

connector.properites 对于独立模式,需要属性文件格式。所以请拿着 config 然后像这样重写

connector.class=io.debezium.connector.mysql.MySqlConnector
.
.
.

相关问题