0

I am unable to configure grails mongo replicaset host URLs from external properties file.

My config is:

grails version 2.4.3
config.groovy

grails {
   mongo {
     replicaSet = ["test.mongo1.co:27017", "test.mongo2.co:27017",
                   "test.mongo3.co:27017"]
   }
}

I am using mongo plugin:

plugins{
compile ":mongodb:3.0.3"
}
dependencies{
compile 'org.mongodb:mongo-java-driver:2.13.0-rc1'
}

How do I configure mongo replicaset host urls from external prop file?

Michael Currie
  • 13,721
  • 9
  • 42
  • 58

1 Answers1

0

Do you have set any username, password and database name? E.g.

grails {
  mongo {
    replicaSet = [ "172.17.17.175", "172.17.17.181", "172.17.17.186"]
    port = 27017
    username = "exampleUser"
    password = "examplePassword"
    databaseName = "exampleDatabase"
  }
}

Have you tried to insert this conf in DataSource.groovy? Does it work there?

We need to see the log output from your Grails App and also from your mongod log (e.g. /var/log/mongodb/...).

Mexx
  • 359
  • 3
  • 17