I just installed MongoDb on Ubuntu 16.04 and I can not run the server. I get the following information when the "status" of the server (sudo systemctl start mongodb):
lmunoz@lmunoz:/var/www/node/dashboard$ sudo systemctl status mongodb
● mongodb.service - High-performance, schema-free document-oriented
database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor
preset: enabled)
Active: failed (Result: exit-code) since mar 2017-05-09 12:01:59 PET;
29s ago
Process: 1042 ExecStart=/usr/bin/mongod --quiet --config
/etc/mongod.conf (code=exited, status=48)
Main PID: 1042 (code=exited, status=48)
may 09 12:01:59 lmunoz systemd[1]: Started High-performance, schema-
free document-oriented database.
may 09 12:01:59 lmunoz systemd[1]: mongodb.service: Main process
exited, code=exited, status=48/n/a
may 09 12:01:59 lmunoz systemd[1]: mongodb.service: Unit entered
failed state.
may 09 12:01:59 lmunoz systemd[1]: mongodb.service: Failed with result
'exit-code'.
The log (/var/log/mongodb/mongod.log) shows me the following:
listen(): bind() failed errno:98 Address already in use for socket:
127.0.0.1:27017
addr already in use
Failed to set up sockets during startup.
dbexit: rc: 48
And my configuration file (/etc/systemd/system/mongodb.service) contains:
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target