mxpacklogs

This document introduces the log collection and packaging tools mxpacklogs.

1 Basic description

  • Function
    • mxpacklogs tool supports one-click acquisition and packaging of all logs in distributed clusters.
    • Supports the collection of log information from the current to the first 3 days of the execution command.
  • use
    • Execute on Master
      • It is recommended to use mxadmin users. If you use other users, you need to configure pg_hba trust.
    • Execute on non-Master
      • Both the database server and the server executing this command need to install a new version of YMatrix (4.8.0 and above) and connect to Master by specifying relevant parameters.
  • Notice
    • All logs of the specified server are summarized on the host that currently executes the mxpacklogs command and are temporarily stored in the form of *.tar.gz package under /tmp.
    • mxpacklogs will automatically select the disk with the largest remaining space that the user can read and write, and the disk with the largest remaining space is stored in the *.tar.gz package.
    • In the extreme case where all nodes in the cluster are down, you need to obtain log information by specifying --hosts and --base-data-dirs.

2 Tool usage

In the following example, mdw is Master and sdw is non-Master.

  1. Get all host log information

    • The default current host is Master
      [mxadmin@mdw ~]$ mxpacklogs
  • Specify the connection information to access Master
      [<user name>@sdw ~]$ mxpacklogs --dbhost 172.31.33.128 --dbport 5432 --username mxadmin --password 123
  1. Get log information under the specified host

    • This command indicates the collection of log information for sdw1 and sdw2. The base-data-dirs of both machines are /mxdata_20221229075012.
      [<user name>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012
  • This command indicates the collection of log information for sdw1 and sdw2. The base-data-dirs of sdw1 is /mxdata_20221229075012, and the base-data-dirs of sdw2 is /data1/mxdata_20221229075013.
      [<user name>@sdw ~]$ mxpacklogs --hosts sdw1,sdw2 --base-data-dirs /mxdata_20221229075012,/data1/mxdata_20221229075013

    3 Detailed parameter information

| Parameter name | Default value|Description | | --- | --- | | --base-data-dirs | Data directory in database meta information | Optional. This parameter is only required if the database is not accessible. Provide it to the mxdata_xxxx directory level. Format: mxpacklogs --base-data-dirs /data/mxdata_20230324145536 | | --hosts | Logs of all hosts in the cluster | -- hosts can collect logs of hosts of a specific segment to avoid excessive space 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 involved | Turn on debug log output | | --help | Not involved | Print help information | | --host | 127.0.0.1 | The host to install the supervisor/mxgate service | | --mode | api | The output format is api or cli | | -W / --password | NULL | Database user password | | --port | 4617 | supervisor server port | | -U / --username | mxadmin | Database username | | --validate | Not involved | Verification mode - Trial run | | --verbose | Not involved | Turn on detailed log output | | -v / --version | Not involved | Display tool version | | --path | /opt/ymatrix/matrixdb[x] | The matrixdb installation path on the supervisor host; [x] is the database version number, such as matrixdb5, matrixdb6 |

Notes!
For more information about log content, please see Log.