dokku-mongodb-plugin
dokku-mongodb-plugin copied to clipboard
Can't make a remote connection
I can't seem to create a connection from a remote machine to MONGO_URL.
I guess there may be some Mongo setting that is preventing remote connections? Could this be changed?
Which MONGO_URL are you referring to? what is set inside your dokku app?
And by remote machine, do you mean something other than the app or the dokku host?
Yes, the one from doing 'dokku config appname'.
And yes, that's what I mean by 'remote machine' (it's my Macbook). I want to browse the mongo database with the lovely robomongo (http://robomongo.org/).
+1 to this. I'm having the same issue.
I noticed that when I run "dokku config
I'm trying to run "mongorestore" from my laptop to push a db backup onto mongo running on my droplet. Since mongo actually runs outside of the docker VM it should have nothing to do with my dokku app... correct? Using my droplet's IP and the default port 27017 causes a failed connection attempt. :/
Got my mongorestore to work using the droplet's IP (not the MONGODB_HOST IP) and port 49156. This port may be different on your mongo instance. On your droplet run "dokku mongodb:console". It will display a port number that you can use externally.
I'm still not sure why port 27017 doesn't work. When I run "sudo docker ps -a" I see the following line which makes it look like port fwding is setup on 27017 to the mongo db:
92e2777cb4fa jeffutter/mongodb:latest /usr/bin/mongod --db 10 hours ago Up 2 minutes 0.0.0.0:49156->27017/tcp dokku-mongodb
the docker ps -a there is showing that docker is forwarding port 49156 on the host to 27017 on the mongodb container.
I managed to connect it to robomongo, you need the host ip, mongo docker container port and the admin password that can be found on your dokku host here: /home/dokku/.mongodb/admin_pw
I have the same problem and I tried to resolve following the comments without success.
under dokku mongodb:info zombts zombts
the terminal report me:
echo " Host: mongodb"
echo " Port: 27017"
echo " User: zombts"
echo " Password: PWD"
echo " Database: zombts"
echo
echo " MONGODB_URL=mongodb://zombts:PWD@mongodb:27017/zombts"
Obviously the Host is wrong, but why print mongodb
instead of the IP of the host? On the other hand, I know the IP, so how I can connect with the container?
If I print the containers with docker ps -a
:
root@zombeats:/home# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9bb043653336 dokku/zombts:deployed "/start" 6 days ago Up 6 days 5000/tcp app_zombts_1426962032_16369
36d26bb052aa busybox:buildroot-2014.02 "true" 6 days ago Exited (0) 6 days ago cache_data_zombts
9b98ea49b3b0 ayufan/dokku-alt-mongodb:latest "/usr/bin/start_mong 6 days ago Up 6 days 27017/tcp mongodb_single_container
d2a5dcadd44a dokku/kikobeats-blog:deployed "/start" 7 days ago Up 7 days 5000/tcp app_kikobeats-blog_1426940104_29078
01c804801ca6 ayufan/dokku-alt-mariadb:latest "/usr/bin/start_mari 7 days ago Up 7 days 3306/tcp mariadb_single_container
8eeb59abbd54 busybox:buildroot-2014.02 "true" 7 days ago Exited (0) 7 days ago cache_data_kikobeats-blog
EDIT: I running the command using docker exec
. After this I inspect the container using docker inspect 9b98ea49b3b0 | grep IPAddress
to check what IP Adress has being exposing and voilá!:
"IPAddress": "172.17.0.11"
Private address is not possible to resolve, so basically is necessary expose the correct IP of the machine