Reputation: 43
I have just installed Mongodb on my Ubuntu 18 LTS. When I follow the instructions according to the Mongodb Manual, I get some errors in step 3 which is apt update:
Err:11 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 InRelease
403 Forbidden [IP: 143.204.209.210 80]
Err:12 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 InRelease
403 Forbidden [IP: 143.204.209.210 443]
After much trying, I finally installed mongodb with this command,(I removed -org):
sudo apt-get install -y mongodb
after that, I started Mongodb without any errors:
sudo service mongodb start
then I checked the status and everything seems to be fine:
mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset:
Active: active (running) since Thu 2020-04-16 10:32:29 +0430; 25min ago
Docs: man:mongod(1)
Main PID: 1066 (mongod)
Tasks: 23 (limit: 4418)
CGroup: /system.slice/mongodb.service
└─1066 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/
But the problem is when I type "mongod" in my Terminal, I encounter the error code:100 though I have my dbpath:
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] MongoDB starting : pid=4353 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] db version v3.6.3
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] allocator: tcmalloc
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] modules: none
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] build environment:
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] distarch: x86_64
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] target_arch: x86_64
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] options: {}
2020-04-16T11:14:05.161+0430 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] now exiting
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] shutting down with code:100
Does anyone have any idea what my problem is? I checked the previous talks but found nothing on this.
Another thing I have to report is that I use Sudo before mongod but get the same error with mongod.
Upvotes: 0
Views: 1258
Reputation: 43
I think I finally got my answer. Here there are some problems that may cause problems:
1.Uninstalling Mongodb completely is very important. You should remove every each of folders. For this, you can use Mongodb Uninstalling instructions.
3.If the previous step is met, then we can follow the instructions in Mongodb website in order to install your Mongodb.
**** An important thing is sometimes we need to change our IP connection in Configuration of Mongodb ****
Having Mongodb installed in your Computer, a reboot(restart) may be needed. After a restart the system may work correctly.
For running Mongodb in your Terminal type :
Mongod and if it didn't work, try "sudo mongod"
And finally we can enjoy our Mongodb. Goodluck!
Upvotes: 0
Reputation: 43
Finally I installed my Mongodb via changing my DNS because of sanctions problem. Now, I have my mongodb installed but when I type "mongod" in my Ubuntu terminal I get this:
2020-04-17T12:38:01.073+0430 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-17T12:38:01.078+0430 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] MongoDB starting : pid=2476 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] db version v4.2.5
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] git version: 2261279b51ea13df08ae708ff278f0679c59dc32
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] allocator: tcmalloc
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] modules: none
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] build environment:
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] distmod: ubuntu1804
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] distarch: x86_64
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] target_arch: x86_64
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] options: {}
2020-04-17T12:38:01.079+0430 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted
2020-04-17T12:38:01.079+0430 F - [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 684
2020-04-17T12:38:01.079+0430 F - [initandlisten]
***aborting after fassert() failure
And then when I re-run it with the commadand "sudo mongod" I encounter:
2020-04-17T12:42:30.535+0430 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-17T12:42:30.536+0430 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] MongoDB starting : pid=2514 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] db version v4.2.5
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] git version: 2261279b51ea13df08ae708ff278f0679c59dc32
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] allocator: tcmalloc
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] modules: none
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] build environment:
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] distmod: ubuntu1804
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] distarch: x86_64
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] target_arch: x86_64
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] options: {}
2020-04-17T12:42:30.537+0430 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2020-04-17T12:42:30.552+0430 I CONTROL [initandlisten] now exiting
2020-04-17T12:42:30.552+0430 I CONTROL [initandlisten] shutting down with code:48
when I type "sudo systemctl status mongodb", I get this:
Unit mongodb.service could not be found.
But, when I enter this command I get the proper answer: "mongo --eval 'db.runCommand({ connectionStatus: 1 })'"
MongoDB shell version v4.2.5
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("a24c786b-d161-4c3c-91bd-a55198d72505") }
MongoDB server version: 4.2.5
{
"authInfo" : {
"authenticatedUsers" : [ ],
"authenticatedUserRoles" : [ ]
},
"ok" : 1
}
Now, I was wondered what the problem could be?
Upvotes: 0
Reputation: 14490
While you could repair your existing installation, the log output indicates that you installed 3.6 which is 2 versions out of date (current version is 4.2), and is not even the most recent 3.6 release which is 3.6.17. So I suggest you follow the instructions again and prior to doing that, remove any existing files with names like /etc/apt/sources.list.d/mongodb-org-4.2.list
that you may have and remove any installed MongoDB packages.
Upvotes: 1