MongoDB is not working in Arch Linux

Hey, I need mongodb to install in Arch Linux. I have installed mongodb-bin from AUR . Unfortunatily, when i give the cammand mongo , is shows the error

connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-04-02T19:41:53.339-0400 E QUERY [js] Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-04-02T19:41:53.368-0400 F - [main] exception: connect failed
2020-04-02T19:41:53.368-0400 E - [main] exiting with code 1
[muhammad@liba ~]$

Is your mongod up and running on port 27017?
When you issue mongo it tries to connect to default port i,e 27017

1 Like

It works after installing tools.
Thanks for replay

I have the same problem, what tools did you install?

Best regards
/Marcel

By tools probably he meant mongodb tools

I don’t think your error is related to tools
How did you install your mongodb?As a service
If yes check if service is started or not
If it is not started start it

If it is not installed as service you have to start your mongod manually to connect to it by mongo
mongod --port xxxx -dbpath --logpath
Check mongo documentation for command line options

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