mongodb - Mongod服务器无法启动
问题描述
我从这里按照 mongodb 官方安装指南来信 到现在为止我尝试过的事情
- 删除并重新安装 mongodb
- 尝试使用 mongodb ubuntu 包(mongod 服务器也不会启动,输出 mongod.service 不存在)
这是我得到的输出
{"t":{"$date":"2021-04-13T13:09:20.760+05:30"},"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":"2021-04-13T13:09:20.763+05:30"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2021-04-13T13:09:20.763+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":"2021-04-13T13:09:20.763+05:30"},"s":"I", "c":"STORAGE", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":5972,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"GL62"}}
{"t":{"$date":"2021-04-13T13:09:20.763+05:30"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.5","gitVersion":"ff5cb77101b052fa02da43b8538093486cf9b3f7","openSSLVersion":"OpenSSL 1.1.1f 31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2021-04-13T13:09:20.763+05:30"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
{"t":{"$date":"2021-04-13T13:09:20.763+05:30"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{}}}
{"t":{"$date":"2021-04-13T13:09:20.763+05:30"},"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":"2021-04-13T13:09:20.763+05:30"},"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":"2021-04-13T13:09:20.763+05:30"},"s":"F", "c":"-", "id":23092, "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}
解决方案
每个日志对象中的s
字段是消息的严重性:I = 信息,W = 警告,E = 错误。
如果您在该日志中查找第一个错误,您将看到它是:
{
"t":{"$date":"2021-04-13T13:09:20.763+05:30"},
"s":"E",
"c":"NETWORK",
"id":23024,
"ctx":"initandlisten",
"msg":"Failed to unlink socket file",
"attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}
}
这是文件权限问题。
您将需要修复上述文件的权限。
推荐阅读
- oracle - 如何使用 Oracle 模拟 PDO::getColumnData()?
- python - 熊猫扩展行数
- apache-kafka - 原因:org.apache.avro.AvroRuntimeException:格式错误的数据。长度为负:-53
- powershell - 如何从其他类中处理通过 Add-Type 添加的类的静态成员?
- amazon-cloudformation - 在 aws config 模板的云形成中将补救操作作为参数传递
- python - python中的连续字母列表并获取它的每个值
- android - 未找到符号 ExoPlayerFactory
- python - Python:请求 url 不接受函数?
- image - 来自未正确预测的图像的 Keras 线性回归模型
- python - 是否有可能拥有一个带有分配给它的值列表的属性?