If you manage multiple PolarDB clusters with shared parameter settings, use parameter templates to centralize their configuration. This approach simplifies parameter management and accelerates cluster setup.
Create a parameter template
-
Log on to the PolarDB console. Select the cluster's region. In the left-side navigation pane, choose Parameter Templates.
-
On the Custom Parameter Templates tab, click Create Parameter Template. Configure the following parameters, and then click OK.
Parameter
Description
Template name
The template name must meet the following requirements:
-
It must contain only letters, digits, and underscores (_) and start with a letter. Chinese characters are not allowed.
-
It must be 8 to 64 characters long.
Database engine
Select a database engine. Valid values: MySQL, , or .
Database version
Select a database engine version. Valid values:
-
8.0
-
5.7
-
5.6
Description
(Optional) Enter a description for the template. The description can be up to 200 characters long and can be in any language.
Add parameter
Click Add Parameter to add a parameter row. Select a Parameter Name, and then set the Current Value based on the Description and Valid Value columns. You can also view information such as whether a cluster restart is required and the default value of the parameter.
Note-
To configure another parameter, click Add Parameter again.
-
To remove a parameter, click Delete to the right of the parameter.
Import parameter
Click Import Parameter and enter parameters and values. Use the
key=valueformat, and enter each key-value pair on a new line. For example:wait_timeout=60 thread_stack=262144 -
Apply a parameter template
After you create a parameter template, you can apply it to clusters in one of the following two ways:
-
Apply the template from the cluster details page: For the target PolarDB cluster, go to and click Apply Template. For more information, see Apply a template.
-
To apply the template directly to the cluster, follow the steps below.
If a parameter template contains parameters that require a cluster restart to take effect, apply the template during off-peak hours and ensure that your application has a reconnection mechanism.
-
Log on to the PolarDB console. Select the cluster's region. In the left-side navigation pane, choose Parameter Templates.
-
On the Custom Parameter Templates tab, find the target template and click Apply to Cluster in the Actions column.
-
On the Apply to Cluster page, select the target clusters. Click the
icon to add them to the selected list. Review the differences between the parameter values in the template and those in the clusters in the Parameter comparison section. After you confirm the changes, click OK.NoteWhen you apply a parameter template to multiple clusters, take note of the following:
-
Confirm that the parameters are suitable for all selected clusters. Proceed with caution.
-
You can apply a parameter template to a maximum of 10 clusters at a time. To apply the template to more than 10 clusters, perform the operation in batches.
-
A parameter template can only be applied to clusters in the same region. If your clusters are in a different region, you must first create the template in that region before applying it.
-
Clone a parameter template
-
Log on to the PolarDB console. Select the cluster's region. In the left-side navigation pane, choose Parameter Templates.
-
On the Custom Parameter Templates tab, find the target template and click Clone in the Actions column. Configure the following parameters, and then click OK.
Parameter
Description
Template name
The template name must meet the following requirements:
-
It must contain only letters, digits, and underscores (_) and start with a letter. Chinese characters are not allowed.
-
It must be 8 to 64 characters long.
Database engine
Select a database engine. Valid values: MySQL, , or .
Database version
Select a database engine version. Valid values:
-
8.0
-
5.7
-
5.6
Description
(Optional) Enter a description for the template. The description can be up to 200 characters long and can be in any language.
Add parameter
Click Add Parameter to add a parameter row. Select a Parameter Name, and then set the Current Value based on the Description and Valid Value columns. You can also view information such as whether a cluster restart is required and the default value of the parameter.
Note-
To configure another parameter, click Add Parameter again.
-
To remove a parameter, click Delete to the right of the parameter.
Import parameter
Click Import Parameter and enter parameters and values. Use the
key=valueformat, and enter each key-value pair on a new line. For example:wait_timeout=60 thread_stack=262144 -
Delete a parameter template
-
Log on to the PolarDB console. Select the cluster's region. In the left-side navigation pane, choose Parameter Templates.
-
On the Custom Parameter Templates tab, find the target template and click Delete in the Actions column.
To delete multiple parameter templates at once, select them and click Batch Delete.
Compare parameter templates
-
Log on to the PolarDB console. Select the cluster's region. In the left-side navigation pane, choose Parameter Templates.
-
On the Custom Parameter Templates tab, select the parameter templates that you want to compare and click Compare below the list.
-
On the Compare page, the Compare dialog box opens, displaying a table of parameters that have different values. Different values are highlighted in red. For example, the values of the
wait_timeoutparameter in different templates might be 86400, 43200, and 172800.
API reference
|
API |
Description |
|
Creates a parameter group. |
|
|
Queries for a list of parameter groups. |
|
|
Queries for the details of a parameter group. |
|
|
Modifies cluster parameters or applies a parameter group. |
|
|
Deletes a parameter group. |