简体   繁体   English

无法加载 kafka connect debezium mongodb 连接器

[英]kafka connect debezium mongodb connector cannot be loaded

I've an existing 2 kafka servers loaded mysql connector.我有一个现有的 2 个加载 mysql 连接器的 kafka 服务器。 It works.有用。 Also I need to add MongoDB connector.我还需要添加 MongoDB 连接器。 I've installed confluent-schema-registry on my Kafka servers (Centos7), it works, I stop/start/restart, nothing looks wrong.我已经在我的 Kafka 服务器 (Centos7) 上安装了 confluent-schema-registry,它工作正常,我停止/启动/重新启动,没有任何问题。 I've downloaded and extracted debezium Mongo plugins here;我在这里下载并提取了 debezium Mongo 插件; /usr/connector/plugins/debezium-connector-mongodb/ /usr/connector/plugins/debezium-connector-mongodb/

I've edited /etc/schema-registry/connect-avro-distributed.properties and modified following lines as below:我编辑了 /etc/schema-registry/connect-avro-distributed.properties 并修改了以下行,如下所示:

plugin.path=share/java,/usr/connector/plugins
bootstrap.servers=kafka3:9092,kafka4:9092
rest.host.name=kafka3
rest.port=8084
rest.advertised.host.name=kafka3
rest.advertised.port=8084

I run schema-registry and everything is ok, plugins are loaded.我运行 schema-registry,一切正常,插件已加载。 I would like to load connector via REST as below:我想通过 REST 加载连接器,如下所示:

curl -i -X POST -H "Accept:application/json" \
    -H  "Content-Type:application/json" http://kafka3:8084/connectors/ \
    -d  '{
  "name": "mongodb-connector",
  "config": {
    "connector.class": "io.debezium.connector.mongodb.MongoDbConnector",
    "mongodb.hosts": "shardreplica01/mongodb-shardsvr1:27017,shardreplica01/mongodb-shardsvr2:27017",
    "mongodb.name": "mongoreplica",
    "mongodb.user": "debezium",
    "mongodb.password": "******",
    "database.whitelist": "mongo[.]*",
  }
}'

...but the following error is displayed and the connector cannot be loaded: ...但显示以下错误并且无法加载连接器:

HTTP/1.1 500 Internal Server Error
Date: Tue, 21 Jan 2020 20:04:13 GMT
Content-Type: application/json
Content-Length: 350
Server: Jetty(9.4.20.v20190813)

{"error_code":500,"message":"Unexpected character ('}' (code 125)): was expecting double-quote to start field name\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 9, column: 27] (through reference chain: org.apache.kafka.connect.runtime.rest.entities.CreateConnectorRequest[\"config\"])"}

I need to help;我需要帮助; what am I missing?我错过了什么?

Thanks谢谢

Your JSON is invalid - you have a trailing comma:您的 JSON 无效 - 您有一个尾随逗号:

"database.whitelist": "mongo[.]*",
                                 ^
                                 |
                    HERE --------+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM