Managing Logs

CSS provides log backup and query functions to help you locate faults. You can back up cluster logs to OBS buckets and download required log files to analyze and locate faults.

Enabling Log Management

  1. Log in to the CSS management console.
  2. On the Clusters page, click the name of the cluster for which you want to back up the logs. The Basic Information page is displayed.
  3. Click the Logs tab, and enable the Log Management function.

    indicates that the log management function is disabled. indicates that the log management function is enabled.

  4. (Optional) After the log management function is enabled, CSS automatically creates the OBS bucket, backup path, and IAM agency for you to back up logs. The automatically created OBS bucket, backup path, and IAM agency are displayed on the page. If you want to change the OBS bucket, backup path, and IAM agency, click on the right of Log Backup Configuration.

    In the displayed Edit Log Backup Configuration dialog box, you can either select an existing OBS bucket and an IAM agency or create an OBS bucket and an IAM agency. To create an OBS bucket, click Create Bucket. To create an IAM agency, click Create IAM Agency. For details, see Creating a Bucket and Creating an Agency.

    Table 1 Parameter description

    Parameter

    Description

    Remarks

    OBS Bucket

    Name of the OBS bucket used for storing logs

    The OBS bucket must be in the same region as that of the cluster.

    Backup Path

    Storage path of logs in the OBS bucket

    The backup path configuration rules are as follows:
    • The backup path cannot contain the following characters: \:*?"<>|
    • The backup path cannot start with a slash (/).
    • The backup path cannot start or end with a period (.).
    • The total length of the backup path cannot exceed 1,023 characters.

    IAM Agency

    IAM agency authorized by the current account to CSS to access or maintain data stored in OBS.

    The following conditions must be met for existing IAM agencies or those to be created:

    • Select Cloud Service for the Agency Type.
    • Select Elasticsearch for Cloud Service.
    • The agency has the Tenant Administrator permission for the OBS project in Global service.
  5. Back up logs.
    1. Automatically backing up logs

      Click the icon on the right of Auto Backup to enable the auto backup function.

      indicates that the auto backup function is enabled, and indicates that the auto backup function is disabled.

      After enabling the auto backup function, set the backup start time on the Edit Auto Backup Policy page. When the setting is successful, the system automatically backs up logs at the scheduled time.

    1. Manually backing up logs

      On the Log Backup tab page, click Start Backup. On the displayed page, click Yes to start backup.

      If Task Status in the log backup list is Successful, the backup is successful.

      All logs in the cluster are copied to a specified OBS path. You can view or download log files in the path of the OBS bucket.

  6. Query logs.

    You can query logs of each node in a cluster based on the node, log type, and log level. The following log types are supported: running logs, index slow logs, search slow logs, and deprecation logs. When you query logs, the latest 10,000 logs are matched. A maximum of 100 logs are displayed.

    On the Log Search page, select the desired node, log type, and log level, and click . The search results are displayed.

Viewing Logs

After logs are backed up, you can click Backup Path to go to the OBS console and view the logs.

Figure 1 Viewing logs

Backed up logs mainly include deprecation logs, run logs, index slow logs, and search slow logs. Table 2 lists the storage types of the OBS bucket.

Table 2 Log list

Log File

Description

clustername_deprecation.log

Deprecation logs

clustername_index_indexing_slowlog.log

Search slow logs

clustername_index_search_slowlog.log

Index slow logs

clustername.log

Elasticsearch run logs

clustername_access.log

Access logs

clustername_audit.log

Audit logs