Basic Management

This section will introduce the basic operation and maintenance management of MatrixDB, including start and stop, checking the operating status, modifying the cluster configuration, etc. These commands are controlled through the master node, so they must be executed on the master node.

1. Start MatrixDB

The gpstart -a command can start a MatrixDB cluster.

[mxadmin@mdw ~]$ gpstart -a
20210723:16:00:36:002624 gpstart:sdw2:mxadmin-[INFO]:-Starting gpstart with args: -a
20210723:16:00:36:002624 gpstart:sdw2:mxadmin-[INFO]:-Gathering information and validating the environment...
20210723:16:00:36:002624 gpstart:sdw2:mxadmin-[INFO]:-Greenplum Binary Version: 'postgres (MatrixDB) 4.1.0-community (Greenplum Database) 7.0.0+dev.16905.gc6dbf4f14d build commit:c6dbf4f14d4452a414198fd45d507819803fffb2'

......

20210723:16:00:38:002624 gpstart:sdw2:mxadmin-[INFO]:-Database successfully started

For detailed usage of gpstart, please refer to Document

2. Stop MatrixDB

The gpstop -a command is used to stop a running cluster.

[mxadmin@mdw ~]$ gpstop -a
20210723:16:08:41:002827 gpstop:sdw2:mxadmin-[INFO]:-Starting gpstop with args: -a
20210723:16:08:41:002827 gpstop:sdw2:mxadmin-[INFO]:-Gathering information and validating the environment...

......

20210723:16:08:43:002827 gpstop:sdw2:mxadmin-[INFO]:-Successfully shutdown 1 of 1 segment instances
20210723:16:08:43:002827 gpstop:sdw2:mxadmin-[INFO]:-Database successfully shutdown with no errors reported

The prerequisite for stopping the cluster with gpstop -a is that there is currently no active connection, otherwise it will be suspended until other connections exit. If you want to forcefully kill the user connection and close the cluster, use gpstop -a -M fast.

2.1 Restart

gpstop -ar can restart the cluster.

2.2 Reload the authorization configuration

After modifying the pg_hba.conf authorization configuration, you need to call gpstop -u to reload the authorization configuration.

For detailed usage of gpstop, please refer to Document

3. Check the cluster status

gpstate can view the running status of the cluster, including:

  • Master and segment configuration information
  • Mirror configuration, etc.
    
    [mxadmin@mdw ~]$ gpstate
    20210723:17:00:15:004109 gpstate:sdw2:mxadmin-[INFO]:-Starting gpstate with args:

......

20210723:17:00:15:004109 gpstate:sdw2:mxadmin-[INFO]:-Obtaining Segment details from master... 20210723:17:00:15:004109 gpstate:sdw2:mxadmin-[INFO]:-Gathering data from segments... 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:-Greenplum instance status summary 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:----------------------------------------------------- 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Master instance = Active 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Master standby = No master standby configured 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total segment instance count from metadata = 1 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:----------------------------------------------------- 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Primary Segment Status 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:----------------------------------------------------- 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total primary segments = 1 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total primary segment valid (at master) = 1 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total primary segment failures (at master) = 0 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number of postmaster.pid files missing = 0 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number of postmaster.pid files found = 1 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number of postmaster.pid PIDs missing = 0 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number of postmaster.pid PIDs found = 1 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number of /tmp lock files missing = 0 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number of /tmp lock files found = 1 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number postmaster processes missing = 0 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Total number postmaster processes found = 1 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:----------------------------------------------------- 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Mirror Segment Status 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:----------------------------------------------------- 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:- Mirrors not configured on this array 20210723:17:00:16:004109 gpstate:sdw2:mxadmin-[INFO]:-----------------------------------------------------

## 4. Modify cluster configuration
`gpconfig` is used to view or modify configuration parameters in the configuration file `postgresql.conf`.

### 4.1 View configuration
You can view the configuration by adding the configuration name:

[mxadmin@mdw ~]$ gpconfig -s shared_buffers Values on all segments are consistent GUC : shared_buffers Master value: 1078464kB Segment value: 1078464kB

### 4.2 Modify the configuration
Modify the configuration via `gpconfig -c {config name} -v {value}`:

[mxadmin@mdw ~]$ gpconfig -c shared_buffers -v 128MB 20210723:17:13:35:004318 gpconfig:sdw2:mxadmin-[INFO]:-completed successfully with parameters '-c shared_buffers -v 128MB'

After modifying the configuration, you must restart the cluster before it can take effect:

[mxadmin@mdw ~]$ gpstop -ar

After restarting, check the configuration:

[mxadmin@mdw ~]$ gpconfig -s shared_buffers Values on all segments are consistent GUC : shared_buffers Master value: 128MB Segment value: 128MB


> For detailed usage methods of gpconfig, please refer to [Document](/doc/latest/tools/gpconfig)