YMatrix
Quick Start
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Migration
Data Query
Maintenance and Monitoring
Performance Tuning
Troubleshooting
Reference Guide
SQL Reference
FAQ
Stop or restart the YMatrix database system.
The mxstop tool is used to stop, restart the database cluster, or reload the configuration. When you stop a YMatrix cluster, you are actually stopping multiple postgres database server processes managed by the Data Replica Service. The mxstop tool uses the Data Replica service to handle the shutdown of individual instances.
By default, stopping is not allowed if any clients are connected to the database. You need to use the -M fast
option to roll back all running transactions and terminate all connections. If any transactions are in progress, the default behavior is to wait for them to be submitted before stopping.
Use the -u
option to reload the configuration, which reloads the configuration of the pg_hba.conf
file of all postgres instances, and the runtime configuration parameters in the postgresql.conf
file.
Parameter name | Description |
---|---|
-c or --db-cluster-id |
The ID of the target database cluster, if omitted, uses the default ID. |
-m | Stops the master instance started in utility mode. |
-M fast | Stop quickly, any ongoing transaction will be interrupted and rolled back. |
-M immediate | Stop immediately, any ongoing transaction will be aborted. This mode kills all postgres processes without allowing the database to complete other cleanups such as transactions. |
-M smart | Smart stop. If an active connection exists, this command will fail with a warning. This is the default mode. |
-a or --no-prompt | Do not prompt the user to confirm. |
-y or --no-standby | Do not stop the standby instance. The standby instance is stopped by default when this parameter is not used. |
-q or --quiet | Run in silent mode. The command output is not displayed on the screen, but is still written to the log file. |
-u or --reload | This option reloads the pg_hba.conf file of all postgres instances and the runtime parameters in the postgresql.conf file, but does not stop the DB cluster. After editing postgresql.conf or pg_hba.conf , use this option to make the new configuration take effect. Please note that this method is only applicable to runtime configuration parameters. |
-r or --restart | Restart the cluster. |
-t or --timeout |
Specifies the timeout threshold (in seconds) waiting for the segment instance to stop. If the segment instance does not stop within the specified number of seconds, mxstop displays a message indicating that one or more segments are still in the stop process and the database cluster cannot be restarted until the segment instance is stopped. This option is very useful when there are very large transactions that need to be rolled back during a cluster stop. These large transactions may take one minute to roll back and exceed a default timeout of 600 seconds. |
-h or --help | Show help information. |
Stop YMatrix default cluster in fast mode (no prompt for confirmation):
mxstop -a -M fast
Restart the YMatrix cluster (no prompt for confirmation):
mxstop -ar
Reload the configuration:
mxstop -u
Notes!
YMatrix 5 deploys a brand new database schema, enables the mxstop tool to stop the cluster, and is incompatible with gpstop. Previous versions were available with the gpstop tool.