Reading from MongoDB secondary server

Highlighted
Seven Stars

Reading from MongoDB secondary server

Hi,

I am using "replica set address" to connect to mongoDB using tMongoDBInput. I have given the "Set read preference" option as "secondary" to fetch from MongoDB secondary server. But, I am getting the below exception:

" Exception in component tMongoDBInput_2

com.mongodb.CommandFailureException: { "serverUsed" : "xxxxxxxxxx.abcd.local:27017" , "ok" : 0.0 , "errmsg" : "not master and slaveOk=false" , "code" : 13435 , "codeName" : "NotMasterNoSlaveOk"}

      at com.mongodb.CommandResult.getException(CommandResult.java:76)

      at com.mongodb.CommandResult.throwOnError(CommandResult.java:140)

      at com.mongodb.DBCollectionImpl.aggregate(DBCollectionImpl.java:113)

      at com.mongodb.DBCollection.aggregate(DBCollection.java:1814) "

 

Can you please let me know how to fix this issue and suggest any thoughts on this?

Server details in above exception is dummy.

Moderator

Re: Reading from MongoDB secondary server

Hello,

Can you please clarify in which Talend version/edition you are? What's MongoDB version are you using?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog