HI, I installed MongoDB for the first time. Tried to create users and connect to jdbc. Didn’t connect so I thought I had made some errors when making users. I wanted to start all over. I uninstalled, deleted the data and the config file.
I reinstalled with apt-get according to the manual. It complained that there was no mongod.conf file, so I created it myself according to the manual. The service still wouldn’t start or it started and stopped immediately. I hope you can see what the problem is.
oaj@pop-os:~$ sudo systemctl start mongod
oaj@pop-os:~$ sudo systemctl status mongod
○ mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2022-05-24 18:05:09 AST; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 109548 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=0/SUCCESS)
Main PID: 109548 (code=exited, status=0/SUCCESS)
CPU: 359ms
May 24 18:05:08 pop-os systemd[1]: Started MongoDB Database Server.
May 24 18:05:08 pop-os mongod[109548]: about to fork child process, waiting until server is ready for connections.
May 24 18:05:08 pop-os mongod[109550]: forked process: 109550
May 24 18:05:09 pop-os mongod[109548]: child process started successfully, parent exiting
May 24 18:05:09 pop-os systemd[1]: mongod.service: Deactivated successfully.
mongod.conf
processManagement:
fork: true
net:
bindIp: localhost
port: 27017
storage:
dbPath: /var/lib/mongodb
systemLog:
destination: file
path: “/var/log/mongodb/mongod.log”
logAppend: true
storage:
journal:
enabled: true
journalctl -xe
May 24 18:09:47 pop-os sudo[109874]: oaj : TTY=pts/0 ; PWD=/home/oaj ; USER=root ; COMMAND=/usr/bin/systemctl start mongod
May 24 18:09:47 pop-os sudo[109874]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
May 24 18:09:47 pop-os sudo[109874]: pam_unix(sudo:session): session closed for user root