问题描述
,经过编译生成的mongodb,文件超过2GB提示错误
rs0:PRIMARY> db.Data.insert({'name':'test'})WriteResult({'nInserted' : 0,'writeError' : {'code' : 10085,'errmsg' : 'insertDocument :: caused by :: 10085 can’t map file memory'}})
问题解答
回答1:根据官方文档,目前调整了系统参数:上面安装了redisMEM 32GB,
vi /etc/sysctl.confvm.overcommit_memory = 1net.ipv4.tcp_syncookies = 1net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1
vi /etc/profile
ulimit -f unlimitedulimit -t unlimitedulimit -v unlimitedulimit -n 64000ulimit -m unlimitedulimit -u 64000
source /etc/profile
ulimit -acore file size (blocks, -c) 1data seg size (kbytes, -d) unlimitedscheduling priority (-e) 0file size (blocks, -f) unlimitedpending signals (-i) 256821max locked memory (kbytes, -l) 64max memory size (kbytes, -m) unlimitedopen files (-n) 64000pipe size (512 bytes, -p) 8POSIX message queues (bytes, -q) 819200real-time priority (-r) 0stack size (kbytes, -s) 1024cpu time (seconds, -t) unlimitedmax user processes (-u) 64000virtual memory (kbytes, -v) unlimitedfile locks (-x) unlimited #
重启了数据库,插入暂时恢复正常