发布于 2015-09-14 14:59:41 | 179 次阅读 | 评论: 0 | 来源: 网络整理
Forces the mongod to flush pending all write operations to the disk and locks the entire mongod instance to prevent additional writes until the user releases the lock with the db.fsyncUnlock() command. db.fsyncLock() is an administrative command.
This command provides a simple wrapper around a fsync database command with the following syntax:
{ fsync: 1, lock: true }
This function locks the database and create a window for backup operations.
注解
The database cannot be locked with db.fsyncLock() while profiling is enabled. You must disable profiling before locking the database with db.fsyncLock(). Disable profiling using db.setProfilingLevel() as follows in the mongo shell:
db.setProfilingLevel(0)