2016-03-05 18 views
8

Ich habe gerade MOngoDB über Homebrew installiert und möchte es über die Befehlszeile mongod starten.mongod HostnameCanonicalizationWorker Fehler auf OS X

Wenn ich das tue, werde ich diese Meldung:

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 

Die letzte Zeile nicht richtig klingen. Was ist das Problem?

Antwort

23

Die erste Zeile von Protokollen sagt

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

Beachten Sie, dass Hostname ist Matthias-MBP, so dass Sie 127.0.0.1 Matthias-MBP in /etc/hosts Datei hinzufügen können. Nach Ctrl-C und erneutem Ausführen mongod wird die Fehlermeldung verschwinden.

8
  1. $ cd /private/etc
  2. offenen Hosts-Datei in diesem Verzeichnis
  3. den folgenden Code kopieren:

    ## 
    # 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