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.
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
, andloose_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:
Log on to the PolarDB console.
In the upper-left corner, select the region in which the cluster is deployed.
Find the cluster and click its 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 the parameters of a node, select the node from the drop-down list in the upper-left corner.
In the upper-left corner of the page, click Modify.
Find the parameter and enter a new value.
NoteYou 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.
Click Submit Changes in the upper-left corner.
In the Save Changes panel, select the node on which you want the modification to take effect and click OK.
NoteChanges 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.
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 as Template.
NoteIf 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.
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.
Click OK.
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.
NoteYou 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.
Log on to the PolarDB console.
In the upper-left corner, select the region in which the cluster is deployed.
Find the cluster and click its ID.
In the left-side navigation pane, select .
In the upper-left corner of the page, click Compare.
Select the nodes whose parameter settings you want to compare. Then, you can view the comparison results.
Related API operations
Operation | Description |
Queries cluster parameters. | |
Modifies cluster parameters. | |
Modifies cluster parameters and applies the modified parameters to specified nodes. | |
Modifies the parameters of a single node and applies them to the node. | |
Queries the default parameters in a parameter template. |