Reputation: 335
I am trying to install MongoDB in my Linux mint computer and when I type mongod I get the following error,
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] MongoDB starting : pid=13188 port=27017 dbpath=/data/db 64-bit host=umakanth-G3-3579
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] db version v3.6.3
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] allocator: tcmalloc
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] modules: none
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] build environment:
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] distarch: x86_64
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] target_arch: x86_64
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] options: {}
2020-07-14T13:10:15.299+0530 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] now exiting
2020-07-14T13:10:15.299+0530 I CONTROL [initandlisten] shutting down with code:48
Can anyone please help me solve this issue
Upvotes: 0
Views: 60
Reputation: 578
Failed to set up listener: SocketException: Address already in use
Seems that you already have a MongoDB server running on your machine, considering that you are using the default port (27017).
You can, for example, provide another port, then you will probably have 2 mongod
instances running on your machine, or just see if the running daemon is useful to you.
Edit: It is possible that one instance of mongod
already runs in your system. If this is just the native service in your local machine, you can find out by typing: service mongodb status
. Then, in case the service is started, you can try to use it, for example by using the mongo
shell. Simply type mongo
(but note that it will use default username and password).
Upvotes: 1