Daily Management

This document will introduce YMatrix's daily operation and maintenance management tools, mainly in the following two parts:

  • Use Command Line Tools to start and stop the cluster, view the cluster running status, modify the cluster configuration, etc.
  • Use Graphic Interface to view cluster information.

Notes!
Command line tools are controlled through the master node, so they must be executed on the Master node.

YMatrix 5 launches a brand new database architecture. Under this architecture, we provide the latest cluster operation and maintenance tools: mxstart, mxstop, mxstate. For more information about the new YMatrix 5 architecture, please see YMatirx Architecture.

Notes!
YMatrix 5 uses the new operation and maintenance tool to manage the cluster by default, and YMatrix 4 (MatrixDB 4) still uses the Greenplum series operation and maintenance tool by default. For details, please see YMatrix 4 Cluster Basic Management.


1 Command Line Tools

1.1 Start the cluster

The mxstart -a command can start the YMatrix cluster.

[mxadmin@mdw ~]$ mxstart -a

1.2 Stop the cluster

The mxstop -a command is used to stop a running YMatrix cluster.

mxstop mode parameters disable new connection wait for the process to run Is it the default mode
smart -M smart Yes Yes
fast -M fast Yes No, interrupted connection, transaction rollback No
immediate -M immediate Yes No, kill the process directly No
[mxadmin@mdw ~]$ mxstop -a -M fast

Please select a mode to stop the cluster. For most cases of YMatrix clusters, using fast mode is the best way to do it. If you do not select mode (mxstop -a), the smart mode is enabled for you by default to ensure that the operations you are doing can be completed naturally, but may wait for a long time. Blocking of this command will not affect the use of the cluster, but the cluster cannot create new connections.

1.2.1 Restart the cluster

mxstop -ar can restart the cluster.

1.2.2 Reload the authorization configuration

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

1.3 Check the cluster status

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

  • Master configuration information.
  • Segment configuration information.
  • Mirror information, etc.
    [mxadmin@mdw ~]$ mxstate

    1.4 Modify cluster configuration

gpconfig is used to view or modify configuration parameters in the configuration file postgresql.conf.

1.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

1.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 ~]$ mxstop -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

Notes!
For details of gpconfig, please refer to gpconfig


2 Graphic page

Normally, you may get cluster meta information through system tables such as pg_database, pg_class.
To view this information more conveniently and intuitively (databases, data tables, and each table size, type, access time, etc.), YMatrix provides a graphical work page that can be easily clicked to get what you need.

2.1 Preparation

First, you need to log in to the graphical interface. Enter the IP of the machine where the graphical interface MXUI process is located (the default is the IP of Master) and the port number:

http://<IP>:8240

2.2 Cluster Management

2.2.1 Indicator View

After successfully logging in, enter the "Cluster Management" page, and the "Metrics View" is displayed by default, including 2 parts:

  1. Cluster information: including cluster status, data, quantity and database version information.
  2. Indicator information: resource usage of database connections, core indicator information of each node. YMatrix automatically collects and displays the indicator information every 5 seconds, including CPU usage, memory usage, disk I/O, network I/O, connection number, etc.

2.2.2 Instance View

Switch to the "Instance View". Node information changes from metrics to instance status and distribution.

Hover over any instance to view its detailed information.

2.2.3 List View

Switch to the "List View" to display node information in tabular format, including instance status, DBID, port, storage path, etc.

2.3 Table Information

2.3.1 Basic Table Information

Click the "Tables" option on the left to go to the table page. All databases are displayed:

You can also select a specific database from the list:

A list of all tables in the selected database appears, showing statistics such as table name, database name, schema, number of partitions, size, owner, estimated row count, last access time, last modification time, and last statistics update time.

2.3.2 Detailed Table Information

Click on a specific table to view its detailed information.
The detail page has two sections: Basic Info and Structure Info.

Basic information is similar to what is shown in the list view. Below is statistical data:

Table structure:

For partitioned tables, you can view detailed information about each partition:

You can have a detailed understanding of the data table information through the above two pages to manage and operate the cluster.