1

I have mongoUri config set in my properties file like this:

spring.data.mongodb.uri=mongodb://user:3YySgdQLEaeFTN2@mongodb-01.uata.lokal:27017,mongodb-02.uata.lokal:27017/dbName 

And I receive this error:

Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=mongodb-02.uata.lokal:27017, type=REPLICA_SET_SECONDARY, roundTripTime=84.6 ms, state=CONNECTED}, {address=mongodb-01:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: mongodb-01: nodename nor servname provided, or not known}, caused by {java.net.UnknownHostException: mongodb-01: nodename nor servname provided, or not known}}, {address=mongoarb-01.uata.lokal:27017, type=REPLICA_SET_ARBITER, roundTripTime=88.8 ms, state=CONNECTED}]

Please help how should I add the mongo replica set configuration

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
Gaurav Yadav
  • 67
  • 1
  • 2
  • 8
  • Your cluster is down. There is No PRIMARY in the currently available replica set members. This would have either resolved itself by now or you have a "database maintenance issue" and not a "programming question" which is what Stack Overflow is for. If your cluster is still not working, then ask on [dba.stackexchange.com](https://dba.stackexchange.com) instead. – Neil Lunn Nov 14 '18 at 21:42
  • yeah, I checked there was some issue with our rs setop only. btw thanks for the help @NeilLunn – Gaurav Yadav Nov 15 '18 at 06:45

0 Answers0