MongoDB 返回退出代码 49
MongoDB returning exit code 49
我安装了 mongodb,然后我为 运行 创建了一个服务。
启动该服务没有问题,但在尝试关闭它时,我收到 windows 的错误代码。我检查了日志文件,这是我得到的:
2017-02-23T08:36:51.518+0100 I CONTROL [serviceStopWorker] shutting down with code:49
(翻译)
错误 1067:进程意外终止
服务路径:
"C:\Program Files\MongoDB\Server.4\bin\mongod.exe" --config "C:\Program Files\MongoDB\Server.4\bin\mongod.cfg" --service
mongodb.cfg
systemLog:
destination: file
path: "C:\data\log\mongod.log"
storage:
dbPath: "C:\data\db"
我试图找到错误代码,但它没有出现。
https://docs.mongodb.com/manual/reference/exit-codes/
我能找到的唯一参考是这个。 questions/answers 关于退出代码的测试。 (问题 #7)
http://www.sanfoundry.com/mongodb-questions-answers-exit-codes-statutes/
7. 49 code is returned by mongod from _________ Service control Manager.
a) Linux
b) Windows
c) Ubuntu
d) All of the mentioned
View Answer
Answer:a
Explanation:Custom read preferences and write concerns evaluate tags sets in different ways.
但我在 Windows 7 机器上。所以这很奇怪。
Windows 7 x64 SP1
MongoDB 3.4.2
有什么想法吗?
日志
2017-02-23T08:36:48.484+0100 I CONTROL [main] Trying to start Windows service 'MongoDB'
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] MongoDB starting : pid=17856 port=27017 dbpath=C:\data\db 64-bit host=FRAmdsWS430
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] db version v3.4.2
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] allocator: tcmalloc
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] modules: none
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] build environment:
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] distarch: x86_64
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] target_arch: x86_64
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] options: { config: "C:\Program Files\MongoDB\Server.4\bin\mongod.cfg", service: true, storage: { dbPath: "C:\data\db" }, systemLog: { destination: "file", path: "C:\data\log\mongod.log" } }
2017-02-23T08:36:48.488+0100 I - [initandlisten] Detected data files in C:\data\db created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
2017-02-23T08:36:48.497+0100 I JOURNAL [initandlisten] journal dir=C:\data\db\journal
2017-02-23T08:36:48.497+0100 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2017-02-23T08:36:48.636+0100 I JOURNAL [durability] Durability thread started
2017-02-23T08:36:48.636+0100 I JOURNAL [journal writer] Journal writer thread started
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten]
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten]
2017-02-23T08:36:48.938+0100 W FTDC [initandlisten] Failed to initialize Performance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with 'Das angegebene Objekt wurde nicht auf dem Computer gefunden.' for counter '\Memory\Available Bytes'
2017-02-23T08:36:48.938+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2017-02-23T08:36:48.940+0100 I NETWORK [thread1] waiting for connections on port 27017
2017-02-23T08:36:48.940+0100 I STORAGE [initandlisten] Service running
2017-02-23T08:36:51.412+0100 I CONTROL [serviceShutdown] got SERVICE_CONTROL_STOP request from Windows Service Control Manager, will terminate after current cmd ends
2017-02-23T08:36:51.412+0100 I NETWORK [serviceShutdown] shutdown: going to close listening sockets...
2017-02-23T08:36:51.412+0100 I NETWORK [serviceShutdown] closing listening socket: 456
2017-02-23T08:36:51.413+0100 I NETWORK [serviceShutdown] shutdown: going to flush diaglog...
2017-02-23T08:36:51.413+0100 I FTDC [serviceShutdown] Shutting down full-time diagnostic data capture
2017-02-23T08:36:51.413+0100 I STORAGE [serviceShutdown] shutdown: waiting for fs preallocator...
2017-02-23T08:36:51.413+0100 I STORAGE [serviceShutdown] shutdown: final commit...
2017-02-23T08:36:51.438+0100 I JOURNAL [serviceShutdown] journalCleanup...
2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] removeJournalFiles
2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] old journal file will be removed: C:\data\db\journal\j._0
2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] Terminating durability thread ...
2017-02-23T08:36:51.516+0100 I JOURNAL [journal writer] Journal writer thread stopped
2017-02-23T08:36:51.516+0100 I JOURNAL [durability] Durability thread stopped
2017-02-23T08:36:51.516+0100 I STORAGE [serviceShutdown] shutdown: closing all files...
2017-02-23T08:36:51.518+0100 I STORAGE [serviceShutdown] closeAllFiles() finished
2017-02-23T08:36:51.518+0100 I STORAGE [serviceShutdown] shutdown: removing fs lock...
2017-02-23T08:36:51.518+0100 I CONTROL [serviceShutdown] now exiting
2017-02-23T08:36:51.518+0100 I CONTROL [serviceStopWorker] shutting down with code:49
这似乎是 MongoDB 版本 3.4.2 中引入的错误。查看 https://jira.mongodb.org/browse/SERVER-6065
我安装了 mongodb,然后我为 运行 创建了一个服务。 启动该服务没有问题,但在尝试关闭它时,我收到 windows 的错误代码。我检查了日志文件,这是我得到的:
2017-02-23T08:36:51.518+0100 I CONTROL [serviceStopWorker] shutting down with code:49
(翻译) 错误 1067:进程意外终止
服务路径:
"C:\Program Files\MongoDB\Server.4\bin\mongod.exe" --config "C:\Program Files\MongoDB\Server.4\bin\mongod.cfg" --service
mongodb.cfg
systemLog:
destination: file
path: "C:\data\log\mongod.log"
storage:
dbPath: "C:\data\db"
我试图找到错误代码,但它没有出现。
https://docs.mongodb.com/manual/reference/exit-codes/
我能找到的唯一参考是这个。 questions/answers 关于退出代码的测试。 (问题 #7)
http://www.sanfoundry.com/mongodb-questions-answers-exit-codes-statutes/
7. 49 code is returned by mongod from _________ Service control Manager.
a) Linux
b) Windows
c) Ubuntu
d) All of the mentioned
View Answer
Answer:a
Explanation:Custom read preferences and write concerns evaluate tags sets in different ways.
但我在 Windows 7 机器上。所以这很奇怪。
Windows 7 x64 SP1
MongoDB 3.4.2
有什么想法吗?
日志
2017-02-23T08:36:48.484+0100 I CONTROL [main] Trying to start Windows service 'MongoDB'
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] MongoDB starting : pid=17856 port=27017 dbpath=C:\data\db 64-bit host=FRAmdsWS430
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] db version v3.4.2
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] allocator: tcmalloc
2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] modules: none
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] build environment:
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] distarch: x86_64
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] target_arch: x86_64
2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] options: { config: "C:\Program Files\MongoDB\Server.4\bin\mongod.cfg", service: true, storage: { dbPath: "C:\data\db" }, systemLog: { destination: "file", path: "C:\data\log\mongod.log" } }
2017-02-23T08:36:48.488+0100 I - [initandlisten] Detected data files in C:\data\db created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
2017-02-23T08:36:48.497+0100 I JOURNAL [initandlisten] journal dir=C:\data\db\journal
2017-02-23T08:36:48.497+0100 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2017-02-23T08:36:48.636+0100 I JOURNAL [durability] Durability thread started
2017-02-23T08:36:48.636+0100 I JOURNAL [journal writer] Journal writer thread started
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten]
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten]
2017-02-23T08:36:48.938+0100 W FTDC [initandlisten] Failed to initialize Performance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with 'Das angegebene Objekt wurde nicht auf dem Computer gefunden.' for counter '\Memory\Available Bytes'
2017-02-23T08:36:48.938+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2017-02-23T08:36:48.940+0100 I NETWORK [thread1] waiting for connections on port 27017
2017-02-23T08:36:48.940+0100 I STORAGE [initandlisten] Service running
2017-02-23T08:36:51.412+0100 I CONTROL [serviceShutdown] got SERVICE_CONTROL_STOP request from Windows Service Control Manager, will terminate after current cmd ends
2017-02-23T08:36:51.412+0100 I NETWORK [serviceShutdown] shutdown: going to close listening sockets...
2017-02-23T08:36:51.412+0100 I NETWORK [serviceShutdown] closing listening socket: 456
2017-02-23T08:36:51.413+0100 I NETWORK [serviceShutdown] shutdown: going to flush diaglog...
2017-02-23T08:36:51.413+0100 I FTDC [serviceShutdown] Shutting down full-time diagnostic data capture
2017-02-23T08:36:51.413+0100 I STORAGE [serviceShutdown] shutdown: waiting for fs preallocator...
2017-02-23T08:36:51.413+0100 I STORAGE [serviceShutdown] shutdown: final commit...
2017-02-23T08:36:51.438+0100 I JOURNAL [serviceShutdown] journalCleanup...
2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] removeJournalFiles
2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] old journal file will be removed: C:\data\db\journal\j._0
2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] Terminating durability thread ...
2017-02-23T08:36:51.516+0100 I JOURNAL [journal writer] Journal writer thread stopped
2017-02-23T08:36:51.516+0100 I JOURNAL [durability] Durability thread stopped
2017-02-23T08:36:51.516+0100 I STORAGE [serviceShutdown] shutdown: closing all files...
2017-02-23T08:36:51.518+0100 I STORAGE [serviceShutdown] closeAllFiles() finished
2017-02-23T08:36:51.518+0100 I STORAGE [serviceShutdown] shutdown: removing fs lock...
2017-02-23T08:36:51.518+0100 I CONTROL [serviceShutdown] now exiting
2017-02-23T08:36:51.518+0100 I CONTROL [serviceStopWorker] shutting down with code:49
这似乎是 MongoDB 版本 3.4.2 中引入的错误。查看 https://jira.mongodb.org/browse/SERVER-6065