How do we change the options like dbPath, path etc in mongod.conf file. I am using centos 7. Every time i change the default dbPath and try to restart mongod service it fails.(It works fine with default config options like ->
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
)
I have tried changing permissions to new directory using chown mongod:mongod /path/to/data
and chmod 0755 /path/to/data
Every time i get error (in mongod.log file )-> 2017-03-27T06:03:27.182+0000 I STORAGE [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /path/to/data, terminating