All Products
Search
Document Center

PolarDB:Configure cluster and node parameters

更新時間:Nov 20, 2024

After you create a PolarDB cluster, you can modify the parameters of the cluster and its nodes in the PolarDB console and export the modified parameters as a template. You can apply the template to clusters that are deployed in the same region for easy parameter modification. This topic describes how to modify the parameters of a cluster and its nodes, export the modified parameters as a template, and apply the template.

Background information

PolarDB allows you to configure parameters of cluster nodes based on your business requirements.

  • After you add a new node to a cluster, the parameter settings of the cluster are automatically applied to the node.

  • When the primary node is unavailable, a read-only node takes over.

    • The original primary node becomes a read-only node, and the parameters of the node remain unchanged.

    • The original read-only node becomes the primary node, and the parameters of the node remain unchanged.

  • When the primary zone fails, a node in the secondary zone becomes the new primary node. The parameter settings of the cluster are applied to the new primary node.

Precautions

You can modify only some of the node parameters in the PolarDB console.

To modify the node parameters that cannot be modified in the console, go to Quota Center. Then, click Apply in the Actions column corresponding to the Set cluster parameters and node parameters quota name. In the Reason section, specify the parameters and cluster ID that you want to modify.

Note
  • You can modify only the following node parameters:

    • PolarDB for MySQL 5.6 and 5.7: innodb_buffer_pool_size.

    • PolarDB for MySQL 8.0: innodb_buffer_pool_size, loose_oss_outfile_buffer_size, loose_max_oss_outfile_threads, and loose_csv_oss_buff_size.

  • If you need assistance for the configuration or want to modify other node parameters, please Contact us for assistance.

Modify parameters

After you modify a cluster parameter, the modification takes effect on all nodes in the cluster. After you modify a node parameter, the modification takes effect only on the current node. The following section provides an example on how to modify cluster parameters:

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region in which the cluster is deployed.

  3. Find the cluster and click its ID.

  4. In the left-side navigation pane, choose Settings and Management > Parameters.

  5. Select Cluster from the drop-down list in the upper-left corner.

    If you want to modify the parameters of a node, select the node from the drop-down list in the upper-left corner.

    选择节点

  6. In the upper-left corner of the page, click Modify.

  7. Find the parameter and enter a new value.

    填写参数

    Note
    • You must enter values in the range specified in the Range to Be Modified column. Otherwise, an error message appears when you click Submit Changes.

    • You can click the 参数图标 icon to the right of a parameter to view the details of the parameter.

    • In the PolarDB console, each parameter is prefixed with "loose_" to distinguish them from other types of variables or settings. For example, the "loose_" prefix is added to the rds_audit_log_event_buffer_size parameter in the PolarDB console.

  8. Click Submit Changes in the upper-left corner.

  9. In the Save Changes panel, select the node on which you want the modification to take effect and click OK.

    保存改动

    Note
    • Changes to parameters whose Force Restart value is Yes take effect only after all nodes in the cluster are restarted. Before the nodes are restarted, verify that the restart does not affect your services.

    • If your cluster runs PolarDB for MySQL 8.0, you can set the innodb_fast_startup parameter to ON to accelerate the restart process.

Apply a parameter template

After you configure parameters, you can perform the following steps to apply a parameter template:

  • Export the parameter settings of a cluster as a parameter template.

    1. Log on to the PolarDB console.

    2. In the upper-left corner of the console, select the region where the cluster is deployed.

    3. Find the cluster and click the cluster ID.

    4. In the left-side navigation pane, choose Settings and Management > Parameters.

    5. Click Export as Template.

      Note
      • If you want to modify parameters in the template, we recommend that you first modify the parameters, and then click Export as Template.

      • The parameters in the exported template include the parameters that you manually modified and the parameters that are automatically modified by the running cluster.

    6. In the Apply Template dialog box, configure the parameters. The following table describes the parameters.

      Parameter

      Description

      Template Name

      The name of the parameter template. The name must meet the following requirements:

      • It can contain letters, digits, and underscores (_) and cannot contain Chinese characters. It must start with a letter.

      • It must be 8 to 64 characters in length.

      Description

      The description of the parameter template. The description can be up to 200 characters in length.

    7. Click OK.

  • Apply a parameter template to a cluster.

    1. Click Apply Template.

    2. In the Apply Template dialog box, select the name of the template that you want to apply and click OK.

      Note
      • You can view the number of parameters, whether a restart is required, and the update time.

      • If a restart is required, we recommend that you apply the parameter template during off-peak hours and make sure that your application can automatically reconnect to the cluster.

      • You can apply a parameter template to clusters on the Parameter Templates page. For more information, see Apply a parameter template.

Compare the parameter settings of different nodes

You can use the parameter value comparison feature to compare the parameter settings of different nodes.

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region in which the cluster is deployed.

  3. Find the cluster and click its ID.

  4. In the left-side navigation pane, select Settings and Management > Parameters.

  5. In the upper-left corner of the page, click Compare.

    对比参数

  6. Select the nodes whose parameter settings you want to compare. Then, you can view the comparison results.

Related API operations

Operation

Description

DescribeDBClusterParameters

Queries cluster parameters.

ModifyDBClusterParameters

Modifies cluster parameters.

ModifyDBClusterAndNodesParameters

Modifies cluster parameters and applies the modified parameters to specified nodes.

ModifyDBNodesParameters

Modifies the parameters of a single node and applies them to the node.

DescribeParameterTemplates

Queries the default parameters in a parameter template.