The dynamic parameters of CN (Compute Node) can be directly modified within the yaml of the PolarDBXCluster object, as detailed in .spec.config.cn.dynamic. However, this method of configuration has its issues:
- With numerous cluster configuration items, the cluster definition becomes excessively lengthy and obscures other details.
- The PolarDBXCluster is responsible not only for the maintenance of the cluster (containers) but also for configuration management, which is logically complex and prone to errors.
- One-way synchronization leads to the invalidation of parameters set through other methods (such as set global). Therefore, in the open-source version, it is supported to modify the dynamic parameters of CN through the Knobs object. The yaml definition of a Knobs object is as follows:
apiVersion: polardbx.aliyun.com/v1
kind: PolarDBXClusterKnobs
metadata:
name: polardbx-xcluster
namespace: development
spec:
## The instance name of PolarDB-X
clusterName: "polardbx-xcluster"
# No need to specify when creating
knobs:
## List of parameters
CONN_POOL_MAX_POOL_SIZE: 100
RECORD_SQL: "true"
Note: For a detailed list of CN's dynamic parameters, refer to: https://help.aliyun.com/document_detail/316576.html
Note: Boolean parameter values need to be passed in as strings.
After editing the above yaml file, execute it with
kubectl apply -f {knobs yaml file}
Use the following command to view the list of knobs:
kubectl get pxcknobs