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
- 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
, andloose_csv_oss_buff_size
parameters on PolarDB for MySQL 8.0 clusters.
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.
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
- Find the cluster and click the cluster ID.
- In the left-side navigation pane, choose .
- 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.
- In the upper-left corner of the page, click Modify.
- Find the parameter and enter a new 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
icon of a parameter to view the details of the parameter.
- Click Apply Changes in the upper-left corner.
- In the Save Changes panel, select the node to which you want the modification applies and click OK. 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
- Export the parameter settings of a cluster as a parameter template.
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster is deployed.
- Find the cluster and click the cluster ID.
- In the left-side navigation pane, choose .
- 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.
- In the Apply Template dialog box, set the following parameters.
Parameter Description Template Name The 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.
Description The description of the parameter template. The description can be up to 200 characters in length. - Click Next Step.
- Apply a parameter template to a cluster
- Click Apply Template.
- 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.
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
- Find the cluster and click the cluster ID.
- In the left-side navigation pane, choose .
- In the upper-left corner of the page, click Compare.
- 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. |