Checking Greenplum Database Status – Linux

Checking Greenplum Database Status – Linux

Purpose of the Document

Procedure for Greenplum Database Start / Stop / Restart on any DB versions of Greenplum servers on Linux systems.

To monitor a Greenplum Database system, you need to know information about the system as well as status information of the individual instances. The gpstate utility provides status information about a Greenplum Database system. At the command line as a gpadmin user gpstate

$ gpstate -s                = Greenplum Array Configuration details

$ gpstate -m              = Mirror Segments in the system and their status

$ gpstate -c                = To see the primary to mirror segment mappings

$ gpstate -f                = To see the status of the standby master mirror:

If all is well and Greenplum is running, you will see this output:

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:————————–

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:-   Master instance                                = Active

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:-   Master standby                                 = No master standby configured

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:-   Total segment instance count from metadata     = 24

==========================================================

Starting Greenplum Database – Linux

==========================================================

Start an initialized Greenplum Database system by running the gpstart utility on the master instance. Use the gpstart utility to start a Greenplum Database that has already been initialized by the gpinitsystem utility, but has been stopped by the gpstop utility.

The gpstart utility starts the Greenplum Database by starting all the Postgres database instances on the Greenplum Database cluster. gpstart orchestrates this process and performs the process in parallel. Run gpstart on the master host to start Greenplum Database:

1)  Log on to the system as the root user, then switch the user as a gpadmin. At the command prompt, submit the following:

gpstart

After a few moments, the system reports:

20131127:08:57: 36:006768 gpstart: IBS11DQD02:gpadmin-[INFO]:-Have lock file /tmp/.s.PGSQL.5432 and a process running on port 5432

20131127:08:57:36:006768 gpstart:IBS11DQD02:gpadmin-[ERROR]:-gpstart error: Master instance process running

2)  Give the database some time to initialize and bring all the different segments up. To verify the system is up, submit the following command:

gpstate

A system that is fully up reports:

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:————————–

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:-   Master instance                                = Active

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:-   Master standby                                 = No master standby configured

20170411:15:06:32:022372 gpstate:HOSTNAME:gpadmin-[INFO]:-   Total segment instance count from metadata     = 24

3)  When the system asks you, Continue with Greenplum instance startup Yy|Nn (default=N) type Y and hit Enter. The system start in an orderly sequence.

A stopped system should report: –

gpstart:HOSTNAME:gpadmin-[INFO]:-Process results…

gpstart:HOSTNAME:gpadmin-[INFO]:———————–

gpstart:HOSTNAME:gpadmin-[INFO]:-  Successful segment starts = 24                                          

gpstart:HOSTNAME:gpadmin-[INFO]:-   Failed segment starts  = 0                                          

gpstart:HOSTNAME:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0

gpstart:HOSTNAME:gpadmin-[INFO]:———————–

gpstart:HOSTNAME:gpadmin-[INFO]:-

gpstart:HOSTNAME:gpadmin-[INFO]:-Successfully started 24 of 24 segment instances

gpstart:HOSTNAME:gpadmin-[INFO]:———————–

gpstart:HOSTNAME:gpadmin-[INFO]:-Starting Master instance HOSTNAME.informatica.com directory /data/master/gpseg-1

gpstart:HOSTNAME:gpadmin-[INFO]:-Command pg_ctl reports Master HOSTNAME.informatica.com instance active

gpstart:HOSTNAME:gpadmin-[INFO]:-No standby master configured.  skipping…

gpstart:HOSTNAME:gpadmin-[INFO]:-Database successfully started

================================================================

Stopping Greenplum Database – Linux

================================================================

The gpstop utility stops or restarts your Greenplum Database system and always runs on the master host. When activated, gpstop stops all postgres processes in the system, including the master and all segment instances. The gpstop utility uses a default of up to 64 parallel worker threads to bring down the Postgres instances that make up the Greenplum Database cluster. The system waits for any active transactions to finish before shutting down. To stop Greenplum Database immediately, use fast mode.

• To stop Greenplum Database:

$ gpstop

• To stop Greenplum Database in fast mode:

$ gpstop -M fast

1)  Log onto the system with administrator privileges or, on Linux, log on as either the root user then switch the gpadmin user

2)  On Linux operating system, enter the following command:

$ gpstop

3)  When the system asks you, Continue with Greenplum instance shutdown Yy|Nn  

      (default=N) type Y and hit Enter. The system stops in an orderly sequence.

A stopped system should report: –

20170125:18:35:14:024238 gpstop:HOSTNAME:gpadmin-[INFO]:—————————

20170125:18:35:14:024238 gpstop:HOSTNAME:gpadmin-[INFO]:-   Segments stopped successfully      = 24

20170125:18:35:14:024238 gpstop:HOSTNAME:gpadmin-[INFO]:-   Segments with errors during stop   = 0

20170125:18:35:14:024238 gpstop:HOSTNAME:gpadmin-[INFO]:—————————

20170125:18:35:14:024238 gpstop:HOSTNAME:gpadmin-[INFO]:-Successfully shutdown 24 of 24 segment instances

20170125:18:35:14:024238 gpstop:HOSTNAME:gpadmin-[INFO]:-Database successfully shutdown with no errors reported

4)  To verify that the system has stopped, use the gpstate command line utility as a gpadmin user.

gpstate

5)  After you verify that Greenplum Database is indeed down, you can proceed with your maintenance or configuration tasks.

================================================================

Restarting Greenplum Database – Linux

===============================================================

Stop the Greenplum Database system and then restart it. The gpstop utility with the  

-r option can stop and then restart Greenplum Database after the shutdown completes.

To restart Greenplum Database, enter the following command on the master host:

$ gpstop -r

1)  Log onto the system with administrator privileges or, on Linux, log on as either the root user then switch the gpadmin user

2)  On Linux operating system, enter the following command:

$ gpstop -r

3)  When the system asks you, Continue with Greenplum instance shutdown Yy|Nn (default=N) type Y and hit Enter. The system stops in an orderly sequence.

A stopped system should report: –

gpstop:HOSTNAME:gpadmin-[INFO]:—————-

gpstop:HOSTNAME:gpadmin-[INFO]:-   Segments stopped successfully      = 24

gpstop:HOSTNAME:gpadmin-[INFO]:-   Segments with errors during stop   = 0 gpstop:HOSTNAME:gpadmin-[INFO]:——————

gpstop:HOSTNAME:gpadmin-[INFO]:-Successfully shutdown 24 of 24 segment instances

gpstop:HOSTNAME:gpadmin-[INFO]:-Database successfully shutdown with no errors reported

gpstop:HOSTNAME:gpadmin-[INFO]:-Restarting System…

4)  To verify that the system has restarted, use the gpstate command line utility as a gpadmin user.

gpstate

A restarted system should report: –

gpstate:HOSTNAME:gpadmin-[INFO]:-Greenplum instance status summary

gpstate:HOSTNAME:gpadmin-[INFO]:————————–

gpstate:HOSTNAME:gpadmin-[INFO]:-   Master instance   = Active

gpstate:HOSTNAME:gpadmin-[INFO]:-   Master standby   = No master standby configured

gpstate:HOSTNAME:gpadmin-[INFO]:-   Total segment instance count from metadata     = 24

REFERENCES

Greenplum Database Utility Reference Guide

Leave a Reply