All Apps and Add-ons

"not talking to master and retries used up" mongodb - splunk error

shantiestolas04
Engager

Hi,

Im having a problem connecting from splunk db connect to MongoDB replica.
I can telnet the ip of mongo replica to splunk, also tried to connect the mongo primary db and yielded successfully. But when connecting to mongo replica db, Im encountering an error "Database connection MongoDB is invalid. not talking to master and retries used up"

splunk db connect version is 3.1.4
splunk version is 7.2.3

Can you help me if there is a problem on my configuration below.

[mongo]
displayName = MongoDB
serviceClass = com.splunk.dbx2.DefaultDBX2JDBC
jdbcDriverClass = mongodb.jdbc.MongoDriver
jdbcUrlFormat = jdbc:mongo://IP:27017/dbname?replicaSet=dbname&readPreference=secondaryPreferred&connectWithNoPrimary=true&slaveOk=true
jdbcUrlSSLFormat = jdbc:mongo://IP:27017/dbname?replicaSet=dbname&readPreference=secondaryPreferred&connectWithNoPrimary=true&slaveOk=true
ui_default_catalog = dbname
port = 27017

0 Karma

umlawren
Explorer

Two things to try:

  1. List more than one server in the replica set in the URL. Example: jdbc:mongo://IP1:27017,IP2:27017/dbname?replicaSet=dbname&readPreference=secondaryPreferred&connectWithNoPrimary=true&slaveOk=true
  2. Use the alternate JDBC URL syntax jdbc:mongodb://[user:pw]@host1,host2/database?replicaSet=dbname&readPreference=secondaryPreferred&connectWithNoPrimary=true&slaveOk=true

The Mongo documentation specifies the second URL format where the first URL format is from the JDBC driver itself.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...