-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install MongoDB in Windows Linux Subsystem #796
Comments
@XSmeets |
@XSmeets I wrote in my issue that everything is working fine (with install mongodb with |
@XSmeets -- you are technically correct that Upstart is responsible for starting applications, but not in the way that you imply here. The The absence of Upstart means that mongodb will not automatically start on reboot; @Zx-EvM will have to re-run nginx and OpenSSH both do fail currently, but not because of Upstart. nginx fails due to an issue related to IPv6 support; see #68 for details and a workaround. OpenSSH fails due to lack of chroot support among other issues; there's discussion on #300 , and the workaround is documented on this forum post. In both cases, the failures are not due to issues involving Upstart. |
Yes. I understand it. but my issue is that for some reason does not work correctly MongoDB (not run) after install as here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ |
If you get the initctl error message about not being able to talk to upstart, and the service doesn't start, you might want to look for the script in /etc/init.d, which is (usually) a standard bash script. Run it like any other bash script, with I've been doing that with sshd, Your mileage may vary, and there may not be a bash script in If you run the script and then it reports an error, you can be sure it is an error in that script or in the way your service runs. Right now, invoking it with the The other option is to find the executable for the service/daemon's executable. Frequently there is a way to make it run from a command line (usually for testing, or special applications). That's even more simple than running it from a bash script. If you can get the executable running that way, you can work from there to getting a script working. Just a comment: right now we are using WSL when many things are broken or not yet implemented. Yes, we all know |
@rodrymbo thanks. If I run MongoDB (which installed using
I don't even have any file related mongodb in |
I'm not familiar enough with upstart or mongodb (yet) to speculate too much. If you use the first method ( |
@Zx-EvM -- ah, sorry, I confused your two recent posts. It looks like the new package really is an Upstart-specific script. That means that you don't start it using Oddly, though, if I install the old version and then (without removing it) I install the new version, then
|
@aseering oh. Thanks! It's work for me |
@aseering That worked :D thanks. |
Incidentally, if anyone reading this wants to start mongodb at system start, I've posted a comment on these sshd instructions that I think explains how to do so: |
Hey! Sorry, but I'm a bit of a noob and I'm not quite able to to follow all of the instructions you guys have laid out. Is there any way one of you can post an exact set of commands for downloading and getting MongoDb running on WSL? I tried this: which threw an error, so I tried again with: and it's still failing to install. Here's the output of that command: Many thanks!! |
@bschwartz757 the only way I managed to make MongoDB works on WSL was to install an old version. |
Ah, dang, that's too bad. I'm doing the Mongo University course right now and thought it might be useful to have a working Mongo instance on WSL, but it wouldn't really make sense to do so with an old version. I guess I'll have to stick with Git Bash for now. Thanks for the response! |
@aseering how did you actually manage to install the new version, if I might ask? I was able to install using the apt-get command others referenced, but I have version 2.4.9 now. Interested in trying out the solution you mentioned. Thanks @acezard I was able to install the old version as you suggested. Still can't get it to run though... |
Hi @bschwartz -- I just installed the old version from Ubuntu "apt", then added the repository containing the new version and installed that. That was several versions of WSL ago, though. Maybe there has been a relevant change or regression? |
Has anyone been able to get the MongoDB version 3.2.9 working on WSL? After following the instructions from @Zx-EvM, I was able to get 3.2.9 installed. |
This is not a WFL problem, the problem is with Ubuntu 14.04:
|
@anton @aseering Huh... I followed the steps on the installation guide and root@blakes-PC:/mnt/c/Windows/System32# mongod --dbpath /mnt/c/data/db/
On Wed, Sep 21, 2016 at 4:39 AM, Anton Suprun [email protected]
|
@bschwartz757 : try deleting the db folder and recreating it. Installing the 3.2.9 was fine for me, but it was crashing after 1 minute because of an issue with wired tiger ('function non implemented') |
Thanks Antonin... My only concern is, that folder is currently not empty on
On Wed, Sep 21, 2016 at 8:27 AM, Antonin Cezard [email protected]
|
Looks like I finally have a working installation!! Thanks all for your help and input. I renamed my windows data/ directory to data_bak/ and things seem to be working now... I even ran a shell script provided by the Mongo University course to create a replica set using the Linux --fork option and it looks like they are all up and running. Connecting with a mongo shell also shows v3.2. I'll keep my fingers crossed that nothing blows up in my face, but this looks like a good sign! |
I got it working with your instructions, too. Note that the service is called |
Just installed the latest round of updates; running mongodb service works fine but when I try to run the mongo shell it causes a blue screen with an error and restarts my computer. Mongodb on the windows side seems to work fine, so I'll go back to that for now. The annoying thing is I was just getting used to being able to use all the handy linux programs while in the shell, now I'm back to git bash and it's "warning: terminal is not fully functional" messages if I try to use vim, less, etc. |
Fear not, the fix is coming soon! |
Excellent! Seemed like I was able to do most things I wanted with MongoDB
On Sun, Oct 2, 2016 at 3:46 PM, Ben Hillis [email protected] wrote:
|
I added mongodb-org repo,
If I start mongodb with dbpath pointing to linux filesystem, then no problem |
Hello there. |
You can solve this issue "copy-pasting" this bash script
|
On the latest Insider build 16273, I am able to:
And, I can see the mongodb service listening on port 27017. |
@Zeioth 's script resolved the issue for me. Windows 10 Pro insider Preview |
Ok you shouldn't have to install the script any differently other than these few changes.... and you shouldn't have to make a directory... it's super odd to have to do it this way and where the break down is occurring I do not know but i will give instructions on how to install everything correctly at this time. IMHO this is a large pile of hoo-diddy from someone and changes should be made... /rant. Oh by the way, this is where i am altering the directions from.... first I purged my mongo so I know everything is from scratch w/ this command:
So what does this do in summary? It installs mongod DB on an ubuntu 16.0.4 linux Windows subsystem... Updates it... and runs it via the start command... hope this helps someone and everything in this thread was awesome but a little verbose and not to the point which is what this summary is for. |
I have tried tips from @xtianus79 and it worked well. Here's what I did,
Then following steps took place
And finally get worked as resulted below 💯
|
MongoDB proper is operable on recent WSL following the canonical install instructions verbatim. On Ubuntu 16.04 (the most recent cited in the instructions) and 17672....
Yields:
The remaining gap is that we don't have
The other way to go is use Ubuntu's Postinstall scripts that depend on the existence of a functioning |
@therealkenc Thanks a lot for the hint! |
Correct. Bad combination of typing and then changing mind and pasting what was actually in my terminal. I've fixed up the post. Or even more correctly, "whatever works", laugh. |
For anyone wondering how to get the latest mongodb-org working with WSL: |
I had also problem installing mongodb on wsl. You might check my answer on another issue related to this one: |
@Mikeysax Thanks a lot for that tutorial! It helped me get everything working but I'm getting "WARNING: shell and server versions do not match" (shell version v4.0.6, server version: 3.6.3). Restarting the service doesn't work. Any ideas? |
I had the same problem to install MongoDB on Ubuntu 18.04 (WSL) and I sorted out by just running:
Not sure why this solution wasn't commented before. Source: https://medium.com/@zhanxucong/installing-mongodb-and-redis-on-wsl-2038a2f6a0a9 |
I was able to fix it by performing following tasks:
then copy and paste the content from this url and save it (you can use vim or any other text editor) After that give executable permission
Now you will be able to start the service by following command
|
This is correct. Somehow for the mongodb-org package (the package described in MongoDB documentation) on WSL Ubuntu (tried on 18.04), the service is not created. If you use sudo apt-get install mongodb you are actually installing and using a different package which may not have an updated version of MongoDB. |
I tried this and got this: |
I had moved on to using Docker. Since Docker works well with WSL on Windows Home Edition 2004 |
Actually, you need to install mongodb first then create the service script. Did you follow this tutorial, https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu to install mongodb before trying my suggested workaround? |
This article may help. There are 2 packages for ubuntu... mongodb (not sure who created this) and mongodb-org (official). It explains which to use in a little more detail. |
I am having this issue too, and I installed mongodb before this. Still getting this fail, and I cannot find anything on how to fix or get the server running. |
Check the log file (should be /var/log/mongod.log), if there is something like this,
Try deleting It may be because of running mongodb manually with |
I try to install MongoDB with this instructions from official website https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
After installation is complete I try to run mongodb with
sudo service mongod start
but have follow error
But If I install MongoDB with
sudo apt-get install mongodb
I can run it withsudo service mongodb start
and this work. But withsudo apt-get install mongodb
will be installed old2.x.x
version of MongoDBHow to install the latest stable version of MongoDB (3.x.x) without errors on Windows Linux Subsystem ?
The text was updated successfully, but these errors were encountered: