You are not logged in.

#1 2018-11-16 16:07:29

Aggressor
Member
Registered: 2018-11-16
Posts: 13

mongodb not starting at boot

if i run "systemctl start mongodb" mongo starts and i run "systemctl enable mongodb" and when i reboot mongo wont start automatically, tried reinstalling it but same

Offline

#2 2018-11-16 16:11:04

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,094

Re: mongodb not starting at boot

Check your journal/service status on reboot.

Offline

#3 2018-11-16 16:17:37

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

can you please explain how to check that ? sorry new to arch

Last edited by Aggressor (2018-11-16 16:17:52)

Offline

#4 2018-11-16 16:47:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,094

Re: mongodb not starting at boot

Please post output in [ code ] tags. The excerpt you posted is truncated by your pager and contains nothing to pertain towards your mongodb problem.

See the following page for information on how to filter for specific unit information (you are well advised to read and understand that entire page, it will help you imensely in the long run):  https://wiki.archlinux.org/index.php/Sy … sing_units https://wiki.archlinux.org/index.php/Sy … ing_output

Offline

#5 2018-11-16 17:09:21

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

found this in /var/log/mongodb/mongod.log

2018-11-17T01:01:15.952+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] MongoDB starting : pid=341 port=27017 dbpath=/var/lib/mongodb 64-bit host=archlinux
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] db version v4.0.4
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] git version: f288a3bdf201007f3693c58e140056adf8b04839
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] modules: none
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] build environment:
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten]     distarch: x86_64
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2018-11-17T01:01:16.080+0800 I CONTROL  [initandlisten] options: { config: "/etc/mongodb.conf", net: { bindIp: "127.0.0.1,192.168.0.107" }, storage: { dbPath: "/var/lib/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log", quiet: true } }
2018-11-17T01:01:16.083+0800 E STORAGE  [initandlisten] Failed to set up listener: SocketException: Cannot assign requested address
2018-11-17T01:01:16.084+0800 I CONTROL  [initandlisten] now exiting
2018-11-17T01:01:16.084+0800 I CONTROL  [initandlisten] shutting down with code:48

Offline

#6 2018-11-16 17:10:19

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

when i run "mongod":

2018-11-17T01:10:08.261+0800 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] MongoDB starting : pid=1641 port=27017 dbpath=/data/db 64-bit host=archlinux
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] db version v4.0.4
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] git version: f288a3bdf201007f3693c58e140056adf8b04839
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] modules: none
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] build environment:
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten]     distarch: x86_64
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] options: {}
2018-11-17T01:10:08.267+0800 I STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2018-11-17T01:10:08.267+0800 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-11-17T01:10:08.267+0800 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] now exiting
2018-11-17T01:10:08.267+0800 I CONTROL  [initandlisten] shutting down with code:100

Offline

#7 2018-11-16 17:57:17

loqs
Member
Registered: 2014-03-06
Posts: 18,853

Re: mongodb not starting at boot

V1del wrote:

Check your journal/service status on reboot.

V1del wrote:

Please post output in [ code ] tags.

The status of mongodb.service on boot and the journal for mongodb.service from that boot are still missing as is the use of code tags.
Also please disable mongodb.service, reboot start mongodb.service and post the status of the service then.

Offline

#8 2018-11-16 19:32:10

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,446

Re: mongodb not starting at boot

Aggressor wrote:

can you please explain how to check that ? sorry new to arch

Did you perform the steps described in the Wiki that is dedicated to Mongodb start problems: https://wiki.archlinux.org/index.php/MongoDB#MongoDB_won't_start

Offline

#9 2018-11-17 04:12:35

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

mongodb.service enabled boot log (journalctl -u mongodb.service)

Nov 17 12:10:35 archlinux systemd[1]: Started High-performance, schema-free document-oriented database.
Nov 17 12:10:36 archlinux mongod[350]: 2018-11-17T12:10:36.761+0800 I CONTROL  [main] Automatically disabling TLS 1.0, >
Nov 17 12:10:36 archlinux systemd[1]: mongodb.service: Main process exited, code=exited, status=48/n/a
Nov 17 12:10:36 archlinux systemd[1]: mongodb.service: Failed with result 'exit-code'.

mongodb.service enabled boot /var/log/mongodb/mongod.log

2018-11-17T12:36:22.674+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] MongoDB starting : pid=343 port=27017 dbpath=/var/lib/mongodb 64-bit host=archlinux
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] db version v4.0.4
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] git version: f288a3bdf201007f3693c58e140056adf8b04839
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] modules: none
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] build environment:
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten]     distarch: x86_64
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2018-11-17T12:36:22.811+0800 I CONTROL  [initandlisten] options: { config: "/etc/mongodb.conf", net: { bindIp: "127.0.0.1, 192.168.0.107" }, storage: { dbPath: "/var/lib/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log", quiet: true } }
2018-11-17T12:36:22.813+0800 E STORAGE  [initandlisten] Failed to set up listener: SocketException: Cannot assign requested address
2018-11-17T12:36:22.814+0800 I CONTROL  [initandlisten] now exiting
2018-11-17T12:36:22.815+0800 I CONTROL  [initandlisten] shutting down with code:48

