YMatrix
Cluster Deployment
Data Model
Data Writing
Data Query
SQL Reference
Maintenance and Monitoring
Tool Guide
Troubleshooting
In production environments, sometimes the program will be cored due to other unknown reasons such as program bugs. The core output of the program will not only cause the query execution to fail, but may cause cluster failure in serious cases. Therefore, the generated core file is very important on-site information and needs to be provided to developers for tracking and tracing.
The packcore tool is used to package the generated core files for developers to debug and track.
packcore is a Python tool released with MatrixDB. The location of the packcore tool is:
$GPHOME/sbin/packcore
$GPHOME/sbin
is not in the environment variable, so it needs to be used through an absolute path.
How to use:
$GPHOME/sbin/packcore -b $GPHOME/bin/postgres postgres.core.4_1635732782.17213
in:
-b $GPHOME/bin/postgres
specifies the executable file path, because worker processes are derived from postgres master processpostgres.core.4_1635732782.17213
is the generated core fileAfter executing the command, a .tgz
file with the same name as the core file will be generated in the current directory, and the file will be provided to the developer. Includes core files and on-site environment information
The prerequisite for using the packcore tool to package core files is that the operating system needs to generate core files.
To generate the core file, you need to modify the following configuration:
Set coredump file size unlimited:
ulimit -c unlimited
# Persistence method
echo "ulimit -c unlimited" >> /etc/profile
vi /etc/sysctl.conf
Then add kernel.core_pattern=/home/mxadmin/%e.core.%s_%t
to the end
Execute sysctl -p
to make the configuration take effect:
sysctl -p
This configuration determines the location and file name template for the core file generation, where: