If you try to start mongodb on WSL using systemd you will be getting this error.
System has not been booted with systemd as init system (PID 1). Can’t operate.
There seems to be no init script for mongodb 4 on ubuntu 18.04(may be other versions too). This makes it complicated for starting mongodb in WSL as systemctl is not supported on WSL. Inorder to have a init script so that you can start using service mongodb start
we need to have the init file.
Thankfully init file is already provivided by mongodb here
https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d
Follow the below steps to get the mongodb running on WSL
sudo curl -o /etc/init.d/mongodb https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d
sudo chmod +x mongodb
sudo service mongodb start
This should successfully start mongodb.
Njoy smile
Plate Base FALCAM F38 Ulanzi Uka PGYTECH SNAPLOCK PeakDesign Falcam F38 ⬤ ✕ ✕ ✕…
I really thought I would keep up with the blog in 2024. But, it didn't…
Oh boy, there were a lot of things that happened this year. Like last year,…
This has become a abandoned blog. I will try to fix things this year. More…
Let me start off by saying, i have more blog posts this year than the…
This happened because your windows has run out of space. If you get this error…
This website uses cookies.