After you create a PolarDB cluster, you can use the console to modify cluster and node parameters and export the cluster parameters as a template. You can also apply a parameter template to quickly modify parameters for other clusters in the same region. This topic describes how to modify parameters, export them as a template, and apply a template.
Background information
You can configure PolarDB node parameters to suit your business requirements.
-
New nodes added to a cluster use cluster parameters by default.
-
If the primary node fails:
-
The original primary node becomes a read-only node, and its parameters remain unchanged.
-
An original read-only node is promoted to the primary node, and its parameters remain unchanged.
-
-
If the primary zone fails, a node in the secondary zone is promoted to the primary node and uses the cluster parameters.
Usage notes
-
For compatibility with MySQL configuration files, all cluster parameters in the PolarDB console use the
loose_prefix.For example,
loose_rds_audit_log_event_buffer_sizeandrds_audit_log_event_buffer_sizeare the same parameter. -
Only some node parameters or parameter values can be modified. For more information, see the supported options in the console.
-
To modify a node parameter that you cannot modify in the console, go to Quota Center. Find the quota named Set cluster and node parameters, click Apply in the Actions column, and then enter the cluster ID and the parameters that you want to modify in the Reason for Request field.
Note-
Currently, only the following parameters can be modified:
-
PolarDB for MySQL 5.6 and 5.7: the node parameter
innodb_buffer_pool_size. -
PolarDB for MySQL 8.0: the node parameters
innodb_buffer_pool_size,loose_oss_outfile_buffer_size,loose_max_oss_outfile_threads, andloose_csv_oss_buff_size.
-
-
If you have questions or need to modify other parameters, contact us.
-
Modify parameter values
Changes to cluster parameters affect all nodes in the cluster. Changes to node parameters affect only the specified node. This section provides an example of how to modify cluster parameters.
Log on to the PolarDB console.
In the upper-left corner, select the region where the cluster is deployed.
Find the target cluster and click its ID.
-
In the left-side navigation pane, choose .
-
To modify cluster parameters, select Cluster from the drop-down list in the upper-left corner.
To modify node parameters, select the node from the drop-down list.
-
In the upper-left corner of the page, click Modify Parameter.
-
Find the parameter and enter a new value.
Note-
You must enter a value within the range specified in the Range to Be Modified column. Otherwise, an error occurs when you click Submit Changes.
-
You can click the
icon next to a parameter name to view its details. -
For compatibility, the
loose_prefix is used for parameters in the console. For example,loose_rds_audit_log_event_buffer_sizeandrds_audit_log_event_buffer_sizeare the same parameter.
-
-
In the upper-left corner, click Submit Changes.
-
On the Save Changes page, select the nodes to update and click OK.
The parameter change table in the dialog box includes the Parameter, New Value, Current Value, Default Value, and Global Parameter columns. You can quickly adjust parameters by clicking Set All to Current Value or Set All to Default Value. When you modify a global parameter, all nodes are selected by default.
Note-
For parameters whose Force Restart value is Yes, you must restart all nodes in the cluster for the new parameter values to take effect. Before you restart the cluster, plan for this downtime and proceed with caution.
-
If your PolarDB for MySQL cluster is version 8.0, you can also set the innodb_fast_startup parameter to ON to accelerate the restart.
-
Apply a parameter template
After you configure parameters, you can do the following:
-
Export the cluster parameters 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 located.
-
Find the cluster and click its cluster ID.
-
In the left-side navigation pane, click .
-
Click Export as Template.
Note-
If you want to change parameters in the current list, modify them first, and then click Export as Template.
-
The exported parameter template includes parameters you manually modified and those that the cluster automatically adjusted during runtime.
-
-
In the Apply Template dialog box, configure the following parameters.
Parameter
Description
Template Name
The template name, which must meet the following requirements:
-
It must start with a letter and can contain only letters, digits, and underscores (_).
-
It must be 8 to 64 characters in length.
Description
Enter a description for the template. The description can be 0 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 parameter template that you want to use and click OK.
Note-
You can view the number of parameters in the template, whether a restart is required, and the update time.
-
If the parameter template contains parameters that require a cluster restart, perform this operation during off-peak hours and ensure that your application has a reconnection mechanism.
-
You can also apply a parameter template to a cluster on the parameter template page. For more information, see Apply a parameter template.
-
-
Compare node parameters
You can use the Compare feature to compare parameter configurations between different nodes.
Log on to the PolarDB console.
In the upper-left corner, select the region where the cluster is deployed.
Find the target cluster and click its ID.
-
In the left-side navigation pane, choose .
-
In the upper-left corner of the page, click Compare.
In the Compare panel, select the nodes to compare (for example, primary node and read-only node).
-
Review the comparison results, which show differences such as the number of different parameters and whether a restart is required.
API reference
|
API |
Description |
|
Queries the parameters of a cluster. |
|
|
Modifies the parameters of a cluster. |
|
|
Modifies cluster parameters and applies the changes to specified nodes. |
|
|
Modifies the parameters of one or more specified nodes. |
|
|
Queries a list of default parameter templates. |