1

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?

asked Nov 22, 2022 at 19:15
2
  • 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. Commented 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. Commented Nov 23, 2022 at 0:55

1 Answer 1

0

I just used compiled binaries to achieve my goal. You may follow here.

answered Nov 23, 2022 at 0:56
1
  • 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? Commented Dec 11, 2022 at 14:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.