Score:0

Mongodb error showing 'MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017' in Ubuntu 20.04.3 (Focal)

sr flag

I am trying to install MongoDB in my Ubuntu 20.04.03 (focal) through the instructions held in MongoDB Official Site

After Successful install, I started the MongoDB service via the command sudo systemctl start mongod

Later, I entered the command sudo systemctl status mongod

The Result was

 mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset>
     Active: failed (Result: signal) since Thu 2021-09-16 18:10:08 IST; 19min a>
       Docs: https://docs.mongodb.org/manual
    Process: 14939 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=ki>
   Main PID: 14939 (code=killed, signal=ILL)
Sep 16 18:10:07 user-desktop systemd[1]: Started MongoDB Database Server.
Sep 16 18:10:08 user-desktop systemd[1]: mongod.service: Main process exited, c>
Sep 16 18:10:08 user-desktop systemd[1]: mongod.service: Failed with result 'si>

For a try, I entered command mongosh

The Result was

`Current Mongosh Log ID:    6143405ddba508a78c45b90c
Connecting to:      mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000
MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017`

When I tried mongod it shows Illegal Instruction

Guys please Tell what to do

Terrance avatar
id flag
I just setup MongoDB 5.0.2 last night as a test and it worked great. See: https://askubuntu.com/a/842599/231142 in the "Ubuntu 20.04 and MongoDB 4.4 or MongoDB 5.0" section. I am wondering if people are having issues because they are adding the `arch=amd64,arm64` which gives 2 different architectures instead of only using like the `amd64` or the `arm64`.
cn flag
`Process: 14939 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=ki> Main PID: 14939 (code=killed, signal=ILL)` you problem is probably with `/etc/mongod.conf`? ECONNREFUSED is mostly 3 things: server location (mostly localhost) and username + password. ` I entered command mongosh` hmm I would try `/usr/bin/mongod --config /etc/mongod.conf`
Aswanth  DS avatar
sr flag
@Rinzwind i tried the command `/usr/bin/mongod --config /etc/mongod.conf` but it shows `illegal construction`
Aswanth  DS avatar
sr flag
how can I do this **server location (mostly localhost) and username + password **
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.