Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration
Last updated 2 years ago.
0

I think we can install mongodb on host (running windows/linux), and then config to allow remote connect. By this way we don't need to custom the vagrant box (or install by some commands through vagrantfile).

Last updated 2 years ago.
0

I think we can add a simple shell provision for mongodb, like this: https://github.com/fideloper/Vaprobash/blob/master/scripts/mongodb.sh

Last updated 2 years ago.
0

xgenvn said:

I think we can install mongodb on host (running windows/linux), and then config to allow remote connect. By this way we don't need to custom the vagrant box (or install by some commands through vagrantfile).

I'd like mongodb running on the VM, just like redis, nginx, etc. The goal is to make the development environment repeatable.

angelside said:

I think we can add a simple shell provision for mongodb, like this: https://github.com/fideloper/Vaprobash/blob/master/scripts/mongodb.sh

Again, that would work for installing mongo locally, not so good for installing on the VM. Could be executed over ssh, so an option, but doesn't handle things like port forwarding, etc.

Last updated 2 years ago.
0

Not sure it's the right place to post my question, but it's very pertinent

I can't get MongoDB to work, I installed it and it works in the VM, I also forwarded the port 27170 by adding this line to scripts/homestead.rb:

config.vm.network "forwarded_port", guest: 27017, host: 27170

but when I try to run mongo --port 27170 in local, I get this error:

DBClientCursor::init call() failed
Error: DBClientBase::findN: transport error: 127.0.0.1:27170 ns: admin.$cmd query: { whatsmyuri: 1 } at src/mongo/shell/mongo.js:147
exception: connect failed
Last updated 2 years ago.
0

@epitomus Shell provisioners run on the VM, not locally, and would be your best bet of installing new functionality to Homestead, I guess. Doesn't make sense to use a fully fledged provisioner just to add that one bit, even if they're easier to use. So, just fork the homestead project, create your shell provisioner and add it to scripts/homestead.rb as per the Vagrant docs.

Last updated 2 years ago.
0

@cerbero90

I add the same issue than you and fixed it by editing the mongod.conf file in /etc and changing the bind_ip line from 127.0.0.1 to 0.0.0.0 and then sudo service mongod restart You can also run netstat -anp | grep 27017 to check your changes.

Now I can use robomongo from windows to manage the dbs :)

Last updated 2 years ago.
0

I've make a file with all the Vaprobash scripts that can be used with Homestead.

I've only tested Mongodb, but it should all work.

https://github.com/kaamaru/homestead

Last updated 2 years ago.
0

Thank you @Dpblandin , now it works!

Also thank you @kaamaru , very helpful :)

Last updated 2 years ago.
0

As for me just rebinding to 0.0.0.0 didn't help: in this case I could connect from my Windows system, but my applications on Homestead failed to connect to mongo. As a solution, I wrote two bindings for bind_ip:

bind_ip = 10.0.2.15,127.0.0.1

Now everything works perfectly.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

epitomus epitomus Joined 17 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.