标签:dir inter mes tco eve problems void 循环 cat
[root@restore1 data1]# mongod --dbpath=/data/data1/mongodb_data/ --directoryperdb ** WARNING: You are running this process as the root user, which is not recommended. ** WARNING: You are running on a NUMA machine. ** We suggest launching mongod like this to avoid performance problems: ** numactl --interleave=all mongod [other options] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always‘. ** We suggest setting it to ‘never‘ ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always‘. ** We suggest setting it to ‘never‘ ** WARNING: soft rlimits too low. rlimits set to 30000 processes, 65530 files. Number of processes should be at least 32765 : 0.5 times number of files. [root@restore1 data1]# echo never>/sys/kernel/mm/transparent_hugepage/enabled [root@restore1 data1]# echo never>/sys/kernel/mm/transparent_hugepage/defrag [root@restore1 data1]# cat /etc/security/limits.conf #--------------------------------------------------
#此处经过测试知:只要 nproc * 2【0.5倍的nofile】 >= nofile > 32767【推荐】 * - nproc 65538 * - nofile 65536 #-------------------------------------------------- [root@restore1 data1]# numactl --interleave=all mongod --dbpath=/data/data1/mongodb_data/ --directoryperdb & [1] 3847 [root@restore1 data1]# 2018-11-12T11:35:49.699+0800 I CONTROL [initandlisten] MongoDB starting : pid=3847 port=27017 dbpath=/data/data1/mongodb_data/ 64-bit host=restore1 2018-11-12T11:35:49.699+0800 I CONTROL [initandlisten] db version v3.2.4 ... ...
mongodb shell 编写js脚本:循环遍历
var cols=db.getCollectionNames(); for (var i=0 ;i<cols.length;i++) {
var n=cols[i];
var v=db.getCollection(n).count();
print (n.pad(30,true) + " : " + v);
}
标签:dir inter mes tco eve problems void 循环 cat
原文地址:https://www.cnblogs.com/jinzhenshui/p/9946675.html