mongodb.service gives error during startup

0

I'm running mongodb 3.0.14 on a raspberry-pi 3 with raspbian stretch 4.9.41-v7 + (32 bits). Everything works fine except when the service has to start during system startup, which returns the following error message, preventing the service from starting:

  

listen (): bind () failed errno: 99 Can not assign requested address for socket: 192.168.1.16:27017

My mongodb.conf file has the following:

# /etc/mongodb.conf
# minimal config file (old style)
# Run mongod --help to see a list of options

bind_ip = 127.0.0.1,192.168.1.16
#port = 27017
quiet = true
dbpath = /data/db
logpath = /data/log/mongodb.log
logappend = true
storageEngine = mmapv1

And my mongodb.service:

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf
# (file size)
LimitFSIZE=infinity
# (cpu time)
LimitCPU=infinity
# (virtual memory size)
LimitAS=infinity
# (open files)
LimitNOFILE=64000
# (processes/threads)
LimitNPROC=64000

[Install]
WantedBy=multi-user.target

I have done several tests modifying the [Unit], thinking that the network has not been initialized yet, with the following:

[Unit]
#Wants=network-online.target
#After=network.target network-online.target
#Requires=network.target network-online.target

But nothing works.

Once the system has finished booting, I can manually start the service, working perfectly, without giving the previous error message and being able to access mongo from any other device in my network.

Any ideas of what is happening at startup?

Thanks in advance.

    
asked by J. M. Rubiano 15.04.2018 в 16:07
source

0 answers