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 following node parameters:
  • The innodb_buffer_pool_size parameter on PolarDB for MySQL 5.6 and 5.7 clusters.
  • The innodb_buffer_pool_size, loose_oss_outfile_buffer_size, loose_max_oss_outfile_threads, and loose_csv_oss_buff_size parameters on PolarDB for MySQL 8.0 clusters.
To modify other node parameters, go to Quota Center. Click Apply in the Actions column corresponding to Set cluster parameters and node parameters.

Modify parameters

After you modify a cluster parameter, it takes effect on all nodes in the cluster. After you modify a cluster parameter, it takes effect only on the current node. The following example shows how to modify cluster parameters.

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
  3. Find the cluster and click the cluster 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 node parameters, select the node whose parameters you want to modify.
    Select a node
  6. In the upper-left corner of the page, click Modify.
  7. Find the parameter and enter a new value.
    Enter a parameter value
    Note
    • You must enter the values that meet the requirements described in the Value Range column. Otherwise, an error message appears when you click Apply Changes.
    • You can move the pointer over the Parameter icon icon of a parameter to view the details of the parameter.
  8. Click Apply Changes in the upper-left corner.
  9. In the Save Changes panel, select the node to which you want the modification applies and click OK.
    Save changes
    Note
    • After modifications are applied to parameters whose Force Restart values are Yes, the new values take effect only after all nodes in the cluster are restarted. Before the nodes are restarted, we recommend that you make sure that your services will not be adversely affected. Proceed with caution.
    • If your cluster version is 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 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. Find the cluster and click the cluster ID.
    4. In the left-side navigation pane, choose Settings and Management > Parameters.
    5. 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.
    6. In the Apply Template dialog box, set the following parameters.
      ParameterDescription
      Template NameThe name of the 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.
      DescriptionThe description of the parameter template. The description can be up to 200 characters in length.
    7. 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 in which the cluster that you want to manage is deployed.
  3. Find the cluster 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.
    Compare parameter settings
  6. Select the node whose parameter settings that you want to compare. Then, you can view the comparison results.

Related API operations

OperationDescription
DescribeDBClusterParametersQueries cluster parameters.
ModifyDBClusterParametersModifies cluster parameters.
ModifyDBClusterAndNodesParametersModifies cluster parameters and applies them to specified nodes.
ModifyDBNodesParametersModifies the parameters of a single node and applies them to a specified node.
DescribeParameterTemplatesQueries the default parameters.