Archive2

How to trigger rs.slaveOk() from Splunk MongoDB (Hunk) app to query data from secondary instance

sandeepkumar23
Explorer

We have a requirement of querying MongoDB collections from secondary instance using Splunk MongoDB app (Hunk). The virtual indexes are working perfectly fine when we configure the primary MongoDB instance in indexes.conf. However as per recommendation from DB team, we need to point our splunk to query the secondary MongoDB instance. But when we configure the secondary instance IP in indexes.conf, the virtual indexes are failing to pull data from DB. On further investigation, we found the reason is, we need to set "rs.slaveOk()" in secondary instance each time before querying the data. We don't see any option at configuration level to trigger "rs.slaveOk()" through MongoDB app.

Is there any way to achieve that? Any sort of help will be highly appreciated.

0 Karma
Reply
Register for .conf21 Now! Go Vegas or Go Virtual!

How will you .conf21? You decide! Go in-person in Las Vegas, 10/18-10/21, or go online with .conf21 Virtual, 10/19-10/20.