我安装了mongodb然后我创建了一个服务来运行它。 启动服务没有问题,但在尝试关闭它时,我得到一个Windows错误代码。我检查了日志文件,这就是我得到的:
2017-02-23T08:36:51.518+0100 I CONTROL [serviceStopWorker] shutting down with code:49
(翻译) 错误1067:进程意外终止
服务路径:
"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --config "C:\Program Files\MongoDB\Server\3.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/
我能找到的唯一参考是这个。关于退出代码的问题/答案的测试。 (问题#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
有什么想法吗?
LOG
2017-02-23T08:36:48.484 + 0100 I CONTROL [main]尝试启动Windows服务' MongoDB'
2017-02-23T08:36:48.485 + 0100 I CONTROL [initandlisten] MongoDB启动:pid = 17856 port = 27017 dbpath = C:\ data \ db 64位主机= 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版本:3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-02-23T08:36:48.485 + 0100 I CONTROL [initandlisten] OpenSSL版本:OpenSSL 1.0.1u-fips 2016年9月22日
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]构建环境:
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]选项:{config:" C:\ Program Files \ MongoDB \ Server \ 3.4 \ bin \ mongod.cfg&#34 ;, 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]由' mmapv1'创建的C:\ data \ db中检测到的数据文件存储引擎,因此将活动存储引擎设置为' 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:没有日志文件存在,无需恢复
2017-02-23T08:36:48.636 + 0100 I JOURNAL [耐久性]耐久性线程开始
2017-02-23T08:36:48.636 + 0100 I JOURNAL [期刊撰稿人]期刊撰稿人帖子开始
2017-02-23T08:36:48.693 + 0100 I CONTROL [initandlisten]
2017-02-23T08:36:48.693 + 0100 I CONTROL [initandlisten] **警告:未对数据库启用访问控制。
2017-02-23T08:36:48.693 + 0100 I CONTROL [initandlisten] **对数据的读写访问权限和配置不受限制。
2017-02-23T08:36:48.693 + 0100 I CONTROL [initandlisten]
2017-02-23T08:36:48.938 + 0100 W FTDC [initandlisten]无法初始化FTDC的性能计数器:WindowsPdhError:PdhExpandCounterPathW失败了,并且Das angegebene Objekt wurde nicht auf dem Computer gefunden。' for counter' \ Memory \ Available Bytes'
2017-02-23T08:36:48.938 + 0100 I FTDC [initandlisten]使用目录' C:/data/db/diagnostic.data'
初始化全时诊断数据捕获2017-02-23T08:36:48.940 + 0100 I NETWORK [thread1]等待端口27017上的连接
2017-02-23T08:36:48.940 + 0100 I STORAGE [initandlisten]服务正在运行
2017-02-23T08:36:51.412 + 0100 I CONTROL [serviceShutdown]从Windows服务控制管理器获得SERVICE_CONTROL_STOP请求,将在当前cmd结束后终止
2017-02-23T08:36:51.412 + 0100 I NETWORK [serviceShutdown] shutdown:关闭侦听套接字......
2017-02-23T08:36:51.412 + 0100 I NETWORK [serviceShutdown]关闭侦听套接字:456
2017-02-23T08:36:51.413 + 0100 I NETWORK [serviceShutdown] shutdown:要刷新diaglog ...
2017-02-23T08:36:51.413 + 0100 I FTDC [serviceShutdown]关闭全时诊断数据捕获
2017-02-23T08:36:51.413 + 0100 I STORAGE [serviceShutdown] shutdown:等待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]旧日志文件将被删除:C:\ data \ db \ journal \ j._0
2017-02-23T08:36:51.439 + 0100 I JOURNAL [serviceShutdown]终止持久性线程......
2017-02-23T08:36:51.516 + 0100 I JOURNAL [期刊撰稿人]期刊撰稿人帖子停止了
2017-02-23T08:36:51.516 + 0100 I JOURNAL [耐久性]持久性线程停止
2017-02-23T08:36:51.516 + 0100 I STORAGE [serviceShutdown] shutdown:关闭所有文件......
2017-02-23T08:36:51.518 + 0100 I STORAGE [serviceShutdown] closeAllFiles()完成
2017-02-23T08:36:51.518 + 0100 I STORAGE [serviceShutdown] shutdown:删除fs lock ...
2017-02-23T08:36:51.518 + 0100 I CONTROL [serviceShutdown]现已退出
2017-02-23T08:36:51.518 + 0100 I CONTROL [serviceStopWorker]关闭代码:49