YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Scene Application Examples
Federal Query
Maintenance and Monitoring
Global Maintenance
Partition Maintenance
Backup and Restore
Cluster Expansion
Enable Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Stream Processing
DR (Disaster Recovery)
Configuration Parameters
Index
Extension
SQL Reference
FAQ
No matter how stable and robust a system is, it cannot guarantee that there will be no failure. In order to prevent data loss, regular backups are required. YMatrix provides mxbackup
and mxrestore
tools to implement backup and recovery of clusters.
Parameters | Description |
---|---|
--dbname | Backup database |
--backup-dir | Dir directory for storing backup files |
--metadata-only | Back up only metadata (DDL), not data in table |
--data-only | In contrast to --metadata-only, only backup data |
--jobs | The number of tasks during parallel backup, increasing this value can increase parallelism |
--include-table | Specify the table to be backed up, the format is \<schema-name>.\<table-name>, and multiple tables can be specified. |
Notes!
For details on the use of mxbackup tool, please refer to mxbackup
The basic usage is as follows:
mxbackup --dbname test --backup-dir /home/mxadmin/backup
Notes!
mxbackup does not provide database connection parameters, so it must be executed on the Master node and logged in with a password-free account. Please configure the PGHOST, PGUSER, and PGPORT environment variables before logging in.
After executing the above command, let’s take a look at the contents of the file in the directory. The file levels of the backup directory are as follows:
mxseg{node number}/backups/{date}/{date + timestamp}
The backup data is in this directory.
The node number Master is -1, and the Segment starts from 0. If there are multiple nodes on the host, there are multiple mxseg{node number} directories.
mxrestore is used to restore backup data generated with mxbackup. The usage is as follows:
mxrestore --backup-dir /home/mxadmin/backup --timestamp 20210820143820
--backup-dir
specifies the backup directory, consistent with mxbackup
--timestamp
specifies the timestamp of the backup, which is the directory name of the {date + timestamp} level in the backup directory, because multiple backups may exist.
After executing the above command, the database will be restored.
Notes!
For details on the use of the mxrestore tool, please refer to mxrestore