【发布时间】:2015-02-06 19:35:02
【问题描述】:
在 mongodump 之后,我做了 mongorestore,它似乎工作正常
heathers-air:db heathercohen$ mongorestore -v -host localhost:27017
2015-02-06T11:22:40.027-0800 creating new connection to:localhost:27017
2015-02-06T11:22:40.028-0800 [ConnectBG] BackgroundJob starting: ConnectBG
2015-02-06T11:22:40.028-0800 connected to server localhost:27017 (127.0.0.1)
2015-02-06T11:22:40.028-0800 connected connection!
connected to: localhost:27017
2015-02-06T11:22:40.030-0800 dump/langs.bson
2015-02-06T11:22:40.030-0800 going into namespace [dump.langs]
Restoring to dump.langs without dropping. Restored data will be inserted without raising errors; check your server log
file dump/langs.bson empty, skipping
2015-02-06T11:22:40.030-0800 Creating index: { key: { _id: 1 }, name: "_id_", ns: "dump.langs" }
2015-02-06T11:22:40.031-0800 dump/tweets.bson
2015-02-06T11:22:40.031-0800 going into namespace [dump.tweets]
Restoring to dump.tweets without dropping. Restored data will be inserted without raising errors; check your server log
file size: 4877899
30597 objects found
2015-02-06T11:22:41.883-0800 Creating index: { key: { _id: 1 }, name: "_id_", ns: "dump.tweets" }
当我尝试访问数据时,它仍然是空的,并且它看起来像恢复之前的样子:
> show dbs
admin (empty)
dump 0.078GB
local 0.078GB
tweets (empty)
twitter (empty)
它说它发现了 30597 个物体,它们去哪儿了?
【问题讨论】:
-
输出状态“将插入恢复的数据而不会引发错误;检查您的服务器日志”。您当时检查 mongod.log 文件是否有错误?
-
它读作
2015-02-06T11:23:31.847-0800 [initandlisten] connection accepted from 127.0.0.1:52475 #21 (6 connections now open) 2015-02-06T11:23:55.287-0800 [clientcursormon] mem (MB) res:18 virt:2803 2015-02-06T11:23:55.287-0800 [clientcursormon] mapped (incl journal view):320 2015-02-06T11:23:55.287-0800 [clientcursormon] connections:6 2015-02-06T11:27:13.555-0800 [conn21] end connection 127.0.0.1:52475 (5 connections now open)@JamesWahlin -
你可以使用“use dump”切换到mongo shell中的dump数据库,然后运行“show collections”并发布结果吗?
标签: mongodb pymongo mongorestore