我知道,有一些关于mongodb和记忆的文章,但不是这些可以帮助我。
我有一个大约40GB的大型数据库。我的服务器是带有32GB RAM和ssd磁盘的Ubuntu 16.04。
现在,当我尝试插入新文档时,我收到以下消息:
MongoDB\Driver\Exception\BulkWriteException [ Error ]:
file /var/lib/mongodb/databasename.35 open/create failed in createPrivateMap (look in log for more information)
在日志文件中我发现了这个:
2017-07-25T18:20:58.154+0200 I NETWORK [conn22] received client metadata from 127.0.0.1:46124 conn22: { driver: { name: "mongoc / ext-mongodb:PHP", version: "1.5.5 / 1.2.9" }, os: { type: "Linux", name: "Ubuntu", version: "16.04", architecture: "x86_64" }, platform: "cfg=0x30c9 posix=200809 stdc=201112 CC=GCC 5.4.0 20160609 CFLAGS="-g -O2" LDFLAGS="" / PHP 5.6.30" }
2017-07-25T18:20:58.189+0200 E CONTROL [conn22] mmap private failed with out of memory. (64 bit build)
2017-07-25T18:20:58.189+0200 I - [conn22] Assertion: 13636:file /var/lib/mongodb/database_name.35 open/create failed in createPrivateMap (look in log for more information) src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp 271
2017-07-25T18:20:58.205+0200 I CONTROL [conn22]
我有足够的磁盘空间:
Filesystem Size Used Avail Use% Mounted on
/dev/ploop42094p1 799G 299G 468G 40% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 578M 16G 4% /run
tmpfs 5.0M 20K 5.0M 1% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
none 16G 0 16G 0% /run/shm
我认为记忆也是如此:
free -m
total used free shared buff/cache available
Mem: 32768 1235 7659 840 23873 31268
Swap: 1024 945 78
任何想法如何解决这个问题?