默认情况下,Atlas UI 从集群的主成员读取数据。要将读取操作发送到其他成员(例如分析节点) ,请为连接设置读取首选项。
重要
您的阅读偏好设置仅适用于当前浏览器会话。关闭或重新加载页面后,Atlas 用户界面将再次使用默认阅读偏好设置。
开始之前
To configure a read preference, you must have at least Project Data Access Read Only access to the project.
步骤
AtlasGoData Explorer在Atlas中,Go项目的 页面。
如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含项目的组织。
如果尚未显示,请从导航栏的 Projects 菜单中选择您的项目。
在侧边栏中,单击 Database 标题下的 Data Explorer。
显示数据浏览器。
重要提示:您还可以单击集群的名称以打开 Cluster侧边栏,然后单击Data Explorer Shortcuts标题下的 。
选择阅读偏好模式。
Under Read Preference, select one of the following modes:
Default这样一来,读取首选项就未设置,因此 Atlas UI 会从主目录读取数据。
- Primary
- Primary Preferred
- Secondary
- Secondary Preferred
- Nearest
要了解每种模式如何路由读取操作,请参阅读取首选项模式。
可选。指定读取偏好标签和最大过期时间。
If you select Primary Preferred, Secondary, Secondary Preferred, or Nearest, you can also set the following fields:
Read Preference Tags: Enter each tag set as comma-separated
key:valuepairs, such asnodeType:ANALYTICS,region:US_EAST_1. To add another tag set, click the icon.Atlas UI 会按顺序尝试匹配标签集。如果找不到与您的标签集匹配的成员,请将最后一个标签集留空,以便回退到任何符合条件的成员。要了解 Atlas 为您的集群节点应用了哪些标签,请参阅“使用预定义的副本集标签进行查询”。
Max Staleness Seconds: The maximum replication lag, in seconds, that a secondary can have and still be eligible for reads. You must set Max Staleness Seconds to at least
90.
例子
To read only from the analytics nodes in your cluster, set the following values in the Edit Connection dialog box:
Read Preference: Secondary
Read Preference Tags:
nodeType:ANALYTICS