Score:0

Failed to install Mongodb-org in Ubuntu 22.04

cn flag

tried installing mongodb-org several times in my ubuntu 22.04 and followed many youtube videos as well as document tutorials but failed to install it.

{"t":{"$date":"2022-10-14T23:57:58.874+05:30"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"} {"t":{"$date":"2022-10-14T23:57:58.879+05:30"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"main","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":true}}} {"t":{"$date":"2022-10-14T23:57:58.879+05:30"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"} {"t":{"$date":"2022-10-14T23:57:58.879+05:30"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."} {"t":{"$date":"2022-10-14T23:57:58.882+05:30"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"} {"t":{"$date":"2022-10-14T23:57:58.882+05:30"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","ns":"config.tenantMigrationDonors"}} {"t":{"$date":"2022-10-14T23:57:58.882+05:30"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","ns":"config.tenantMigrationRecipients"}} {"t":{"$date":"2022-10-14T23:57:58.882+05:30"},"s":"I", "c":"CONTROL", "id":5945603, "ctx":"main","msg":"Multi threading initialized"} {"t":{"$date":"2022-10-14T23:57:58.883+05:30"},"s":"I", "c":"CONTROL", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":6365,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"naeemgg"}}

running mongod showing the above and checking status shows

`mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2022-10-14 23:13:54 IST; 53min ago Docs: https://docs.mongodb.org/manual Process: 2037 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=14) Main PID: 2037 (code=exited, status=14) CPU: 964ms

Oct 14 23:13:53 johns systemd[1]: Started MongoDB Database Server. Oct 14 23:13:54 johns systemd[1]: mongod.service: Main process exited, code=exited, status=1> Oct 14 23:13:54 johns systemd[1]: mongod.service: Failed with result 'exit-code'.`

Running mongo shows :

MongoDB shell version v5.0.13 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 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:372:17 @(connect):2:6 exception: connect failed exiting with code 1

Terrance avatar
id flag
I just setup MongoDB 6.0 on Ubuntu 22.04 and I got it to work. It is a bit unconventional right now since MongoDB repos are not ready for 22.04 yet or they are still under construction. See https://askubuntu.com/a/842599/231142 and it is the bottom section of my answer titled Ubuntu22.04 and MongoDB 6.0.
Naeem Navjivan avatar
cn flag
I followed the same steps as you described in your answer @Terrance but end up with mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset> Active: failed (Result: exit-code) since Sun 2022-10-16 21:18:07 IST; 15s > Docs: https://docs.mongodb.org/manual Process: 11577 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=ex> Main PID: 11577 (code=exited, status=14) CPU: 881ms
Terrance avatar
id flag
https://askubuntu.com/questions/823288/mongodb-loads-but-breaks-returning-status-14
Score:0
gg flag

use systemctl instead of service. Also after installing delete the sock file

sudo rm -rf /var/lib/mongodb-27017.sock

Then restart mongodb with systemctl as it uses SystemD in latest Ubuntu releases or even in Ubuntu older version like 20.04 LTS

sudo systemctl start mongod

Running with service causes errors

I sit in a Tesla and translated this thread with Ai:

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.