简体   繁体   English

当我在终端中键入 mongodb 命令时,终端正在退出

[英]Terminal is exiting when i type mongodb command in the terminal

I am trying to install MongoDB in my Linux mint computer and when I type mongod I get the following error,我正在尝试在我的 Linux 薄荷计算机中安装 MongoDB,当我输入 mongod 时,出现以下错误,

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谁能帮我解决这个问题

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).考虑到您使用的是默认端口(27017),您似乎已经在您的机器上运行了 MongoDB 服务器。

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.例如,您可以提供另一个端口,然后您的机器上可能会运行 2 个mongod实例,或者只是查看正在运行的守护程序是否对您有用。

Edit : It is possible that one instance of mongod already runs in your system.编辑mongod的一个实例可能已经在您的系统中运行。 If this is just the native service in your local machine, you can find out by typing: service mongodb status .如果这只是您本地机器中的本机服务,您可以通过键入以下内容来查找: service mongodb status Then, in case the service is started, you can try to use it, for example by using the mongo shell.然后,如果服务启动,您可以尝试使用它,例如使用mongo shell。 Simply type mongo (but note that it will use default username and password).只需键入mongo (但请注意,它将使用默认用户名和密码)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM