title: OpenShift - Can't connect to MongoDB
body: <p>I try to connect to MongoDB from my NodeJS App. </p>
  
  <p>The connection is working on my local machine so it has to be a problem with my OpenShift.</p>
  
  <p>In my servercode I use:</p>
  
  <pre><code>mongoose.connect(process.env.OPENSHIFT_MONGODB_DB_URL)
  </code></pre>
  
  <p>But I get the following error in the logs:</p>
  
  <pre><code>DEBUG: Starting child process with 'node server/server.js'
  Warning: connect.session() MemoryStore is not
  designed for a production environment, as it will leak
  memory, and will not scale past a single process.
  Express server listening on port 8080
  /var/lib/openshift/57a1ec260c1e662f1c00009f/app-root/runtime/repo/node_modules/mongoose/node_modules/mongodb/lib/server.js:261
          process.nextTick(function() { throw err; })
                                              ^
  MongoError: failed to connect to sDerver [localhost:27017] on first connect
      at null.&lt;anonymous&gt; (/var/lib/openshift/57a1ec260c1e662f1c00009f/app-root/runtime/repo/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:313:35)
      at emit (events.js:95:17)
      at null.&lt;anonymous&gt; (/var/lib/openshift/57a1ec260c1e662f1c00009f/app-root/runtime/repo/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:271:12)
      at g (events.js:180:16)
      at emit (events.js:98:17)
      at Socket.&lt;anonymous&gt; (/var/lib/openshift/57a1ec260c1e662f1c00009f/app-root/runtime/repo/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:165:49)
      at Socket.g (events.js:180:16)
      at Socket.emit (events.js:95:17)
      at net.js:441:14
      at process._tickCallback (node.js:442:13)
  DEBUG: Program node server/server.js exited with code 8
  </code></pre>