Quick Start
Cluster Deployment
Data Model
Data Writing
Data Query
SQL Reference
Maintenance and Monitoring
Tool Guide
Troubleshooting
FAQ
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.Limitations
/tmp. If the disk is full, an error occurs.--host and --path options to specify --hosts and --base-data-dirs for log retrieval.The following table lists the command-line arguments:
| Option | Description |
|---|---|
--base-data-dirs |
Base data directories for the database, separated by commas |
--hosts |
Hosts from which to collect Segment logs, separated by commas |
--config |
Configuration file. Default: $HOME/.mxctl.yaml |
-h / --dbhost |
Database server host. Default: 127.0.0.1 |
-p / --dbport |
Database server port. Default: 5432 |
--debug |
Enable debug-level log output |
--help |
Print help message |
--host |
Host where supervisor/mxgate service is installed. Default: 127.0.0.1 |
--mode |
Output format: supports api or cli. Default: api |
-W / --password |
Password for the database user |
--path |
MatrixDB installation path on the supervisor host. Default: /usr/local/matrixdb |
--port |
Supervisor server port. Default: 4617 |
-U / --username |
Database username. Default: mxadmin |
--validate |
Validation mode – performs a dry run |
--verbose |
Enable verbose log output |
-v / --version |
Display tool version |
mxpacklogs can be executed on the Master node or a non-Master node. Details:
mxadmin user. If another user is used, configure pg_hba trust accordingly.Based on the above, we recommend the following three usage methods. In the examples below, mdw is the Master and sdw is a non-Master host:
Run the mxpacklogs command directly. This assumes the current host is the Master and connects to the database to collect logs from all Segments.
``
[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
``
Run the following command on any host to specify connection details to the Master, enabling log collection from all Segments (same result as Example 1). ``
[<user>@<host> ~]$ 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
``
Note!
Examples 1 and 2 retrieve information by connecting to the Master. Therefore, the cluster Master must be in a healthy state.
[<user>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012
``
This command collects logs from sdw1 and sdw2, assuming both hosts use the same base-data-dirs, which is /mxdata_20221229075012.
[<user>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012,/data1/mxdata_20221229075012
``
This command collects logs from sdw1 and sdw2, but their base-data-dirs differ: one is /mxdata_20221229075012, the other is /data1/mxdata_20221229075012.
Note!
For more information about log content, see Logs.