How to collect core files for analysis in Tanzu Greenplum
search cancel

How to collect core files for analysis in Tanzu Greenplum

book

Article ID: 296223

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

This article discusses a utility script "packcore" that collects all of the necessary files to analyze a core file generated by Greenplum.



Resolution

There are currently two ways to get the Packcore from the system:


1. Using GMPT / GPSUPPORT

Run GMPT on the server where the core file is located. The packcore tar archive and the gp_log_collector archive needs to be sent to Tanzu Support. 

Note: The "gpmt" utility is called "gpsupport" in Greenplum 7.x

[gpadmin@mdw ~]$./gpmt packcore --help
USAGE:
    ./gpmt packcore -cmd COMMAND -core COREFILE [ -binary BINARY ]
        [ -keep_tmp_dir ] [ -ignore_missing ]


Description: Packcore takes a core file, extracts the name of the binary which generated the core. It gathers the required shared libraries and packages into a single tarball archive.

Note: Packcore should be executed on the host where the core file was generated. The same PATH and LD_LIBRARY_PATH should be set in order to collect the correct binary and shared libraries.

 

Commands

  • collectCollect core file and associated libraries

Options

  • -core - Corefile
  • -binaryBinary
  • -keep_tmp_dirDo not delete temp directory
  • -ignore_missing - Ignore missing libraries

Examples

a. Collect core info for 'core.1234' with verbose logging (binary will be automatically detected).

./gpmt packcore -cmd collect -core core.1234 -verbose

b. Collect core info for 'core.1234' with binary '/usr/local/greenplum-db/postgres'

./gpmt packcore -cmd collect -core core.1234 -binary /usr/local/greenplum-db/postgres


2. Through using the Packcore from the current build OR attachment, and then shipping the file


The following are instructions to use the Packore utility:

1. Use $GPHOME/sbin/packcore.

2. To collect a core file, run the command: packcore <core_file> where <core_file> is the path to the core file to be collected.

$GPHOME/sbin/packcore corefile OR ./packcore corefile

3. The script will run, copying the core file, libraries, and other information to the local directory. Once finished, it will create a tar file as shown below:

packcore-<core_file>.tgz

4. Send the compressed tar file to Tanzu support.

The following is an example of Packcore generation and the information that gets collected:

[gpadmin@mdw ~]$ $GPHOME/sbin/packcore core.3326
Unable to find full path to binary for core file   <<<<<< In case of this issue we have to give binary path as shown below.

[gpadmin@mdw ~]$ ps -ef | grep silent 
gpadmin   3326     1  0 May10 ?        00:00:02 /usr/local/greenplum-db-4.3.8.0/bin/postgres -D /data/master/gpseg-1 -p 5432 -b 1 -z 8 --silent-mode=true -i -M master -C -1 -x 0 -E

[gpadmin@mdw ~]$ $GPHOME/sbin/packcore core.3326 -b /usr/local/greenplum-db-4.3.8.0/bin/postgres

[gpadmin@mdw ~]$ ls -lrth | tail -2
-rw-rw-r--. 1 gpadmin gpadmin 335M May 18 10:23 core.3326
-rw-rw-r--. 1 gpadmin gpadmin 148M May 18 10:25 packcore-core.3326.tgz

[gpadmin@mdw ~]$ tar -xzf packcore-core.3326.tgz 	

[gpadmin@mdw ~]$ cd packcore-core.3326

[gpadmin@mdw packcore-core.3326]$ ls -lrth 
total 386M
-rw-rw-r--. 1 gpadmin gpadmin   22 May 18 10:24 uname.out
-rw-r--r--. 1 gpadmin gpadmin   27 May 18 10:24 system-release
-rw-r--r--. 1 gpadmin gpadmin   27 May 18 10:24 redhat-release
-rwxr-xr-x. 1 gpadmin gpadmin  52M May 18 10:24 postgres
-rw-rw-r--. 1 gpadmin gpadmin 335M May 18 10:24 core.3326
-rw-r--r--. 1 gpadmin gpadmin   27 May 18 10:24 centos-release
drwxrwxr-x. 3 gpadmin gpadmin 4.0K May 18 10:24 usr
-rwxr-xr-x. 1 gpadmin gpadmin  150 May 18 10:24 runGDB.sh
drwxrwxr-x. 2 gpadmin gpadmin 4.0K May 18 10:24 lib64