【发布时间】:2020-05-07 22:46:30
【问题描述】:
我有一个现有的 2 个 kafka 服务器加载了 mysql 连接器。有用。 我还需要添加 MongoDB 连接器。 我已经在我的 Kafka 服务器(Centos7)上安装了 confluent-schema-registry,它可以工作,我停止/启动/重新启动,看起来没有任何问题。 我在这里下载并提取了 debezium Mongo 插件; /usr/connector/plugins/debezium-connector-mongodb/
我已经编辑了 /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
我运行了 schema-registry,一切正常,插件已加载。我想通过 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[.]*",
}
}'
...但是显示如下错误,无法加载连接器:
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\"])"}
我需要帮助;我错过了什么?
谢谢
【问题讨论】:
标签: apache-kafka apache-kafka-connect debezium