首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Amazon Linux上启动mongoDB

无法在Amazon Linux上启动mongoDB
EN

Stack Overflow用户
提问于 2020-09-09 04:47:59
回答 1查看 844关注 0票数 0

我使用以下命令启动了mongoDB:

代码语言:javascript
复制
 mongod  --auth --port 27017 --dbpath  /var/lib/mongo

我能够使用mongo shell成功地连接到mongo。然后通过执行ctrl+c来停止该进程。现在,当我再次尝试使用上面的命令启动它时,我得到了这样的结果:

代码语言:javascript
复制
{"t":{"$date":"2020-09-08T20:50:56.894+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2020-09-08T20:50:56.896+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2020-09-08T20:50:56.896+00:00"},"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":"2020-09-08T20:50:56.897+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":21545,"port":27017,"dbPath":"/var/lib/mongo","architecture":"64-bit","host":"ip-172-31-35-217.ec2.internal"}}
{"t":{"$date":"2020-09-08T20:50:56.897+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.0","gitVersion":"563487e100c4215e2dce98d0af2a6a5a2d67c5cf","openSSLVersion":"OpenSSL 1.0.2k-fips  26 Jan 2017","modules":[],"allocator":"tcmalloc","environment":{"distmod":"amazon2","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2020-09-08T20:50:56.897+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Amazon Linux release 2 (Karoo)","version":"Kernel 4.14.138-114.102.amzn2.x86_64"}}}
{"t":{"$date":"2020-09-08T20:50:56.897+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"port":27017},"security":{"authorization":"enabled"},"storage":{"dbPath":"/var/lib/mongo"}}}}
{"t":{"$date":"2020-09-08T20:50:56.897+00:00"},"s":"E",  "c":"NETWORK",  "id":23024,   "ctx":"initandlisten","msg":"Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
{"t":{"$date":"2020-09-08T20:50:56.897+00:00"},"s":"F",  "c":"-",        "id":23091,   "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":40486,"file":"src/mongo/transport/transport_layer_asio.cpp","line":919}}
{"t":{"$date":"2020-09-08T20:50:56.897+00:00"},"s":"F",  "c":"-",        "id":23092,   "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}

因此,我尝试了多种方法来停止该过程。但这个过程并没有被扼杀。我还尝试使用--shutdown选项运行相同的命令,然后它显示"killing process and“,但它仍然挂起,并且从未结束该命令。我还尝试使用不同的端口运行相同的命令,但也出现了错误:

代码语言:javascript
复制
{"t":{"$date":"2020-09-08T20:42:00.697+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2020-09-08T20:42:00.699+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2020-09-08T20:42:00.699+00:00"},"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":"2020-09-08T20:42:00.699+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":21444,"port":27018,"dbPath":"/var/lib/mongo","architecture":"64-bit","host":"ip-172-31-35-217.ec2.internal"}}
{"t":{"$date":"2020-09-08T20:42:00.699+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.0","gitVersion":"563487e100c4215e2dce98d0af2a6a5a2d67c5cf","openSSLVersion":"OpenSSL 1.0.2k-fips  26 Jan 2017","modules":[],"allocator":"tcmalloc","environment":{"distmod":"amazon2","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2020-09-08T20:42:00.699+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Amazon Linux release 2 (Karoo)","version":"Kernel 4.14.138-114.102.amzn2.x86_64"}}}
{"t":{"$date":"2020-09-08T20:42:00.699+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"port":27018},"security":{"authorization":"enabled"},"storage":{"dbPath":"/var/lib/mongo"}}}}
{"t":{"$date":"2020-09-08T20:42:00.700+00:00"},"s":"E",  "c":"STORAGE",  "id":20557,   "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"DBPathInUse: Unable to lock the lock file: /var/lib/mongo/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /var/lib/mongo directory"}}
{"t":{"$date":"2020-09-08T20:42:00.700+00:00"},"s":"I",  "c":"NETWORK",  "id":20562,   "ctx":"initandlisten","msg":"Shutdown: going to close listening sockets"}
{"t":{"$date":"2020-09-08T20:42:00.700+00:00"},"s":"I",  "c":"-",        "id":20520,   "ctx":"initandlisten","msg":"Stopping further Flow Control ticket acquisitions."}
{"t":{"$date":"2020-09-08T20:42:00.700+00:00"},"s":"I",  "c":"CONTROL",  "id":20565,   "ctx":"initandlisten","msg":"Now exiting"}
{"t":{"$date":"2020-09-08T20:42:00.700+00:00"},"s":"I",  "c":"CONTROL",  "id":23138,   "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":100}}
EN

回答 1

Stack Overflow用户

发布于 2020-09-09 04:50:11

您只停止了Mongo shell (或者在默认情况下mongod派生到后台,并且您没有对它的直接ctrl+c控制)。

您可以使用pkill -f mongod杀死名称中包含mongod的所有进程。我不一定要在生产MongoDB上这样做,但这看起来像是一个开发环境。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63801363

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档