这是一个创建于 3180 天前的主题,其中的信息可能已经有所发展或是发生改变。
在 Mac 上使用 MongoDB ,使用 homebrew 安装,未修改 MongoDB 的使用权限
运行 sudo mongod
2016-03-06T22:58:30.258+0800 I CONTROL [initandlisten] MongoDB starting : pid=7338 port=27017 dbpath=/data/db 64-bit host=KittyRMBP.lan
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] db version v3.2.1
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] allocator: system
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] modules: none
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] build environment:
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] distarch: x86_64
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] target_arch: x86_64
2016-03-06T22:58:30.259+0800 I CONTROL [initandlisten] options: {}
2016-03-06T22:58:30.260+0800 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-03-06T22:58:30.260+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=9G,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-06T22:58:31.019+0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2016-03-06T22:58:31.019+0800 I CONTROL [initandlisten]
2016-03-06T22:58:31.020+0800 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-03-06T22:58:31.020+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-03-06T22:58:31.021+0800 I NETWORK [initandlisten] waiting for connections on port 27017
2016-03-06T22:58:31.024+0800 W NETWORK [HostnameCanonicalizationWorker] Failed to obtain address information for hostname KittyRMBP.lan: nodename nor servname provided, or not known
出现最后一行报错的是不是由于权限造成的?需要怎么修改配置文件才能把最后一行的问题解决呢?