我想将 mongodb 数据目录更改为外部媒体。问题是,当我将数据目录更改为我的媒体(而不是主目录)时,它不起作用,但它适用于主目录:
● 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'.
任何想法?
答案1
我只是使用编译的二进制文件来实现我的目标。您可以关注这里。