You are not logged in.

#1 2016-09-27 00:06:32

juanp_1982
Member
From: Halifax, Nova Scotia, Canada
Registered: 2012-09-02
Posts: 69

mongodb service doesn't start when there is two ip addresses

Hello!

in /etc/mongodb.conf file I have this setting bindIp: "127.0.0.1,192.168.1.51", 192.168.1.51 is my private ip given by my router.

when I do systemctl status mongodb:

mongodb.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/usr/lib/systemd/system/mongodb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2016-09-26 17:51:40 CST; 32s ago
   Process: 1070 ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf (code=exited, status=48)
   Main PID: 1070 (code=exited, status=48)


when I check /var/log/mongodb/mongod.log this is what I get:


2016-09-26T17:55:05.129-0600 I CONTROL  [main] ***** SERVER RESTARTED *****
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] MongoDB starting : pid=2916 port=27017 dbpath=/var/lib/mongodb 64-bit host=goku
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] db version v3.2.9
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2i  22 Sep 2016
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] allocator: tcmalloc
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] modules: none
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] build environment:
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten]     distarch: x86_64
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten]     target_arch: x86_64
2016-09-26T17:55:05.135-0600 I CONTROL  [initandlisten] options: { config: "/etc/mongodb.conf", net: { bindIp: "127.0.0.1,
192.168.1.51", port: 27017 }, processManagement: { pidFilePath: "/var/run/mongodb/mongod.pid" }, security: { authorization
: "enabled" }, storage: { dbPath: "/var/lib/mongodb", engine: "wiredTiger", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log", quiet: true } }
2016-09-26T17:55:05.163-0600 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=6G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),f
ile_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-09-26T17:55:05.521-0600 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'
2016-09-26T17:55:05.521-0600 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-09-26T17:55:05.522-0600 I NETWORK  [initandlisten] waiting for connections on port 27017



however I can run systemctl restart mongodb and everything works


I have edited /usr/lib/systemd/system/mongodb.service and added these two lines:

Requires=NetworkManager-dispatcher.service NetworkManager.service
After=syslog.target NetworkManager-dispatcher.service NetworkManager.service


so the one million dollars question, what else should/could I do to make it work on start up time?


thanks for your help :-)

Offline

#2 2016-09-27 00:22:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: mongodb service doesn't start when there is two ip addresses

journalctl _PID=1070

Not a Sysadmin issue, moving to Networking, Servers etc...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB