The gpconfig tool allows users to set, restore or view configuration parameters in the postgresql.conf file of all instances (Master, Segment, and mirrors) of MatrixDB cluster. When setting parameters, you can also specify a different value for the Master if needed. For example, the max_connections parameter requires that the setting of the Master is different from the setting of the Segment. If you want to set or restore global parameters or only parameters that can be set for Master, use the --masteronly
option.
Not all parameters can be configured using gpconfig. For example, users cannot use it to set the port
parameter, which is different for each Segment instance. The -l
option can view the complete list of configuration parameters supported by gpconfig.
After setting configuration parameters using gpconfig, the parameter value appears at the bottom of the postgresql.conf file. When using gpconfig to remove configuration parameters, the configuration parameters are commented out in the postgresql.conf file, thus restoring the default settings. If you use gpconfig to delete a parameter and add it back later (set a new value), then there will be two instances of the parameter, one commented out and the other enabled and added to the bottom of the postgresql.conf file.
After setting parameters, the user may need to restart the cluster, or reload the postgresql.conf file for the changes to take effect. Whether a restart is required depends on the parameters being set.
To display the setting value of the current parameter in the system, use the -s
option.
gpconfig uses the following environment variables to connect to the Master instance of the MatrixDB cluster and get system configuration information:
Parameter name | Description |
---|---|
-c param_name or --change param_name | Change the settings of configuration parameters by adding new settings at the bottom of the postgresql.conf file. |
-v value or --value value | value is used for the value of the configuration parameter specified by the -c option. By default, this value applies to all Segments and their images, Master, and Standby. Arguments that are not single characters or numbers must be wrapped in single quotes ('). For example, a string that includes spaces or special characters. If you want to embed single quotes into a string parameter, you need to transfer it with 2 single quotes or backslashes ('' or \'). |
-m master_value or --mastervalue master_value | is used to set the configuration of the Master and Standby nodes separately to make them different from the configuration of the Segment node when setting parameters. |
--masteronly | When specified, gpconfig will only edit the postgresql.conf file of Master. |
-r param_name or --remove param_name | Remove configuration parameters by commenting out configuration items in postgresql.conf file. |
-l or --list | list all configuration parameters modified by gpconfig tools. |
-s param_name or --show param_name | Displays the configuration parameter values used on all instances (Master and Segment) in the MatrixDB cluster. The displayed value is the current value of the cluster. If the modification has not been restarted, the old value is still seen. |
--file | Displays the values in the postgresql.conf configuration file for all instances (Master and Segment) in the MatrixDB cluster. Values in the configuration file may not take effect because the cluster has not been restarted. Not used with the --file-compare option. |
--file-compare | For configuration parameters, compare the effective values in the current MatrixDB cluster (Master and Segment) with the values in the configuration file postgresql.conf. If the values are different, the values from all hosts are displayed; if the values are the same, the summary report is displayed. Not used with the --file option. |
--skipvalidation | Skip validity checks when setting parameters. Extremely careful when setting configuration parameters using this option. |
--verbose | Show additional log information during command execution. |
--debug | Set the log output level to the debug level. |
? or -h or --help | Show help information. |
Check the shared_buffers
configuration information:
gpconfig -s shared_buffers
Set gp_resource_manager
to queue
:
gpconfig -c gp_resource_manager -v queue
Set the value of the segment node max_connections
to 180 and the value of the master node 60
gpconfig -c max_connections -v 180 -m 60