,經過編譯產生的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"
}
})
根據官方文檔,目前調整了系統參數:
上面安裝了redis
MEM 32GB,
vi /etc/sysctl.conf
vm.overcommit_memory = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
vi /etc/profile
ulimit -f unlimited
ulimit -t unlimited
ulimit -v unlimited
ulimit -n 64000
ulimit -m unlimited
ulimit -u 64000
source /etc/profile
ulimit -a
core file size (blocks, -c) 1
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 256821
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 64000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 1024
cpu time (seconds, -t) unlimited
max user processes (-u) 64000
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
#
重啟了資料庫,插入暫時恢復正常