This document introduces the log collection and packaging tools mxpacklogs.
/tmp
, and an error will be reported if the disk is full.--hosts
and --base-data-dirs
.The following is a detailed command line parameter information:
Parameter name | Description |
---|---|
--base-data-dirs | All basic data directories in the database |
--hosts | Collects the logs of the hosts of the Segment, separating each host with a comma |
--config | configuration file. Default is $HOME/.mxctl.yaml |
-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, support api /cli , default api |
-W / --password | Database user password |
--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 | 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).
[<username>@<server name> ~]$ 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).
[<username>@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
.
[<username>@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.