Ich führe einen mongodb
im docker container, und ich habe Datendateisicherung.wie mongodb-daten wiederherstellen, nachdem mein mongdb-container entfernt wurde
Aber heute habe ich meine mongodb
sorglos entfernt.
Ich habe versucht, einen anderen Container auszuführen und die Datendatei in den Container zu legen, aber es hat nicht funktioniert.
Wie kann ich meine Daten aus der Datendatei wiederherstellen?
die Datenbankdatei Ich habe jetzt nur:
der Behälter ich benutze, ist tutum/mongodb.my Docker-compose.yml Datei
mongo_db: image: tutum/mongodb privileged: true restart: always ports: - 27016:27017 - 28016:28017 volumes: - /var/mongodb:/data/db environment: - MONGODB_PASS=xxxxxx - AUTH=yes
ist und jetzt will ich meine wiederherstellen Daten von directory/var/mongodb zu meinem neuen Container
Ich lege die Datei außer mongod.lock in meinem neuen Container, aber mein mongodb kann nicht ausgeführt werden. es ist der Screenshot:
die mongod.conf ist:
# Where to store the data.
# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
dbpath=/var/lib/mongodb
#where to log
logpath=/var/log/mongodb/mongod.log
logappend=true
#port = 27017
# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip = 127.0.0.1
# Disables write-ahead journaling
# nojournal = true
# Enables periodic logging of CPU utilization and I/O wait
#cpu = true
# Turn on/off security. Off is currently the default
#noauth = true
#auth = true
# Verbose logging output.
#verbose = true
# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck = true
# Enable db quota management
#quota = true
# Set oplogging level where n is
# 0=off (default)
# 1=W
# 2=R
# 3=both
# 7=W+some reads
#diaglog = 0
# Ignore query hints
#nohints = true
# Enable the HTTP interface (Defaults to port 28017).
#httpinterface = true
# Turns off server-side scripting. This will result in greatly limited
# functionality
#noscripting = true
# Turns off table scans. Any query that would do a table scan fails.
#notablescan = true
# Disable data file preallocation.
#noprealloc = true
# Specify .ns file size for new databases.
# nssize = <size>
# Replication Options
# in replicated mongo databases, specify the replica set name here
#replSet=setname
# maximum size in megabytes for replication operation log
#oplogSize=1024
# path to a key file storing authentication info for connections
# between replica set members
#keyFile=/path/to/keyfile
der Behälter ower Satz storage_engine in env während der Behälter beginnen die Umgebung des Behälters läuft:
# mongod.conf
STORAGE_ENGINE=wiredTiger
HOSTNAME=bb544551ec2b
MONGODB_PASS=xxxxxx
LS_COLORS=
AUTH=yes
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/etc
SHLVL=1
HOME=/root
LESSOPEN=| /usr/bin/lesspipe %s
JOURNALING=yes
LESSCLOSE=/usr/bin/lesspipe %s %s
_=/usr/bin/env
OLDPWD=/
die Protokolle unter Tutum/Mongodb: 3.0:
Hallo Kevin Wang; Bilder sind nützlich in einem Post, aber ** stellen Sie sicher, dass der Post immer noch ohne sie ist **. Können Sie nicht einen Screenshot Ihres Terminals zeigen, sondern die relevanten Informationen direkt in den Beitrag kopieren und einfügen? cf http://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors –