amazon web services - Mongoose connection to mongodb on EC2 stuck on "Connecting" -
i created ubuntu machine on ec2 month or standard free tier image ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20170110 (ami-49c9295f)
running ubuntu 14.
mongoose version 3.8.40
mongodb version (mongoose dep in node modules) 1.4.38
mongodb version on server gives: mongodb shell version: 3.0.14
i've tried pretty straight forward connection examples such shown in project: https://github.com/simonholmes/mongoose-default-connection
var dburi = 'mongodb://localhost/connectiontest'; mongoose.connect(dburi) mongoose.connection.on('connected', function () { console.log('mongoose default connection open ' + dburi); }
this works locally, not on ec2 server. i've tried switching "mongodb://127.0.0.1/connectiontest"
, "mongodb://127.0.0.1:27017/connectiontest"
none has worked.
execution goes on line no connection established. when log connection state, it's on"connecting". same code worked on earlier ec2 ubuntu server had.
hope here can :) thanks
Comments
Post a Comment