故障表现
- 部署的应用程序突然无法将数据写入数据库,但是可以正常读取数据。
- 通过Mongo Shell连接数据库进行排查时,测试写入一条数据,返回错误信息:
not authorized on xxxx to execute command
db.customer.insert({"name":"zhangsan"})
WriteCommandError({
"operationTime" : Timestamp(1563437183, 1),
"ok" : 0,
"errmsg" : "not authorized on db1 to execute command { insert: \"customer\", ordered: true, lsid: { id: UUID(\"8d43461c-5c51-49ef-b9b3-9xxxxxxxxf\") }, $clusterTime: { clusterTime: Timestamp(1563437183, 1), signature: { hash: BinData(0, 0C3FAAE747xxxxxx), keyId: 668293399xxxxxx } }, $db: \"db1\" }",
"code" : 13,
"codeName" : "Unauthorized",
"$clusterTime" : {
"clusterTime" : Timestamp(1563437183, 1),
"signature" : {
"hash" : BinData(0,"DD+q50dPTuIQKTzytT5SiTPYX4Q="),
"keyId" : NumberLong("66xxxxxxxx")
}
}
})
查看磁盘空间使用率。本案例中,查看到Shard节点的磁盘空间的使用率超过了100%,由此可判断磁盘空间被耗尽