我从其他服务器的 /data/db 目录中获取了所有文件,现在尝试在另一个服务器上启动 mongo。这是我拥有的文件:
-rw------- 1 root root 1073741824 Feb 2 11:21 j._0
drwxr-xr-x 2 mongodb nogroup 4096 May 3 12:02 journal
-rw------- 1 root root 67108864 Feb 12 06:43 metadocs-node_db.0
-rw------- 1 root root 134217728 Jun 27 2012 metadocs-node_db.1
-rw------- 1 root root 16777216 Feb 12 06:43 metadocs-node_db.ns
-rwxr-xr-x 1 mongodb nogroup 0 May 3 12:02 mongod.lock
-rw------- 1 root root 1073741824 Aug 28 2012 prealloc.1
-rw------- 1 root root 1073741824 Aug 28 2012 prealloc.2
root@mtg:/var/lib/mongodb#
开始时,我得到(来自日志文件/var/log/mongodb/mongodb.log):
Fri May 3 12:02:01 [initandlisten] options: { bind_ip: "127.0.0.1", config:
"/etc/mongodb.conf", dbpath: "/var/lib/mongodb",$
Fri May 3 12:02:01 [initandlisten] journal dir=/var/lib/mongodb/journal
Fri May 3 12:02:01 [initandlisten] recover : no journal files present, no recovery needed
Fri May 3 12:02:01 [initandlisten] couldn't open /var/lib/mongodb/_metadocs-node_db.ns errno:13 Permission denied
Fri May 3 12:02:01 [initandlisten] error couldn't open file /var/lib/mongodb/_metadocs-node_db.ns terminating
Fri May 3 12:02:01 dbexit:
我在跑
sudo service mongodb start
那么,我做错了什么?mongodb 启动时缺少哪些文件?为什么我收到“权限被拒绝”?顺便说一句,以root身份工作。没有其他 mongo 实例正在运行。谢谢!