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
Two things to try:
The Mongo documentation specifies the second URL format where the first URL format is from the JDBC driver itself.