1、查看WiredTiger内部缓存占用, 默认情况下,WiredTiger缓存的大小为系统内存的50%减去1GB
db.runCommand( { serverStatus: 1 } ).wiredTiger.cache["bytes currently in the cache"]
2、运行时修改mongodb可缓存数据
db.adminCommand({setParameter: 1, wiredTigerEngineRuntimeConfig: "cache_size=2G"})
3、查看存储引擎
db.serverStatus();
4、查看数据库
show dbs;
5、使用数据库
use dbname;
6、登录
mongo --port 28017 --authenticationDatabase admin -uroot -p