YMatrix
Quick Start
Connecting
Benchmarks
Deployment
Data Usage
Manage Clusters
Upgrade
Global Maintenance
Expansion
Monitoring
Security
Best Practice
Technical Principles
Data Type
Storage Engine
Execution Engine
Streaming Engine(Domino)
MARS3 Index
Extension
Advanced Features
Advanced Query
Federal Query
Grafana
Backup and Restore
Disaster Recovery
Guide
Performance Tuning
Troubleshooting
Tools
Configuration Parameters
SQL Reference
This document describes the log collection and packaging tool mxpacklogs.
Features
mxpacklogs tool supports one-click collection and packaging of logs from all nodes in a distributed cluster.Usage
mxadmin is recommended. If another user is used, configure pg_hba trust accordingly.Notes
mxpacklogs is executed, temporarily stored under *.tar.gz as a /tmp package.mxpacklogs automatically selects the disk with the largest available space that the user can read and write to store the *.tar.gz package.--hosts and --base-data-dirs options to retrieve log information.In the following examples,
mdwrefers to the Master host, andsdwrefers to a non-Master host.
Collect logs from all hosts
[mxadmin@mdw ~]$ mxpacklogs
[<username>@sdw ~]$ mxpacklogs --dbhost 172.31.33.128 --dbport 5432 --username mxadmin --password 123
Collect logs from specific hosts
sdw1 and sdw2. Both machines have their base-data-dirs set to /mxdata_20221229075012. [<username>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012
sdw1 and sdw2. The base-data-dirs of sdw1 is /mxdata_20221229075012, and the base-data-dirs of sdw2 is /data1/mxdata_20221229075013. [<username>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012,/data1/mxdata_20221229075013
| Parameter | Default Value | Description |
|---|---|---|
--base-data-dirs |
Data directory from database catalog | Optional. Required only when the database is inaccessible. Provide path up to the mxdata_xxxx level. Format: mxpacklogs --base-data-dirs /data/mxdata_20230324145536 |
--hosts |
Logs from all hosts in the cluster | Use -- hosts to collect logs from specific Segment hosts, reducing disk and time overhead. Format: mxpacklogs --hosts sdw1,sdw2 or mxpacklogs --hosts sdw1 --hosts sdw2 |
-h / --dbhost |
127.0.0.1 | Database server host |
-p / --dbport |
5432 | Database server port |
--debug |
Not applicable | Enable debug-level log output |
--help |
Not applicable | Print help message |
--host |
127.0.0.1 | Host running supervisor/mxgate service |
--mode |
api | Output format: api or cli |
-W / --password |
NULL | Password for database user |
--port |
4617 | Supervisor server port |
-U / --username |
mxadmin | Database username |
--validate |
Not applicable | Validation mode – dry run |
--verbose |
Not applicable | Enable verbose log output |
-v / --version |
Not applicable | Display tool version |
--path |
/opt/ymatrix/matrixdb[x] | MatrixDB installation path on supervisor host; [x] is the database version number, e.g., matrixdb5, matrixdb6 |
Note!
For more information about logs, see Logs.