我有一个现有的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[.]*",
}
}'...but显示以下错误,无法加载连接器:
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\"])"}我需要帮助;我遗漏了什么?
谢谢
发布于 2020-01-22 04:17:01
您的JSON无效-您有一个尾随逗号:
"database.whitelist": "mongo[.]*",
^
|
HERE --------+https://stackoverflow.com/questions/59848467
复制相似问题