All Apps and Add-ons

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

New Member

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
uidefaultcatalog = dbname
port = 27017

0 Karma

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