mongodump错误"失败:从db读取错误:EOF" (服务器日志中没有条目)

时间:2016-03-16 09:43:07

标签: mongodb mongodump

版本3.06的mongodb.conf和数据文件只有240 MB。在这个时间戳上,网络是可靠的。

# mongod.conf

# 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=/db/db32/mongodb/data/

# path to logfile
logpath=/db/db32/mongodb/logs/mongod.log

# add new entries to the end of the logfile
logappend=true

# Listen to local interface only. Comment out to listen on all interfaces.
#bind_ip = 127.0.0.1

# enable operation journaling
#journal = true
#smallfiles = true
nojournal = true

# Enables periodic logging of CPU utilization and I/O wait
cpu = true

# enable database authentication for users connecting from remote hosts
auth = true

# Verbose logging output.
#verbose = 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

# 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

# Forces the mongod to validate all requests from clients
objcheck = true

# Disable HTTP status interface
nohttpinterface = true

# disable REST interface
rest = false

# database profiling 1 = only includes slow operations
profile = 1

# logs slow queries to the log
slowms = 100

# maximum number of simultaneous connections
maxConns = 25
带有详细标志的mongodump。在服务器日志中没有此时间戳的条目。

(...)
2016-03-09T16:51:17.378+0100    enqueued collection 'Tetzi005.xxx'
2016-03-09T16:51:17.384+0100    enqueued collection 'Tetzi005.xxxxxx'
2016-03-09T16:51:17.391+0100    enqueued collection 'Tetzi005.system.indexes'
2016-03-09T16:51:17.391+0100    finalizing intent manager with longest task first prioritizer
2016-03-09T16:51:17.391+0100    dumping with 8 job threads
2016-03-09T16:51:17.391+0100    starting dump routine with id=0
2016-03-09T16:51:17.391+0100    starting dump routine with id=4
2016-03-09T16:51:17.391+0100    starting dump routine with id=1
2016-03-09T16:51:17.391+0100    writing Tetzi005.DailyEmailUser to dbbackup/dump/Tetzi005/xxxxxxx.bson
2016-03-09T16:51:17.391+0100    starting dump routine with id=3
2016-03-09T16:51:17.391+0100    starting dump routine with id=6
2016-03-09T16:51:17.391+0100    writing Tetzi005.Prototype to dbbackup/dump/Tetzi005/xxxxxxx.bson
2016-03-09T16:51:17.392+0100    starting dump routine with id=7
2016-03-09T16:51:17.392+0100    writing Tetzi005.ProfileUser to dbbackup/dump/Tetzi005/xxxxxxx.bson
2016-03-09T16:51:17.392+0100    starting dump routine with id=2
2016-03-09T16:51:17.392+0100    writing Tetzi005.OrganizationDataSet to dbbackup/dump/Tetzi005/xxxxxxxx.bson
2016-03-09T16:51:17.392+0100    writing Tetzi005.DailyUserCount to dbbackup/dump/Tetzi005/xxxxxxxxxx.bson
2016-03-09T16:51:17.392+0100    writing Tetzi005.DailyEmailOrganization to dbbackup/dump/Tetzi005/xxxxxxxxxxxxx.bson
2016-03-09T16:51:17.392+0100    starting dump routine with id=5
2016-03-09T16:51:17.392+0100    writing Tetzi005.OrganizationStatistics to dbbackup/dump/Tetzi005/xxxxxxxxxxx.bson
2016-03-09T16:51:17.392+0100    writing Tetzi005.Organization to dbbackup/dump/Tetzi005/xxxx.bson
2016-03-09T16:51:17.398+0100        counted 112 documents in Tetzi005.xxxxxxxxxxxxx
2016-03-09T16:51:17.398+0100        counted 475 documents in Tetzi005.xxxxxxxx
2016-03-09T16:51:17.405+0100    Failed: error reading from db: EOF

在Google搜索Failed: error reading from db: EOF

时没有解决方案

我们仅在large计划中遇到此问题。从技术上讲,配置并没有区别(期望内存,磁盘和maxConns)。所有mongo Server都在Docker容器中运行。 Docker在使用RHEL7的OpenStack VM上运行。

small          Maximum 10 concurrent connections, 1GB storage, 256MB memory   paid   
medium         Maximum 15 concurrent connections, 8GB storage, 1GB memory     paid   
large          Maximum 25 concurrent connections, 16GB storage, 4GB memory    paid   

3 个答案:

答案 0 :(得分:15)

错误Failed: error reading from db: EOF是由于在oplog写出期间内存不足造成的。

您可以在运行mongodump添加--quiet选项时使用更少的内存。

mongodump --quiet

答案 1 :(得分:1)

"Failed: error reading from db: EOF"是由于在oplog写出期间内存不足造成的。

答案 2 :(得分:1)

对于容器化设置,您必须记住设置storage.wiredTiger.engineConfig.cacheSizeGB

来自https://docs.mongodb.com/manual/reference/configuration-options/#storage.wiredTiger.engineConfig.cacheSizeGB

  

storage.wiredTiger.engineConfig.cacheSizeGB限制了WiredTiger内部缓存的大小。操作系统将使用可用的空闲内存进行文件系统缓存,从而允许压缩的MongoDB数据文件保留在内存中。此外,操作系统将使用任何可用的RAM来缓冲文件系统块和文件系统缓存。

     

要容纳更多的RAM使用者,您可能必须减小WiredTiger内部缓存的大小。