-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source Connector connected but not fetching data from mongodb #22
Comments
$ curl localhost:8083/connectors/mongodb-source-connector/tasks |
$curl localhost:8083/connectors/mongodb-source-connector/status |
I do not get any messages in my kafka topic. Any idea? |
As the documentation of this connector says: "When the connector is run as a Source Connector, it reads data from Mongodb oplog and publishes it on Kafka". See: https://docs.mongodb.com/manual/core/replica-set-oplog/ Check that your mongo DB has the collection "local.oplog.rs". If not, it's because is not set up to be a replica set. As soon as you set it, that collection is created in your mongo and the connector is able to start creating and sending the messages to kafka. |
As @ruileal said, MongoDB has to be configured as a replica set. In short, to make it work:
Then, you should start seeing the oplog messages. |
@system103:~$ rs.initiate() I am not getting oplog messages |
Does mongo have replication set? Check this - https://docs.mongodb.com/manual/core/replica-set-oplog/. Also, it might be easy to just clone the source and run test case- testInsertWithNullOffsets by setting your connection string. You have to comment a bunch of things, but it's easier to debug issues that way. |
Hi
Source Connector connected but not fetching data from mongodb.
Please advice.
[2017-12-05 16:59:58,009] INFO Cluster created with settings {hosts=[127.0.0.1:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500} (org.mongodb.driver.cluster:71)
[2017-12-05 16:59:58,016] INFO Cluster description not yet available. Waiting for 30000 ms before timing out (org.mongodb.driver.cluster:71)
[2017-12-05 16:59:58,019] INFO Opened connection [connectionId{localValue:3, serverValue:282}] to 127.0.0.1:27017 (org.mongodb.driver.connection:71)
[2017-12-05 16:59:58,019] INFO Monitor thread successfully connected to server with description ServerDescription{address=127.0.0.1:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 4, 10]}, minWireVersion=0, maxWireVersion=5, maxDocumentSize=16777216, roundTripTimeNanos=280047} (org.mongodb.driver.cluster:71)
[2017-12-05 16:59:58,020] INFO WorkerSourceTask{id=mongodb-source-connector-0} Source task finished initialization and start (org.apache.kafka.connect.runtime.WorkerSourceTask:158)
[2017-12-05 16:59:58,024] INFO Opened connection [connectionId{localValue:4, serverValue:283}] to 127.0.0.1:27017 (org.mongodb.driver.connection:71)
[2017-12-05 16:59:58,024] INFO Opened connection [connectionId{localValue:5, serverValue:284}] to 127.0.0.1:27017 (org.mongodb.driver.connection:71)
[2017-12-05 16:59:58,024] INFO Opened connection [connectionId{localValue:6, serverValue:285}] to 127.0.0.1:27017 (org.mongodb.driver.connection:71)
[2017-12-05 17:00:57,903] INFO WorkerSourceTask{id=mongodb-source-connector-0} Committing offsets (org.apache.kafka.connect.runtime.WorkerSourceTask:306)
[2017-12-05 17:00:57,904] INFO WorkerSourceTask{id=mongodb-source-connector-0} flushing 0 outstanding messages for offset commit (org.apache.kafka.connect.runtime.WorkerSourceTask:323)
Best regards,
The text was updated successfully, but these errors were encountered: