After change bind ip of mongodb, mongodb can't be up

Hi Free5GC team,

Would you pls help.
As I want to run all 5GC NFs on machine A, and UPF on machine B.
So I don’t want to use 127.0.0.1 for all NFs on machine A, I changed 127.0.0.1/localhost in all conf files, and then I realized that I also need to change ‘127.0.0.1’ in file /etc/mongodb.conf’ to machine A’s IP (192.168.5.52), I changed it, but mongodb can’t be up.

mongodb.conf

Where to store the data.

dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongodb.log

logappend=true

bind_ip = 192.168.5.52
port = 27017

andrew@andrew-:~$ sudo systemctl restart mongodb
andrew@andrew-:~$ sudo systemctl status mongodb
● mongodb.service - An object/document-oriented database
   Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-09-08 01:10:07 PDT; 6s ago
     Docs: man:mongod(1)
  Process: 5581 ExecStart=/usr/bin/mongod --unixSocketPrefix=${SOCKETPATH} --config ${CONF} $DAEMON_OPTS (code=exited, status=2)
 Main PID: 5581 (code=exited, status=2)

Sep 08 01:10:07 andrew systemd[1]: Started An object/document-oriented database.
Sep 08 01:10:07 andrew-mongod[5581]: Error reading config file: Permission denied
Sep 08 01:10:07 andrew- mongod[5581]: try '/usr/bin/mongod --help' for more information
Sep 08 01:10:07 andrew- systemd[1]: mongodb.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 08 01:10:07 andrew-systemd[1]: mongodb.service: Failed with result 'exit-code'.

Thanks a lot!

Br,
Andrew

I don’t think you need to change the config file of mongodb because only NRF and UDR will use mongodb and they are on machine A right? Just let them to enable to access to mongodb is enough.

thanks. Yes, I change all back to 127.0.0.1 and it worked.