mongodb - Can not connect to Mongo docker instance via mono client on mac -


i have installed mongo docker image , run using commands (mac boot2docker installed)

docker pull mongo 

and

docker run --name some-mongo -d mongo 

but want connect via mongo client running:

mongo --port 27017 --host 127.0.0.1 

but error message:

mongodb shell version: 3.0.4 connecting to: 127.0.0.1:27017/test 2015-07-27t14:22:24.088+0300 w network  failed connect 127.0.0.1:27017, reason: errno:61 connection refused 2015-07-27t14:22:24.094+0300 e query    error: couldn't connect server 127.0.0.1:27017 (127.0.0.1), connection attempt failed     @ connect (src/mongo/shell/mongo.js:181:14)     @ (connect):1:6 @ src/mongo/shell/mongo.js:181 exception: connect failed 

it clear me docker fails expose ports since telnet 27017 on localhost fails well.

what hack doing wrong?

you have 2 problems :

like h3nrik said should connect boot2docker vms address. if don't know use following command :

boot2docker ip

and port isn't open in first place.

your docker run command should :

docker run -p 27017:27017 --name some-mongo -d mongo


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -