【发布时间】:2017-08-28 04:24:15
【问题描述】:
我使用 MongoDB 作为我的数据存储,版本 v3.4.1。我正在使用 mongo 的 docker 映像,像这样运行它:
docker run -d -p 27017:27017 -v /home/rancher/data:/data/db --name mongodb mongo:latest
之后我创建了许多数据库和集合。一个多月没问题;但现在我无法在数据库中找到任何集合。此列出集合的命令显示一个空列表:show dbs。或者,如果我执行use mydb,则show collections 不会显示任何内容。
这些是 /home/rancher/data 文件夹中的数据:
collection-0--4220404477553112134.wt
集合-0-1041804628168690390.wt
收藏2--4220404477553112134.wt
收藏-2-1041804628168690390.wt
诊断数据
index-1--4220404477553112134.wt
index-1-1041804628168690390.wt
index-3--4220404477553112134.wt
index-3-1041804628168690390.wt
index-4-1041804628168690390.wt
杂志
_mdb_catalog.wt
mongod.lock
sizeStorer.wt
storage.bson
有线老虎
WiredTiger.lock
WiredTiger.turtle
WiredTiger.wt
WiredTigerLAS.wt
谁能告诉我为什么这些集合在 mongo DB 中不能持久化?
【问题讨论】:
-
当您查看主机上的位置'home/rancher/data'时,它是否包含任何数据文件?
-
您能否准确描述一下您找不到任何收藏品的原因?它们没有出现在 mongo shell 中 show collections 给出的列表中 - 还是别的什么?
-
@VinceBowdren,这些是 /home/rancher/data 文件夹中的数据 WiredTiger, _mdb_catalog.wt, diagnostic.data, index-4-1041804628168690390.wt,WiredTiger.lock,collection-0- -4220404477553112134.wt indect-1--4220404477553112134 .wtning-1-4220404477553112134.wtired.turtle,collection-0-0- 0-1-1-10418046030.wt,mongod.lock,wiredtiger.wt collection-2--4220404477553112134.wt,depend -3--4220404477553112134.wt, sizeStorer.wt,WiredTigerLAS.wt collection-2-1041804628168690390.wt, index-3-1041804628168690390.wt, storage.bson
-
一旦我创建了集合,它会在几天后消失。所以我无法继续我的任务。当我执行此命令列出集合时,它显示空列表 show dbs 然后使用 mydb show collections 什么都不会显示在这里你能帮助克服这个问题吗?