Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongod HostnameCanonicalizationWorker error on OS X

Tags:

mongodb

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?

like image 439
FNGR Avatar asked Mar 05 '16 18:03

FNGR


2 Answers

The first line of logs says

MongoDB starting : pid=52426 port=27017 dbpath=/data/db 64-bit host=Matthias-MBP". 

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.

like image 136
X.C. Avatar answered Oct 24 '22 09:10

X.C.


  1. $ cd /private/etc
  2. open hosts file in that directory
  3. copy the following code:

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##
    127.0.0.1   localhost
    127.0.0.1 Matthias-MBP
    255.255.255.255 broadcasthost
    ::1             localhost 
    
like image 33
dandersendev Avatar answered Oct 24 '22 09:10

dandersendev