I want to change my mongodb data directory to my external media. The problem is that when I change data dir to my media (other than home dir), it does not work, but it works for home dir:
●くろまる mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022年11月22日 12:46:57 EST; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 144014 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
Main PID: 144014 (code=exited, status=100)
Nov 22 12:46:57 nimashiri-G5-5000 systemd[1]: Started MongoDB Database Server.
Nov 22 12:46:57 nimashiri-G5-5000 systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
Nov 22 12:46:57 nimashiri-G5-5000 systemd[1]: mongod.service: Failed with result 'exit-code'.
Any idea?
Nima shiriNima shiri
-
What is the path used for the new data directory? I guess you are using a mounted media with no sufficient permissions or maybe this one is owned by root.Edgar Magallon– Edgar Magallon2022年11月22日 20:13:16 +00:00Commented Nov 22, 2022 at 20:13
-
@EdgarMagallon Exactly. I just solve the problem by using compiled binaries. Because in this case, I could define data directory from scratch.Nima shiri– Nima shiri2022年11月23日 00:55:44 +00:00Commented Nov 23, 2022 at 0:55
1 Answer 1
I just used compiled binaries to achieve my goal. You may follow here.
-
It's not clear to me how "compiled binaries" solved the problem, and there's no mention of compiled binaries at the link you gave. Can you elaborate?2022年12月11日 14:05:38 +00:00Commented Dec 11, 2022 at 14:05