mongodb - Mongod Service start exits with code 100 -


problem

my mongo service not start anymore:

root@machine ~ # service mongod start root@machine ~ # service mongod status ● mongod.service - high-performance, schema-free document-oriented database    loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)    active: failed (result: exit-code) since tue 2017-08-15 12:03:51 cest; 2s ago      docs: https://docs.mongodb.org/manual   process: 26942 execstart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)  main pid: 26942 (code=exited, status=100)  aug 15 12:03:50 machine systemd[1]: started high-performance, schema-free document-oriented database. aug 15 12:03:51 machine systemd[1]: mongod.service: main process exited, code=exited, status=100/n/a aug 15 12:03:51 machine systemd[1]: mongod.service: unit entered failed state. aug 15 12:03:51 machine systemd[1]: mongod.service: failed result 'exit-code'. 

where exit code 100 blurry defined as:

returned mongod when process throws uncaught exception.

what did

first, have installed mongodb (3.4.7) on ubuntu 16.04.2 lts via the official guide.

starting , stopping service worked fine. continued enable authentication (again via the official guide).

then added service able to run on server startup.

root@machine ~ # systemctl enable mongod.service 

mongod.conf

i edited config file, passed yaml linter:

# , how store data. storage:   dbpath: /var/lib/mongodb   journal:     enabled: true  #  engine: mmapv1 #  mmapv1: #  wiredtiger:  # write logging data. systemlog:   destination: file   logappend: true   path: /var/log/mongodb/mongod.log  # network interfaces net:   port: 27017   bindip: 127.0.0.1   #processmanagement:  security:   authorization: enabled 

the ownership of file is

root@machine ~ # ls -la /etc/ | grep mongo -rw-r--r--   1 root  root     599 aug 15 11:42 mongod.conf 

dbpath

i know there issues dbpath /var/lib/mongodb has in terms of ownership:

root@ machine ~ # ls -la /var/lib/ | grep mongo drwxr-xr-x  4 mongodb      mongodb      4096 aug 15 11:54 mongodb 

service list

when listing services via service --status-all there no entry mongo related service.

somebody has clue cause issue?


update

as suggested ran following command (with slight modification):

root@machine ~ /usr/bin/mongod --verbose --config /etc/mongod.conf & [1] 28495 

when right, direct execute of binary. allows me @ least login mongo shell:

root@machine ~ # mongo mongodb shell version v3.4.7 connecting to: mongodb://127.0.0.1:27017 mongodb server version: 3.4.7 >  

however, service status still remaining failed exit code 100.


update update

when typing root@machine ~ # /usr/bin/mongod --verbose

i receive following error:

2017-08-15t13:45:40.973+0200 control  [initandlisten] mongodb starting : pid=28642 port=27017 dbpath=/data/db 64-bit host=machine 2017-08-15t13:45:40.973+0200 control  [initandlisten] db version v3.4.7 2017-08-15t13:45:40.973+0200 control  [initandlisten] git version: cf38c1b8a0a8dca4a11737581beafef4fe120bcd 2017-08-15t13:45:40.973+0200 control  [initandlisten] openssl version: openssl 1.0.2g  1 mar 2016 2017-08-15t13:45:40.973+0200 control  [initandlisten] allocator: tcmalloc 2017-08-15t13:45:40.973+0200 control  [initandlisten] modules: none 2017-08-15t13:45:40.973+0200 control  [initandlisten] build environment: 2017-08-15t13:45:40.973+0200 control  [initandlisten]     distmod: ubuntu1604 2017-08-15t13:45:40.973+0200 control  [initandlisten]     distarch: x86_64 2017-08-15t13:45:40.973+0200 control  [initandlisten]     target_arch: x86_64 2017-08-15t13:45:40.973+0200 control  [initandlisten] options: { systemlog: { verbosity: 1 } } 2017-08-15t13:45:40.973+0200 d -        [initandlisten] user assertion: 29:data directory /data/db not found. src/mongo/db/service_context_d.cpp 98 2017-08-15t13:45:40.973+0200 storage  [initandlisten] exception in initandlisten: 29 data directory /data/db not found., terminating 2017-08-15t13:45:40.973+0200 network  [initandlisten] shutdown: going close listening sockets... 2017-08-15t13:45:40.973+0200 network  [initandlisten] shutdown: going flush diaglog... 2017-08-15t13:45:40.973+0200 control  [initandlisten] exiting 2017-08-15t13:45:40.973+0200 control  [initandlisten] shutting down code:100 


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -