title: Can't connect to MongoDB Atlas from CentOS using NodeJS
body: <p>I've created a cluster on MongoDB Atlas and have successfully connected to it using Compass and also using Node running locally. 
  When I try to run the same code on my CentOS machine i get an <code>ECONNREFUSED</code>error. Here is my Node code </p>
  
  <pre><code>const MongoClient = require('mongodb').MongoClient;
  const uri = "mongodb+srv://myuser:mypass@tablematic-0-z4nuk.gcp.mongodb.net/test?retryWrites=true&amp;w=majority";
  const client = new MongoClient(uri, { useNewUrlParser: true });
  client.connect(err =&gt; {
    const collection = client.db("test").collection("devices");
    console.log("ERROR: " + err);
  
    client.close();
  });
  </code></pre>
  
  <p><code>myuser</code> and <code>mypass</code> are replaced by my actual username and password here. </p>
  
  <p>I've opened up server's firewall for ports <code>27015</code>, <code>27016</code> and <code>27017</code>.
  Atlas is set up to accept connections from any incoming IP.</p>
  
  <p>I really can't think of what might be causing it...</p>