After you create a PolarDB cluster, you can modify the parameters of the cluster and its nodes in the console and export the modified parameters as templates. You can also apply templates 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 templates, and apply the templates.

Background information

PolarDB allows you to configure the parameters of each cluster node based on your business requirements.
  • After a new node is added to a cluster, parameters of the cluster are applied to the node by default.
  • 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 is promoted to become the new primary node and parameters of the cluster are applied to the new primary node.

Precautions

You can only modify the innodb_buffer_pool_size parameter for nodes in a PolarDB for MySQL 8.0 cluster. To modify other node parameters, Submit a ticket to contact technical support.

Modify parameters

The following example describes how to modify node parameters.

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster that you want to manage is deployed.
  3. Find the cluster you want to manage and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Parameters.
  5. Select the node whose parameters you want to modify from the drop-down list in the upper-left corner.
    Select a node
  6. In the upper-left corner of the page, click Modify.
  7. Find the parameter whose value you want to change, and enter the new value in the Cluster Parameter column.
  8. In the upper-left corner of the page, click Apply Changes. In the Save Changes dialog box, click OK.
  9. In the Save Changes panel, select the node to which you want the modification applies and click OK.

Apply a parameter template

After you specify the 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. In the left-side navigation pane, click Clusters.
    4. On the Clusters page, click the name of the cluster.
    5. In the left-side navigation pane, choose Settings and Management > Parameters.
    6. Click Export Template.
      Note
      • If you want to modify parameters, we recommend that you first modify parameters and apply changes, and then click Export Template.
      • Parameters in the exported template include the parameters that are manually modified and the parameters that are automatically modified by the running cluster.
    7. In the Apply Template dialog box, set the following 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 (_). It must start with a letter and cannot contain Chinese characters.
      • 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.
    8. Click Next Step.
  • 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 is configured to automatically reconnect to the cluster.
      • You can also apply a parameter template to the cluster 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 function to compare the parameter settings of different nodes.

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster that you want to manage is deployed.
  3. Find the cluster you want to manage and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Parameters.
  5. In the upper-left corner of the page, click Compare.
  6. Select the node whose parameter settings that 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 them to specified nodes.
ModifyDBNodesParameters Modifies the parameters of a single node and applies them to a specified node.
DescribeParameterTemplates Queries the default parameters.