mongodb正在等待连接

mongodb正在等待连接,mongodb,Mongodb,我下载了mongodb 4.4,在我的C:驱动器中创建了一个data/db文件夹,然后从bin文件夹运行mongod,打开另一个cmd,导航到bin文件夹,然后输入命令mongo。通常的东西 问题是,即使在这样做之后,mongod提示符中仍会显示“msg”:“等待连接”,“attr”:{“port”:27017,“ssl”:“off”}消息 我已经看过了很多其他可能的副本,比如 但是他们都有相同的问题,没有实际启动另一个提示符并运行mongo命令。我似乎已经这样做了,但仍然没有得到连接,我做错了

我下载了mongodb 4.4,在我的
C:
驱动器中创建了一个
data/db
文件夹,然后从bin文件夹运行mongod,打开另一个cmd,导航到bin文件夹,然后输入命令
mongo
。通常的东西

问题是,即使在这样做之后,mongod提示符中仍会显示
“msg”:“等待连接”,“attr”:{“port”:27017,“ssl”:“off”}
消息

我已经看过了很多其他可能的副本,比如 但是他们都有相同的问题,没有实际启动另一个提示符并运行
mongo
命令。我似乎已经这样做了,但仍然没有得到连接,我做错了什么

我会附上完整的提示信息以防万一

对于带有
mongod
的提示:

{"t":{"$date":"2020-09-25T13:49:39.394+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":"2020-09-25T13:49:39.401+05:30"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2020-09-25T13:49:39.402+05:30"},"s":"I",  "c":"NETWORK",  "id":4648602, "ctx":"main","msg":"Implicit TCP FastOpen in use."}
{"t":{"$date":"2020-09-25T13:49:39.404+05:30"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1912,"port":27017,"dbPath":"C:/data/db/","architecture":"64-bit","host":"DESKTOP-T5551NK"}}
{"t":{"$date":"2020-09-25T13:49:39.404+05:30"},"s":"I",  "c":"CONTROL",  "id":23398,   "ctx":"initandlisten","msg":"Target operating system minimum version","attr":{"targetMinOS":"Windows 7/Windows Server 2008 R2"}}
{"t":{"$date":"2020-09-25T13:49:39.406+05:30"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.1","gitVersion":"ad91a93a5a31e175f5cbf8c69561e788bbc55ce1","modules":[],"allocator":"tcmalloc","environment":{"distmod":"windows","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2020-09-25T13:49:39.407+05:30"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Microsoft Windows 10","version":"10.0 (build 18362)"}}}
{"t":{"$date":"2020-09-25T13:49:39.410+05:30"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{}}}
{"t":{"$date":"2020-09-25T13:49:39.413+05:30"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"C:/data/db/","storageEngine":"wiredTiger"}}
{"t":{"$date":"2020-09-25T13:49:39.414+05:30"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=3580M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}}
{"t":{"$date":"2020-09-25T13:49:39.465+05:30"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1601021979:464882][1912:140716129672784], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 5 through 6"}}
{"t":{"$date":"2020-09-25T13:49:39.687+05:30"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1601021979:686885][1912:140716129672784], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 6 through 6"}}
{"t":{"$date":"2020-09-25T13:49:39.934+05:30"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1601021979:933879][1912:140716129672784], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Main recovery loop: starting at 5/5248 to 6/256"}}
{"t":{"$date":"2020-09-25T13:49:40.247+05:30"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1601021980:246880][1912:140716129672784], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 5 through 6"}}
{"t":{"$date":"2020-09-25T13:49:40.420+05:30"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1601021980:419880][1912:140716129672784], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 6 through 6"}}
{"t":{"$date":"2020-09-25T13:49:40.587+05:30"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1601021980:586885][1912:140716129672784], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global recovery timestamp: (0, 0)"}}
{"t":{"$date":"2020-09-25T13:49:40.587+05:30"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1601021980:586885][1912:140716129672784], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global oldest timestamp: (0, 0)"}}
{"t":{"$date":"2020-09-25T13:49:40.611+05:30"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":1197}}
{"t":{"$date":"2020-09-25T13:49:40.611+05:30"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2020-09-25T13:49:40.621+05:30"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
{"t":{"$date":"2020-09-25T13:49:40.625+05:30"},"s":"W",  "c":"CONTROL",  "id":22120,   "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
{"t":{"$date":"2020-09-25T13:49:40.626+05:30"},"s":"W",  "c":"CONTROL",  "id":22140,   "ctx":"initandlisten","msg":"This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning","tags":["startupWarnings"]}
{"t":{"$date":"2020-09-25T13:49:40.636+05:30"},"s":"I",  "c":"STORAGE",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
{"t":{"$date":"2020-09-25T13:49:41.231+05:30"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"C:/data/db/diagnostic.data"}}
{"t":{"$date":"2020-09-25T13:49:41.237+05:30"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}}
{"t":{"$date":"2020-09-25T13:49:41.237+05:30"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}

仍然没有找到问题的解决方案,但设法找到了解决方法


因此,对于其他对此感到困扰的人,我所做的是使用MongoDBCompass。我从那里手动连接到端口,然后一切正常。因此,如果其他一切都失败了,这是一种迂回的方法。

这里没有什么可混淆的。一旦数据库启动,您就可以打开一个新的cmd,保持上一个会话打开并启动mongoshell


无需下载其他软件mongoDBcompass。

您已经启动了
mongod
(MongoDB服务器)。然后启动
mongo
shell。现在,您可以在shell中输入一些命令。请参阅,“等待连接”只是指数据库服务器已启动并正在运行,客户机现在可以在给定端口上连接。这不是一个错误,这是成功的信息。我不确定你们两个是否都明白我的问题。我会尽量说清楚的@prasad_uuu是的,我可以这样做,但我希望mongodb服务器确认连接,表明它收到了连接请求并接受了它,即执行它应该执行的操作。@mtj这是正确的,它不是错误消息。然而,这不是我的问题。问题是服务器为什么不确认连接请求。“。客户端现在可以连接到端口”->这就是问题所在,我无法。正如我在问题中解释的,在上面的评论中,我希望mongodb服务器确认连接,表明它收到了连接请求并接受了它,即做它应该做的事情。
MongoDB shell version v4.4.1
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("37c03a8f-8741-4880-9a80-32bf36700e45") }
MongoDB server version: 4.4.1
---
The server generated these startup warnings when booting:
        2020-09-25T13:10:27.011+05:30: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
---
---
        Enable MongoDB's free cloud-based monitoring service, which will then receive and display
        metrics about your deployment (disk utilization, CPU, operation statistics, etc).

        The monitoring data will be available on a MongoDB website with a unique URL accessible to you
        and anyone you share the URL with. MongoDB may use this information to make product
        improvements and to suggest MongoDB products and deployment options to you.

        To enable free monitoring, run the following command: db.enableFreeMonitoring()
        To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---
>