You can query the error logs of an instance in the console.

Prerequisites

A replica set instance with more than three nodes or a sharded cluster instance is used.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and the region of the target instance.
  3. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on the instance type.
  4. Find the target instance and click its ID.
  5. In the left-side navigation pane, choose Logs > Error Logs.
  6. Perform the following steps based on instance types:
    • Replica set instances: You can select the node role and time range to query the corresponding error logs.
    • Sharded cluster instances: You can query error logs of Mongos or shard nodes.
      Note Mongos nodes have IDs prefixed with s-. Shard nodes have IDs prefixed with d-.
      • Query the error logs of a Mongos node.

        You can select the Mongos node ID and time range to query the error logs.

      • Query the error logs of a shard node.

        You can select the shard node ID, role, and time range to query the error logs.