1

So I have a vapor \ fluent app that works fine with local mongo instance, here's current mongo.json:

{
    "database" : "vapor",
    "port" : "27017",
    "host" : "127.0.0.1",
    "user" : "",
    "password" : ""
}

I've deployed a free MongoDB Atlas 3 replica set and I wonder how do I connect the app to it?

Dannie P
  • 4,464
  • 3
  • 29
  • 48

2 Answers2

0
  • Check that your mongod instance is listening on the necessary network interfaces
  • Check that your firewall is open and you can connect to the mongod process from your application node
  • Check that your mongod is secure, i.e. you can connect only with known credentials
  • In the application's mongo.json:
"host": "replica_set_name/first_RS_node_address, second_RS_node_address, third_RS_node_address", 
"user": "your_user_name", 
"password": "wery_secret"
Vince Bowdren
  • 8,326
  • 3
  • 31
  • 56
JJussi
  • 1,540
  • 12
  • 12
  • I'm getting this error when trying to connect: `The MongoDB background loop encountered an error: Socket failed with code 9 ("Bad file descriptor") [readFailed]` – Dannie P May 11 '17 at 20:47
  • Can you connect to that mongod with telnet from you application node? If not, check your connection. – JJussi May 12 '17 at 04:58
0

Fluent's MongoDB integration is using an outdated version of MongoKitten. Currently we're at MongoKitten 4. MongoKitten 1, which is being used in Fluent currently supports just a fraction of the features with a much worse performance.

JoannisO
  • 875
  • 7
  • 13