mongod 正在运行,但将此错误显示为标题。
[root ~]# sudo lsof -i:27017
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mongod 1608 root 7u IPv4 10941 0t0 TCP localhost:27017 (LISTEN)
mongod 1608 root 33u IPv4 11283 0t0 TCP localhost:27017->localhost:30484 (ESTABLISHED)
mongod 1608 root 35u IPv4 11285 0t0 TCP localhost:27017->localhost:30485 (ESTABLISHED)
mongod 1608 root 36u IPv4 11288 0t0 TCP localhost:27017->localhost:30486 (ESTABLISHED)
mongod 1608 root 37u IPv4 11290 0t0 TCP localhost:27017->localhost:30487 (ESTABLISHED)
mongod 1608 root 38u IPv4 11292 0t0 TCP localhost:27017->localhost:30488 (ESTABLISHED)
答案1
mongod 是 Mongo 守护进程的名称。这是您在想要启动或停止服务时指定的内容。您可能想要访问 MongoDB shell 的命令是mongo
。这能解决您的问题吗?
您可能需要检查 MongoDB 的状态以查看它是否实际正在运行:sudo systemctl status mongod