本文介绍了OS X上的mongod HostnameCanonicalizationWorker错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚通过自制软件安装了MOngoDB,并且想通过命令行mongod启动它.
I've just installed MOngoDB via homebrew und want to start it via command line mongod.
当我这样做时,我会收到以下消息:
When I do that, i'll get this message:
2016-03-05T19:23:55.763+0100 I CONTROL [initandlisten] MongoDB starting : pid=52426 port=27017 dbpath=/data/db 64-bit host=Matthias-MBP
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] db version v3.2.3
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] allocator: system
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] modules: none
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] build environment:
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] distarch: x86_64
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] target_arch: x86_64
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] options: {}
2016-03-05T19:23:55.765+0100 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-03-05T19:23:55.765+0100 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-03-05T19:23:56.483+0100 I CONTROL [initandlisten]
2016-03-05T19:23:56.483+0100 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2016-03-05T19:23:56.486+0100 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-03-05T19:23:56.486+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-03-05T19:23:56.488+0100 I NETWORK [initandlisten] waiting for connections on port 27017
2016-03-05T19:23:56.513+0100 W NETWORK [HostnameCanonicalizationWorker] Failed to obtain address information for hostname Matthias-MBP: nodename nor servname provided, or not known
最后一行听起来不正确.有什么问题吗?
The last line doesn't sound correct. What is the problem?
推荐答案
日志的第一行说
MongoDB starting : pid=52426 port=27017 dbpath=/data/db 64-bit host=Matthias-MBP".
请注意主机名是Matthias-MBP
,因此您可以在/etc/hosts
文件中添加127.0.0.1 Matthias-MBP
. Ctrl-C
之后,重新运行mongod
,该错误消息将消失.
Notice that host name is Matthias-MBP
, so you can add 127.0.0.1 Matthias-MBP
in /etc/hosts
file. After Ctrl-C
and re-run mongod
, the error message will disappear.
这篇关于OS X上的mongod HostnameCanonicalizationWorker错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!