mongod --dbpath=/data option to change the data directory location, by executing this command continously running in forground waiting for connection
it works on mongo CLI, But after I stop the
mongod --dbpath=/data by CTRL +C, mongo CLI refuse to Connect
Then After restarting mongod service, it's just normally use by default path in root directory.
Then I edited in /etc/mongodb.conf db path parameter, after mongob serive can't start
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: Active: failed (Result: exit-code) since Mon 2019-07-15 19:36:47 IST; 5s ago Docs: https://docs.mongodb.org/manual Process: 5355 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited Main PID: 5355 (code=exited, status=2)
How do I make this permanent
**I change that new directory ownership to mongodb user **I am using Ubuntu