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 log collection and packaging tools mxpacklogs.
*.tar.gz
package under /tmp
. mxpacklogs will automatically select the disk with the largest remaining space that the user can read and write to store these packages.--hosts
and --base-data-dirs
.The following is a detailed command line parameter information:
Parameter name | Description |
---|---|
--base-data-dirs | Optional. The data directory in the database meta information is accessed by default. This parameter is only required if the database is not accessible. It can be provided to the mxdata_xxxx directory level, and the subsequent mxpacklogs will be automatically filled. For example: mxpacklogs --base-data-dirs /data/mxdata_20230324145536 |
--hosts | --host means that the logs of all hosts in the cluster are collected by default. --hosts can collect logs of hosts of a specific segment to avoid excessive space and time overhead. For example: mxpacklogs --hosts sdw1,sdw2 or mxpacklogs --hosts sdw1 --hosts sdw2 |
-h / --dbhost | Database server host, default "127.0.0.1" |
-p / --dbport | Database server port, default "5432" |
--debug | Turn on debug log output |
--help | Print Help Information |
--host | The host that installs the supervisor/mxgate service, default "127.0.0.1" |
--mode | Output format, api or cli, default "api" |
-W / --password | Database user password |
--path | The matrixdb installation path on the supervisor host, default "/opt/ymatrix/matrixdb5" |
--port | supervisor server port, default "4617" |
-U / --username | Database username, default "mxadmin" |
--validate | Verification mode - Trial run |
--verbose | Turn on detailed log output |
-v / --version | Display tool version |
mxpacklogs can be executed on a master node (Master) or non-Master. The details are as follows:
Based on the above description, we recommend the following three ways of using it. In the example, mdw is Master and sdw is non-Master:
Run the mxpacklogs
command directly to indicate that the default current host is Master, and it will connect to the database to obtain all Segment logs.
[mxadmin@mdw ~]$ mxpacklogs
[INFO]:-Preparing temp directory...
[INFO]:-Starting transport server...
[INFO]:-Gathering logs from 4 hosts...
[INFO]:-Creating the tarball...
[INFO]:-All logs packed to: /tmp/gather_logs_2143246856.tar.gz
Execute the following command on either server to specify the connection information to access Master, thereby achieving all Segment log acquisition (the same result as 1).
[<usernam>@<servername> ~]$ mxpacklogs --dbhost 172.31.33.128 --dbport 5432 --username mxadmin --password 123
[INFO]:-Preparing temp directory...
[INFO]:-Starting transport server...
[INFO]:-Gathering logs from 4 hosts...
[INFO]:-Creating the tarball...
[INFO]:-All logs packed to: /tmp/gather_logs_340918649.tar.gz
Notes!
1 and 2 both obtain information through the connection to the master, so the cluster master needs to be in a healthy state.
Execute the following command on either server to collect only log information under the specified host (required) and data directory (optional).
[<usernam>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012
This command indicates that the log information of sdw1, sdw2 is collected, and the base-data-dirs
of both machines are /mxdata_20221229075012
.
[<usernam>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012,/data1/mxdata_20221229075012
This command indicates that the log information of sdw1, sdw2 is collected, and the base-data-dirs
of these two machines is different, one is /mxdata_20221229075012
and the other is /data1/mxdata_20221229075012
.
Notes!
For more information about log content, please see Log.