在Windows上启动MongoDB时出现问题 [英] Problems starting MongoDB on Windows

查看:231
本文介绍了在Windows上启动MongoDB时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了mongodb安装,但是当我尝试在Windows 10控制台中启动时,日志显示以下内容:

I did the mongodb installation, but when I try to start in windows 10 console, the log shows me the following:

C:\ WINDOWS \ system32>"C:\ Program Files \ MongoDB \ Server \ 3.6 \ bin \ mongod.exe"2017-12-13T11:09:06.089-0700 我控制[initandlisten] MongoDB开始:pid = 11240端口= 27017 dbpath = C:\ data \ db \ 64位主机= DESKTOP-5GUM84N 2017-12-13T11:09:06.089-0700我控制了[initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2 2017-12-13T11:09:06.090-0700 I CONTROL [initandlisten]数据库版本v3.6.0 2017-12-13T11:09:06.091-0700 I CONTROL [initandlisten] git版本: a57d8e71e6998a2d0afde7edc11bd23e5661c915 2017-12-13T11:09:06.092-0700 我控制[initandlisten] OpenSSL版本:OpenSSL 1.0.1u-fips 22 2016年9月2017-12-13T11:09:06.092-0700我控制[initandlisten] 分配器:tcmalloc 2017-12-13T11:09:06.092-0700我控制 [initandlisten]模块:无2017-12-13T11:09:06.093-0700 I CONTROL [initandlisten]构建环境:2017-12-13T11:09:06.093-0700 I CONTROL [initandlisten] distmod:2008plus-ssl 2017-12-13T11:09:06.094-0700我控制[initandlisten] distarch: x86_64 2017-12-13T11:09:06.095-0700我控制了[initandlisten]
target_arch:x86_64 2017-12-13T11:09:06.095-0700我控制 [initandlisten]选项:{} 2017-12-13T11:09:06.100-0700 I-
[initandlisten]检测到由C:\ data \ db \创建的数据文件 "wiredTiger"存储引擎,因此将活动存储引擎设置为 "wiredTiger". 2017-12-13T11:09:06.101-0700我存储了[initandlisten] wiretiger_open配置: 创建,cache_size = 3534M,session_max = 20000,逐出=(threads_min = 4,threads_max = 4),config_base = false,统计信息=(fast),log =(enabled = true,archive = true,path = journal,compressor = snappy ),file_manager = {close_idle_time = 100000),statistics_log = {wait = 0},verbose = {recovery_progress}, 2017-12-13T11:09:06.574-0700我存储了[initandlisten] WiredTiger 消息[1513188546:574263] [11240:140724166549840],txn恢复:主要 恢复循环:从10/4608开始2017-12-13T11:09:06.787-0700 I 存储[initandlisten] WiredTiger消息 [1513188546:786400] [11240:140724166549840],txn恢复:恢复 日志10到11 2017-12-13T11:09:07.034-0700我存储 [initandlisten] WiredTiger消息 [1513188547:34042] [11240:140724166549840],txn恢复:恢复日志 11至11 2017-12-13T11:09:07.732-0700我控制[initandlisten] 2017-12-13T11:09:07.732-0700我控制[initandlisten] **警告: 没有为数据库启用访问控制. 2017-12-13T11:09:07.733-0700 I CONTROL [initandlisten] **
对数据和配置的读写访问不受限制. 2017-12-13T11:09:07.735-0700我控制[initandlisten] 2017-12-13T11:09:07.735-0700我控制[initandlisten] **警告: 该服务器绑定到本地主机. 2017-12-13T11:09:07.736-0700 I CONTROL [initandlisten] **远程系统将无法 连接到该服务器. 2017-12-13T11:09:07.736-0700我控制 [initandlisten] **使用--bind_ip启动服务器 指定我控制的IP 2017-12-13T11:09:07.737-0700 [initandlisten] **地址,该地址应来自以下地址: 或--bind_ip_all到2017-12-13T11:09:07.737-0700我控制 [initandlisten] **绑定到所有接口.如果这种行为 需要,开始2017-12-13T11:09:07.738-0700我控制 [initandlisten] **使用--bind_ip 127.0.0.1禁用的服务器 这个警告. 2017-12-13T11:09:07.738-0700我控制[initandlisten] 2017-12-13T11:09:07.739-0700我控制[initandlisten] 2017-12-13T11:09:07.739-0700我控制[initandlisten] **警告: 本机的文件系统缓存配置为大于 占总内存的40%.这会导致内存压力增加 表现不佳. 2017-12-13T11:09:07.740-0700我控制 [initandlisten]参见 http://dochub.mongodb.org/core/wt-windows-系统文件缓存 2017-12-13T11:09:07.740-0700我控制[initandlisten] 2017-12-13T15:09:08.161-0300 W FTDC [initandlisten]失败 初始化FTDC的性能计数器:WindowsPdhError: PdhExpandCounterPathW失败,显示指定的对象不是 在计算机上找到."用于计数器"\ Memory \ Available Bytes" 2017-12-13T15:09:08.161-0300 I FTDC [initandlisten]初始化 具有目录的全时诊断数据捕获 'C:/data/db/diagnostic.data'2017-12-13T15:09:08.165-0300我联网 [initandlisten]等待端口27017上的连接

C:\WINDOWS\system32>"C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe" 2017-12-13T11:09:06.089-0700 I CONTROL [initandlisten] MongoDB starting : pid=11240 port=27017 dbpath=C:\data\db\ 64-bit host=DESKTOP-5GUM84N 2017-12-13T11:09:06.089-0700 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2 2017-12-13T11:09:06.090-0700 I CONTROL [initandlisten] db version v3.6.0 2017-12-13T11:09:06.091-0700 I CONTROL [initandlisten] git version: a57d8e71e6998a2d0afde7edc11bd23e5661c915 2017-12-13T11:09:06.092-0700 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016 2017-12-13T11:09:06.092-0700 I CONTROL [initandlisten] allocator: tcmalloc 2017-12-13T11:09:06.092-0700 I CONTROL [initandlisten] modules: none 2017-12-13T11:09:06.093-0700 I CONTROL [initandlisten] build environment: 2017-12-13T11:09:06.093-0700 I CONTROL [initandlisten] distmod: 2008plus-ssl 2017-12-13T11:09:06.094-0700 I CONTROL [initandlisten] distarch: x86_64 2017-12-13T11:09:06.095-0700 I CONTROL [initandlisten]
target_arch: x86_64 2017-12-13T11:09:06.095-0700 I CONTROL [initandlisten] options: {} 2017-12-13T11:09:06.100-0700 I -
[initandlisten] Detected data files in C:\data\db\ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 2017-12-13T11:09:06.101-0700 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3534M,session_max=20000,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),statistics_log=(wait=0),verbose=(recovery_progress), 2017-12-13T11:09:06.574-0700 I STORAGE [initandlisten] WiredTiger message [1513188546:574263][11240:140724166549840], txn-recover: Main recovery loop: starting at 10/4608 2017-12-13T11:09:06.787-0700 I STORAGE [initandlisten] WiredTiger message [1513188546:786400][11240:140724166549840], txn-recover: Recovering log 10 through 11 2017-12-13T11:09:07.034-0700 I STORAGE [initandlisten] WiredTiger message [1513188547:34042][11240:140724166549840], txn-recover: Recovering log 11 through 11 2017-12-13T11:09:07.732-0700 I CONTROL [initandlisten] 2017-12-13T11:09:07.732-0700 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-12-13T11:09:07.733-0700 I CONTROL [initandlisten] **
Read and write access to data and configuration is unrestricted. 2017-12-13T11:09:07.735-0700 I CONTROL [initandlisten] 2017-12-13T11:09:07.735-0700 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost. 2017-12-13T11:09:07.736-0700 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server. 2017-12-13T11:09:07.736-0700 I CONTROL [initandlisten] ** Start the server with --bind_ip to specify which IP 2017-12-13T11:09:07.737-0700 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to 2017-12-13T11:09:07.737-0700 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the 2017-12-13T11:09:07.738-0700 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning. 2017-12-13T11:09:07.738-0700 I CONTROL [initandlisten] 2017-12-13T11:09:07.739-0700 I CONTROL [initandlisten] 2017-12-13T11:09:07.739-0700 I CONTROL [initandlisten] ** WARNING: The file system cache of this machine is configured to be greater than 40% of the total memory. This can lead to increased memory pressure and poor performance. 2017-12-13T11:09:07.740-0700 I CONTROL [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache 2017-12-13T11:09:07.740-0700 I CONTROL [initandlisten] 2017-12-13T15:09:08.161-0300 W FTDC [initandlisten] Failed to initialize Performance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with 'The specified object is not found on the computer.' for counter '\Memory\Available Bytes' 2017-12-13T15:09:08.161-0300 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data' 2017-12-13T15:09:08.165-0300 I NETWORK [initandlisten] waiting for connections on port 27017

我遵循了

I followed all the intructions in https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#run-mongodb-community-edition but i can't start mongodb. anyone knows how to fix this launch error ?

我希望你能帮到你:c

I hope your help guys :c

致谢!

推荐答案

您的mongod最初实际上一开始就成功启动.日志输出:

Your mongod actually started successfully initially in the beginning. The log output:

NETWORK [initandlisten] waiting for connections on port 27017

表示mongod处于联机状态,正在等待指定端口上的连接.此时,您可能已经在同一台计算机上打开了mongo外壳程序以连接到mongod.

indicates that the mongod is online and waiting for connections on the specified port. You could have at that point opened a mongo shell on the same machine to connect to the mongod.

但是,我了解显示的警告可能表示操作中存在问题.我们已经更新了文档以解决此问题:

However, I understand that the warnings as displayed could indicate that there was an issue in operation. We've updated our documentation to address this:

您可以在以下位置找到有问题的文档: 在Windows上运行MongoDB社区

You can find the documentation in question here: Run MongoDB Community on Windows

看起来其他用户已经帮助您获得了一个良好的工作配置文件,但是我想将原始输出分开,以澄清在那里遇到的任何困惑.

It looks like other users have helped you with getting a good working configuration file, but I'd like to pick apart the original output to clarify any confusion encountered there.

让我们首先分解原始的mongod进程输出:

Lets start by breaking up your original mongod process output:

CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-12-13T11:09:07.733-0700

这是一条警告,表明您未使用身份验证或授权启动mongod进程.由于您似乎正在使用3.6的默认设置,因此这是一个预期的信息警告.如果有机会并计划实施简单的操作,请仔细阅读认证上的MongoDB文档.身份验证,尤其是如果mongod将在任何时间暴露于公共互联网的情况下.

This is a warning that indicates you did not start the mongod process using authentication or authorization. Since it seems like you are using the default settings for 3.6, this is an expected informational warning. Please read through the MongoDB documentation on authentication when you get a chance and plan for implementing simple authentication, especially if the mongod will be exposed to the public internet at any point in time.

下一个警告是:

CONTROL [initandlisten] ** WARNING: This server is bound to localhost. 2017-12-13T11:09:07.736-0700

在MongoDB 3.6中,默认情况下,mongod绑定到本地主机地址.简而言之,mongod仅侦听本地计算机上的连接.这使您有时间在将MongoDB部署打开到专用网络或公用Internet之前配置身份验证.

By default in MongoDB 3.6, the mongod binds to the localhost address. In short, the mongod only listens for connections on the local machine. This gives you time to configure authentication before you open up your MongoDB deployment to your private network or the public internet.

如其他用户所述,您可以通过设置 net.bindIp :

As noted by other users, you can resolve this by setting the net.bindIp in your configuration file:

net:
  bindIp: 127.0.0.1

当您准备好打开mongod到非本地主机的连接时,只需在主机上附加与网络适配器关联的IP地址即可.例如,如果主机具有网络适配器192.168.1.15,则可以将其添加到bindIp.这告诉mongod监听两个地址上的传入连接.

When you are ready to open the mongod to non-localhost connections, just append an IP address associated to a network adapter on the host machine. For example, if the host machine has a network adapter 192.168.1.15, you can add that to bindIp. This tells the mongod to listen for incoming connections on both addresses.

net:
  bindIp: "127.0.0.1,192.168.1.15"

就FTDC警告而言,\Memory\Available Bytes计数器与Windows Performance Management有关-您可以阅读有关

As far as the FTDC warning, the \Memory\Available Bytes counter is related to Windows Performance Management - you can read more about that here. You may need to configure some Windows components to enable that counter. Its also possible that the counter is only available (or accessible) in the Server architectures of Windows.

该警告仅供参考,除非您在工作中严重依赖FTDC数据,否则它不会影响正常运行.

The warning is informational and should not impact normal operations, unless you are heavily reliant on FTDC data for your work.

您可以在我们的日志消息中找到有关MongoDB中日志消息的更多信息.文档.

这篇关于在Windows上启动MongoDB时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