Last edited by Aggressor (2018-11-17 04:40:10)

Offline

#10 2018-11-17 04:19:23

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

mongodb.service disabled and started mongodb after reboot (systemctl start mongodb) output of /var/log/mongodb/mongod.log

2018-11-17T12:17:05.089+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2018-11-17T12:17:05.094+0800 I CONTROL  [initandlisten] MongoDB starting : pid=1113 port=27017 dbpath=/var/lib/mongodb 64-bit host=archlinux
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten] db version v4.0.4
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten] git version: f288a3bdf201007f3693c58e140056adf8b04839
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten] modules: none
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten] build environment:
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten]     distarch: x86_64
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2018-11-17T12:17:05.095+0800 I CONTROL  [initandlisten] options: { config: "/etc/mongodb.conf", net: { bindIp: "127.0.0.1, 192.168.0.107" }, storage: { dbPath: "/var/lib/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log", quiet: true } }
2018-11-17T12:17:05.095+0800 I STORAGE  [initandlisten] Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-11-17T12:17:05.095+0800 I STORAGE  [initandlisten] 
2018-11-17T12:17:05.095+0800 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-11-17T12:17:05.095+0800 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-11-17T12:17:05.095+0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=5474M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-11-17T12:17:05.735+0800 I STORAGE  [initandlisten] WiredTiger message [1542428225:735384][1113:0x7f4407861480], txn-recover: Main recovery loop: starting at 27/12928 to 28/256
2018-11-17T12:17:05.823+0800 I STORAGE  [initandlisten] WiredTiger message [1542428225:823903][1113:0x7f4407861480], txn-recover: Recovering log 27 through 28
2018-11-17T12:17:05.875+0800 I STORAGE  [initandlisten] WiredTiger message [1542428225:875664][1113:0x7f4407861480], txn-recover: Recovering log 28 through 28
2018-11-17T12:17:05.919+0800 I STORAGE  [initandlisten] WiredTiger message [1542428225:919757][1113:0x7f4407861480], txn-recover: Set global recovery timestamp: 0
2018-11-17T12:17:05.939+0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2018-11-17T12:17:05.981+0800 I CONTROL  [initandlisten] 
2018-11-17T12:17:05.981+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-11-17T12:17:05.981+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-11-17T12:17:05.981+0800 I CONTROL  [initandlisten] 
2018-11-17T12:17:06.068+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'
2018-11-17T12:17:06.069+0800 I NETWORK  [initandlisten] waiting for connections on port 27017

Offline

#11 2018-11-17 04:28:20

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: mongodb not starting at boot

So based on the log it looks like it is working, have you tried connecting to it?

Offline

#12 2018-11-17 04:29:21

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

if i reboot mongodb enable its not starting on boot it fails
and then i can start mongodb after reboot manually

Offline

#13 2018-11-17 05:06:14

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

found the issue:
it starts on boot with /etc/mongodb.conf

bind_ip = 127.0.0.1
quiet = true
dbpath = /var/lib/mongodb
logpath = /var/log/mongodb/mongod.log
logappend = true

it wont starts on boot with /etc/mongodb.conf

bind_ip = 127.0.0.1, XXX.XXX.X.XXX
quiet = true
dbpath = /var/lib/mongodb
logpath = /var/log/mongodb/mongod.log
logappend = true

Offline

#14 2018-11-17 05:10:44

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: mongodb not starting at boot

this stackoverflow post suggests that putting them inside square brackets works

Offline

#15 2018-11-17 05:16:01

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

but from mongo doc suggested config is different

systemLog:
   destination: file
   path: "/var/log/mongodb/mongod.log"
   logAppend: true
storage:
   journal:
      enabled: true
net:
   bindIp: 127.0.0.1, 192.168.0.107
   port: 27017
setParameter:
   enableLocalhostAuthBypass: false

my config came without net: ... and bindIp ==> bind_ip
dont know with to use

Offline

#16 2018-11-17 05:38:18

Aggressor
Member
Registered: 2018-11-16
Posts: 13

Re: mongodb not starting at boot

its actually works if i start mongo after boot with warning after detecting wiredTiger,  and works normally:

Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
WARNING:  Access control is not enabled for the database.
                  Read and write access to data and configuration is unrestricted.

and on boot it gives error and wont start it fails before detecting wiredTiger ( but i can start after boot )

Failed to set up listener: SocketException: Cannot assign requested address
now exiting
shutting down with code:48

Offline

Board footer

Powered by FluxBB