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
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Configuration Parameters
SQL Reference
FAQ
This document introduces the Mirror Adding Tool mxaddmirrors.
Notes!
During the addition process, the database should be in a quiescent state and loads and other queries should not run.
The following is a detailed command line parameter information:
| Subcommand | Parameter name | Description | Optional |
| --- |------------------------------------------ | --- |
| config | | Create a custom configuration file | |
| | --db-cluster-id | Database cluster ID. To identify a unique database cluster | Optional |
| | --filename | Save the generated configuration to this file. If this file does not exist, it will be generated automatically. Redirects are also available | Optional |
| init | | Convert the collected information into a basic plan | |
| | --db-cluster-id | Database cluster ID. Placed in the /etc/matrixdb5/cluster.conf
file. If only one cluster is currently deployed, use the last ClusterID
, otherwise select the --db-cluster-id
of the corresponding cluster | Required |
| | --mirror-port-base | Start searching for an idle port as the port for Mirror listening from the current port, and start searching from 7000
by default | Optional |
| plan | | Generate deployment plan | |
| | --init-file | init
command output information redirects the absolute path of the redirect file | Required |
| | --custom-config | The absolute path of the file generated by the config
command | Optional |
| setup | | Execution deployment | |
| | --plan-file | plan
command outputs the absolute path to the redirect file | Required |
Notes!
If you do not need to modify the default behavior, just select the required parameters.
mxaddmirrors need to be executed on users with sudo permissions (except mxadmin, the absolute path /opt/ymatrix/matrixdb5/bin/mxaddmirrors
) except for mxadmin. If the mxaddmirrors init
command is executed on a user without sudo permission, the mxaddmirrors.init
file will be generated under that user, and other users can only read but not write. The generated file needs to be deleted, and then re-execute the command on the user with sudo permissions to re-generate the file.
Here we give two examples of process: default behavior and custom configuration. The details are as follows:
Notes!
3.1, 3.2 Choose any of them. The default behavior will adopt YMatrix's default [Ring mirror distribution policy] (/doc/5.2/reference/mirror_distribution_policy), and the custom configuration can be adjusted to other mirroring policies you need. Whether you choose default behavior or customization, you need to perform a complete Mirror addition process.
$ mxaddmirrors init > /tmp/mxaddmirrors.init
$ mxaddmirrors plan --init-file /tmp/mxaddmirrors.init > /tmp/mxaddmirrors.plan
$ mxaddmirrors setup --plan-file /tmp/mxaddmirrors.plan --mode cli
config
file. If this file does not exist, it will be generated automatically.$ mxaddmirrors config --filename /tmp/config
config
file.$ edit config
$ mxaddmirrors init > /tmp/mxaddmirrors.init
$ mxaddmirrors plan --init-file /tmp/mxaddmirrors.init --custom-config /tmp/config > /tmp/mxaddmirrors.plan
$ mxaddmirrors setup --plan-file /tmp/mxaddmirrors.plan --mode cli
The generated configuration file is in CSV format.
0||7000|
1||7000|
content_id
, hostname
, port
and rootdir of datadir
(in this directory and files generate various databases).content_id
is not allowed to be empty and cannot be repeated. The modified options will take effect, and what you see is what you get.Notes!
YMatrix 5 deploys a brand new database schema, enables the mxaddmirrors tool to add Mirrors, which is incompatible with gpaddmirrors. Previous versions were available with the gpaddmirrors tool.