Subsystem Windows 10 for Linux. How to install MongoDB

Recently, a new Windows 10 Anniversary Update has recently been published, which includes the Linux subsystem based on Ubuntu 14.04 , and now I want my whole working environment to be in this Linux subsystem.

I am trying to install MongoDB with this instruction from the official site https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list sudo apt-get update sudo apt-get install -y mongodb-org 

After installation is complete, I try to start mongodb using

 sudo service mongodb start 

but error follows

 User@DESKTOP-TPQIRNP :/mnt/c/Users/User$ sudo service mongod start initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused mongod: unrecognized service 

How to install the latest stable version of MongoDB without errors?

+7
source share
2 answers

At the moment, we can see some solutions to this problem in this Microsoft/BashOnWindows here https://github.com/Microsoft/BashOnWindows/issues/796

One working solution https://github.com/Microsoft/BashOnWindows/issues/796#issuecomment-238048520

+1
source

Just ignore the mistake and keep going. From here , explanation:

this error can be safely ignored. WSL does not use Upstart to start processes at system startup. If you work closely with Upstart, this may cause some surprises for you; the message is informative for people who work directly with initctl, upstart, etc. that WSL does not yet reveal this functionality. If this is not your use case, then as you are being observed, Mongodb itself works.

Keep in mind that WSL is still beta and bugs will be everywhere!

0
source

All Articles