我已将 MacO 升级到 BigSur。从那以后我就无法启动我已经安装的 Mongo。
所以,我决定卸载我的 4.2 Mongo 版本并转到 4.4 版本:
$ brew uninstall mongodb
$ brew install mongodb-community@4.4
一切正常。
运行时我必须升级到 XCode 12(使用 AppStore 应用程序完成)。
一切正常。
现在是启动 Mongo 的时候了:
$ brew services start mongodb-community@4.4
我收到以下错误:
{"t":{"$date":"2021-04-30T10:53:39.834-03: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":"2021-04-30T10:53:39.837-03:00"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2021-04-30T10:53:39.837-03:00"},"s":"I", "c":"NETWORK", "id":4648602, "ctx":"main","msg":"Implicit TCP FastOpen in use."}
{"t":{"$date":"2021-04-30T10:53:39.838-03:00"},"s":"I", "c":"STORAGE", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":9309,"port":27017,"dbPath":"/usr/local/var/mongodb","architecture":"64-bit","host":"MBook1.local"}}
{"t":{"$date":"2021-04-30T10:53:39.838-03:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.5","gitVersion":"ff5cb77101b052fa02da43b8538093486cf9b3f7","modules":[],"allocator":"system","environment":{"distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2021-04-30T10:53:39.838-03:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Mac OS X","version":"20.4.0"}}}
{"t":{"$date":"2021-04-30T10:53:39.838-03:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"config":"/usr/local/etc/mongod.conf","net":{"bindIp":"127.0.0.1"},"storage":{"dbPath":"/usr/local/var/mongodb"},"systemLog":{"destination":"file","logAppend":true,"path":"/usr/local/var/log/mongodb/mongo.log"}}}}
{"t":{"$date":"2021-04-30T10:53:39.839-03:00"},"s":"E", "c":"NETWORK", "id":23024, "ctx":"initandlisten","msg":"Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Permission denied"}}
{"t":{"$date":"2021-04-30T10:53:39.839-03: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":"2021-04-30T10:53:39.839-03:00"},"s":"F", "c":"-", "id":23092, "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}
似乎是“无法取消链接套接字文件”是问题所在。我怀疑这与 BigSur 安全功能有关,但我不知道如何解决。试图在系统偏好设置中查看和“安全偏好设置”,但我找不到 Mongo 问题。
答案 0 :(得分:0)
这是一个权限问题。
错误消息中指出的套接字文件归root所有,其他用户没有权限。日志里特别标注了权限被拒绝,说明brew用来启动服务的账号不是root。
"msg":"Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Permission denied"}
要解决此问题,请使用 sudo rm /tmp/mongodb-27017.sock
手动删除文件,然后尝试启动 mongod。