1

My Kafka Connect is sitting in a Kubernetes cluster which has the mongo-kafka-connect-1.1.0-all.jar in the connectors folder.

I have port forwarded the Kafka Connect service to my localhost and am trying to upload the properties for a Mongo Sink Connector with this curl command (obviously, with my own connection details in the relevant <> places):

curl -X PUT http://localhost:8083/connectors/sink-mongodb/config -H "Content-Type: application/json" -d '{
      "connector.class":"com.mongodb.kafka.connect.MongoSinkConnector",
      "tasks.max":"1",
      "topics":"<topic name>",
      "connection.uri":"mongodb://<username>:<password>@<uri1>:<port1>,<uri2>:<port2>",
      "database":"<database name>",
      "collection":"<collection name>",
      "key.converter":"org.apache.kafka.connect.storage.StringConverter",
      "key.converter.schemas.enable":false,
      "value.converter":"org.apache.kafka.connect.json.JsonConverter",
      "value.converter.schemas.enable":false
}'

However, I get the following error response:

{"error_code":400,"message":"Connector configuration is invalid and contains the following 1 error(s):\nConfiguration is not defined: topic\nUnable to connect to the server.\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}

Is my config wrong, am I missing something?

4

3 回答 3

1

I tried 1.0.1 instead of 1.1.0 — that is, mongo-kafka-connect-1.0.1-all.jar — as the plugin, and this error disappeared.

于 2020-06-13T18:48:10.177 回答
1

So in the end, the issue was that the I needed to take the .pem file and convert it to a .crt and add this to the server's list of CAs. Essentially the server didn't accept the SSL cert and was refusing to connect.

于 2020-12-17T17:36:28.393 回答
0

I was facing the same issue. Changing docker image from mongo:4.0.xenial to mongo:4.0.4 resolved the issue.

于 2020-06-11T12:45:28.603 回答