Error when using mongod:E NETWORK [initandlisten] listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017…..addr already in use…..E STORAGE [initandlisten] Failed to set up sockets during startup.

MacBook-Air:raceday SG$ mongod

2016-10-02T18:32:53.553+0200 I CONTROL  [initandlisten] MongoDB starting : pid=4027 port=27017 dbpath=/data/db 64-bit host=SG-MacBook-Air.local

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten] db version v3.2.9

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten] git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten] allocator: system

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten] modules: none

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten] build environment:

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten]     distarch: x86_64

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten]     target_arch: x86_64

2016-10-02T18:32:53.554+0200 I CONTROL  [initandlisten] options: {}

2016-10-02T18:32:53.555+0200 E NETWORK  [initandlisten] listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017

2016-10-02T18:32:53.555+0200 E NETWORK  [initandlisten]   addr already in use

2016-10-02T18:32:53.555+0200 E STORAGE  [initandlisten] Failed to set up sockets during startup.

2016-10-02T18:32:53.555+0200 I CONTROL  [initandlisten] dbexit:  rc: 48

SG-MacBook-Air:raceday sharongozcu$ sudo service mongod stop

Password:

sudo: service: command not found

SG-MacBook-Air:raceday SG$ killall -15 mongod

#Don’t kill the process using the -9 signal as it would cause damage:

2016-10-02T18:34:53.538+0200 I CONTROL  [initandlisten] MongoDB starting : pid=4081 port=27017 dbpath=/data/db 64-bit host=SG-MacBook-Air.local

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten] db version v3.2.9

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten] git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten] allocator: system

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten] modules: none

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten] build environment:

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten]     distarch: x86_64

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten]     target_arch: x86_64

2016-10-02T18:34:53.539+0200 I CONTROL  [initandlisten] options: {}

2016-10-02T18:34:53.541+0200 I –        [initandlisten] Detected data files in /data/db created by the ‘wiredTiger’ storage engine, so setting the active storage engine to ‘wiredTiger’.

2016-10-02T18:34:53.542+0200 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1G,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-10-02T18:34:55.265+0200 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker

2016-10-02T18:34:55.265+0200 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory ‘/data/db/diagnostic.data’

2016-10-02T18:34:55.296+0200 I NETWORK  [initandlisten] waiting for connections on port 27017

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s