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!

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...

Explore the Latest Educational Offerings from Splunk [January 2025 Updates]

At Splunk Education, we are committed to providing a robust learning experience for all users, regardless of ...

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...