Install and setup mongodb on arch linux

Current Mongosh Log ID: 62a418c7740d6e8837461793
Connecting to:          mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.5.0
MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017

I have referenced ArchWiki and checked the official one for UBUNTU too.

Steps I have taken for installation till now
Installed mongodb-tools-bin, monodb-bin and mongosh-bin from aur.
sudo systemctl start mongodb here is a conflict archWiki asks to do mongodb while everyone else on StackOverflow and even official ubuntu installation guide asks for mongod.
Hence, I tried sudo systemctl start mongod too and got that didn’t found error tried daemon-reload but nothing changed(still not found).
Assuming starting mongodb have worked because it didn’t throw any error. I went for mongosh and the error is posted at the top.

May be your mongodb is not up
What does sudo systemctl status mongodb shows?
You can check mongodb.log also
Under installed dir/bin you can check what is your binary mongodb or mongod

I have tried checking status earlier too but was getting lots of variables only. Probably that time it was taking time for it’s first setup. Right now it is getting failed with “core-dumped”
where mongod says /usr/bin/mongod, mongodb wasn’t found. So this seems now clear service name is mongodb.service while daemon is mongod.

Following this,

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_

I think i do have sse and i hope i can conclude this should work on my cpu architecture(however, i do have low computing power)

Changing the ownership of these files helped me.

sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock

Oh! it’s quite old post. I actually later found there were multiple alternatives of mongodb in AUR like mongodb44, mongodb50, mongodb40, mongodb32 etc. Just simply try many of them, eventually you will find the one that works for you. I was using a very old laptop then and mongodb44 worked at that time.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.