Linux Mint 19.1 Cinnamon,Tessa 如果数据位于ntfs分区上,则无法启动mongodb。 如何设置分区权限或mongodb配置?
ntfs分区的fstab文件配置:
UUID=D2868E9F868E8427 /home/dt261 ntfs auto nodev exec rw user sync 0 2
mongodb.conf dbpath设置:
dbpath=/home/dt261/data/db
Mongodb不断重启:
amber@amber-ThinkPad-T400:~$ ps -ef | grep mongo
amber 3316 1472 0 23:44 pts/0 00:00:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ ps -ef | grep mongo
amber 3318 1472 0 23:44 pts/0 00:00:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ ps -ef | grep mongo
amber 3320 1472 0 23:44 pts/0 00:00:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ ps -ef | grep mongo
amber 3323 1472 0 23:44 pts/0 00:00:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ ps aux | grep mongo
amber 3325 0.0 0.0 14428 1040 pts/0 S+ 23:44 0:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ ps aux | grep mongo
amber 3330 0.0 0.0 14428 1092 pts/0 S+ 23:44 0:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ ps aux | grep mongo
amber 3332 0.0 0.0 14428 1092 pts/0 S+ 23:44 0:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ ps aux | grep mongo
amber 3334 0.0 0.0 14428 1044 pts/0 R+ 23:44 0:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$
尝试启动mongodb并提供路径:
amber@amber-ThinkPad-T400:~$ mongod --dbpath=/home/dt261/data/db
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] MongoDB starting : pid=3367 port=27017 dbpath=/home/dt261/data/db 64-bit host=amber-ThinkPad-T400
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] db version v3.6.3
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] allocator: tcmalloc
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] modules: none
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] build environment:
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] distarch: x86_64
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] target_arch: x86_64
2019-07-01T23:46:43.739+0100 I CONTROL [initandlisten] options: { storage: { dbPath: "/home/dt261/data/db" } }
2019-07-01T23:46:43.741+0100 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=432M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2019-07-01T23:46:44.668+0100 E STORAGE [initandlisten] WiredTiger error (17) [1562021204:668873][3367:0x7fc1d7f58f80], connection: /home/dt261/data/db/WiredTiger.wt: handle-open: open: File exists
2019-07-01T23:46:44.671+0100 I STORAGE [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.1
2019-07-01T23:46:44.691+0100 E STORAGE [initandlisten] WiredTiger error (1) [1562021204:691108][3367:0x7fc1d7f58f80], connection: /home/dt261/data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2019-07-01T23:46:44.707+0100 E - [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 413
2019-07-01T23:46:44.709+0100 I STORAGE [initandlisten] exception in initAndListen: Location28595: 1: Operation not permitted, terminating
2019-07-01T23:46:44.709+0100 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2019-07-01T23:46:44.709+0100 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-07-01T23:46:44.709+0100 I CONTROL [initandlisten] now exiting
2019-07-01T23:46:44.709+0100 I CONTROL [initandlisten] shutting down with code:100
我如何杀死其他的mongodb?可能是什么原因?试图杀死,找不到mongodb。似乎是重新启动并更改pid:
amber@amber-ThinkPad-T400:~$ ps -ef | grep mongo
amber 3398 1472 0 23:49 pts/0 00:00:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ kill 3398
bash: kill: (3398) - No such process
amber@amber-ThinkPad-T400:~$ ps -ef | grep mongo
amber 3400 1472 0 23:49 pts/0 00:00:00 grep --color=auto mongo
amber@amber-ThinkPad-T400:~$ kill 3400
bash: kill: (3400) - No such proces
遵循一条设置文件夹权限的建议,状态显示退出,代码为100:
mber@amber-ThinkPad-T400:~$ sudo systemctl stop mongodb
amber@amber-ThinkPad-T400:~$ cd /home/dt261/data
amber@amber-ThinkPad-T400:/home/dt261/data$ sudo chown -R mongodb:mongodb *
amber@amber-ThinkPad-T400:/home/dt261/data$ cd
amber@amber-ThinkPad-T400:~$ sudo systemctl start mongodb
amber@amber-ThinkPad-T400:~$ sudo systemctl status mongodb
● mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-07-02 00:26:36 BST; 4s ago
Docs: man:mongod(1)
Process: 4598 ExecStart=/usr/bin/mongod --unixSocketPrefix=${SOCKETPATH} --config ${CONF} $DAEMON_OPTS (code=exited
Main PID: 4598 (code=exited, status=100)
Jul 02 00:26:35 amber-ThinkPad-T400 systemd[1]: Started An object/document-oriented database.
Jul 02 00:26:36 amber-ThinkPad-T400 systemd[1]: mongodb.service: Main process exited, code=exited, status=100/n/a
Jul 02 00:26:36 amber-ThinkPad-T400 systemd[1]: mongodb.service: Failed with result 'exit-code'.