db.disableFreeMonitoring()
On this page本页内容
db.disableFreeMonitoring()
-
Disables free Cloud monitoring.禁用免费的云监控。ImportantTo run若要运行db.disableFreeMonitoring()
, you must have specified--enableFreeMonitoring
command-line option orcloud.monitoring.free.state
configuration file set toruntime
.db.disableFreeMonitoring()
,必须将--enableFreeMonitoring
命令行选项或cloud.monitoring.free.state
配置文件设置为runtime
。Otherwise, you can only enable or disable at startup.否则,您只能在启动时启用或禁用。See有关详细信息,请参阅--enableFreeMonitoring
command-line option orcloud.monitoring.free.state
for details.--enableFreeMonitoring
命令行选项或cloud.monitoring.free.state
。Thedb.disableFreeMonitoring()
method is a wrapper around thesetFreeMonitoring
command.db.disableFreeMonitoring()
方法是setFreeMonitoring
命令的包装器。
Access Control访问控制
When running with access control, the user must have the 在使用访问控制运行时,用户必须在集群上具有setFreeMonitoring
privilege actions on the cluster. setFreeMonitoring
权限操作。That is, a user must have a role that grants the following privilege:也就是说,用户必须具有授予以下权限的角色:
{ resource: { cluster : true }, actions: [ "setFreeMonitoring" ] }
The built-in role 内置的角色clusterMonitor
role provides this privilege.clusterMonitor
角色提供了此权限。
Example实例
To disable free monitoring, run the following in 要禁用免费监控,请在mongosh
:mongosh
中运行以下操作:
db.disableFreeMonitoring()
You can use 您可以使用db.getFreeMonitoringStatus()
to check your of free monitoring status:db.getFreeMonitoringStatus()
来检查您的免费监控状态:
db.getFreeMonitoringStatus()
If free monitoring is disabled, the method returns a document similar to:如果禁用了自由监视,则该方法将返回类似于以下内容的文档:
{
"state" : "disabled",
"message" : "To see your monitoring data, navigate to the unique URL below.\nAnyone you share the URL with will also be able to view this page.\n\nhttps://cloud.mongodb.com/freemonitoring/mongo/MSBjZTZhNTJmOS0yODg1\n\nYou can disable monitoring at any time by running db.disableFreeMonitoring().",
"url" : "https://cloud.mongodb.com/freemonitoring/mongo/MSBjZTZhNTJmOS0yODg1",
"userReminder" : "",
"ok" : 1
}
Even when disabled, your unique URL is returned so that if you re-enable monitoring at a later time, you can access your previous metrics that has not expired within the past 24 hours.即使在禁用时,也会返回您的唯一URL,这样,如果您稍后重新启用监控,您就可以访问过去24小时内未过期的先前指标。