pivotal greenplum command center · pivotal greenplum command center is a management tool for the...

123
Pivotal Greenplum ® Command Center Version 6.0.0 User Guide Rev: 01 © 2019 Pivotal Software, Inc.

Upload: others

Post on 20-May-2020

133 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

PivotalGreenplum®

CommandCenter

Version6.0.0

UserGuide

Rev:01

©2019PivotalSoftware,Inc.

Page 2: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

2457

1011111212131819202122242627283035363839414345474954555861646567686971767983878889929598

TableofContents

TableofContentsPivotalGreenplumCommandCenter6.0.0DocumentationPivotalGreenplum®CommandCenter6.0.0ReleaseNotesAboutPivotalGreenplumCommandCenterInstallingGreenplumCommandCentertitle:CreatingthegpperfmonDatabaseInstallthegpperfmonDatabasegpmonroleAuthenticationConfiguringaStandbyMasterHost(ifenabled)InstallingPivotalGreenplumCommandCenterUpgradingGreenplumCommandCenterUninstallingGreenplumCommandCenterSettingtheGreenplumCommandCenterEnvironmentConnectingtotheGreenplumCommandCenterConsoleAdministeringtheCommandCenterWebServerAdministeringCommandCenterAgentsAdministeringthegpperfmonDatabaseSettingsgpccgpmetricsSchemaReferenceConfigurationFilesReferenceCommandCenterConsoleParametersgpmetricsConfigurationFileReferenceSetupConfigurationFileSecuringGreenplumCommandCenterManagingGreenplumCommandCenterAuthenticationManagingGreenplumCommandCenterPermissionsSecuringthegpmonDatabaseUserEnablingAuthenticationwithKerberosMonitoringtheGreenplumDatabaseSystemDashboardGreenplumDatabaseClusterStateSegmentStatusClusterMetricsHostMetricsStorageStatusMonitoringandManagingGreenplumDatabaseQueriesQueryMonitorQueryDetailsHistoryQueryHistoryDetailsAlertsManagingGreenplumDatabaseWorkloadsAboutGreenplumCommandCenterWorkloadManagementWorkloadManagementImportingResourceQueuestoResourceGroupsAccessingtheWorkloadConfigurationProgrammaticallyTroubleshootingEnablingResourceGroups

©CopyrightPivotalSoftwareInc,2013-2019 2 6.0.0

Page 3: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

100101102103105107110112113114115116117118119120121122123

QueryMonitorHelpTopicsCPUCPUSkewLocksMemoryQueryPlanExecutionSpillFilesAlertHelpTopicsSegmentfailureAveragememory(segmenthosts)exceeds[%]for[min]Memory(master)exceeds[%]for[min]Totaldiskspaceexceeds[%]Queryisblockedfor[min]Numberofconnectionsexceeds[n]CPU(master)exceeds[%]for[min]OutofmemoryerrorQueryruntimeexceeds[min]AverageCPU(segmenthosts)exceeds[%]for[min]Spillfilesforaqueryexceeds[GB]

©CopyrightPivotalSoftwareInc,2013-2019 3 6.0.0

Page 4: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

PivotalGreenplumCommandCenter6.0.0DocumentationPDF

GreenplumCommandCenter6.0.0ReleaseNotes

AboutGreenplumCommandCenter

InstallingGreenplumCommandCenter

InstallingGreenplumCommandCenter

SettingtheGreenplumCommandCenterEnvironment

Administration

AdministeringtheCommandCenterWebServer

AdministeringCommandCenterAgents

AdministeringthegpperfmonDatabase

AdministeringthegpmetricsQueryHistory

gpccCommandReference

ConfigurationFileReference

SecuringGreenplumCommandCenter

UsingGreenplumCommandCenter

MonitoringtheGreenplumDatabaseSystem

OverallClusterStateSegmentStatusClusterMetricsHostMetricsStorageStatus

MonitoringandManagingGreenplumDatabaseQueries

QueryMonitorQueryDetailsQueryHistory

ManagingAlerts

ManagingWorkloads

AboutWorkloadsManagingWorkloadswithCommandCenterTroubleshootingCommandCenterWorkloadManagement

CommandCenterHelpTopics

CPU

CPUSkew

Locks

Memory

QueryOptimization

SpillFiles

©CopyrightPivotalSoftwareInc,2013-2019 4 6.0.0

Page 5: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

PivotalGreenplum®CommandCenter6.0.0ReleaseNotes

AboutThisReleaseThisdocumentcontainsreleaseinformationaboutPivotalGreenplumCommandCenter6.0.GreenplumCommandCenter6.0providesmanagementandmonitoringfunctionalityforPivotalGreenplumDatabase6.

SeeEnhancementsandChangesinGreenplumCommandCenter6.0.0forinformationaboutnewfeaturesandchangesinthisCommandCenterrelease.

SupportedPlatformsGreenplumCommandCenter6.0.0iscompatiblewiththefollowingplatforms.

PivotalGreenplumDatabase6.0

RedHatEnterpriseLinux6.x and7.x

CentOS6.x and7.x

SUSEEnterpriseLinux12

EnhancementsandChangesinGreenplumCommandCenter6.0GreenplumCommandCenter6.0containsthefollowingchangesandfeatures.

MetricsCollectorandWorkloadManagerExtensionsThemetricscollectorisnowaGreenplumDatabaseextension.

Theworkloadmanagersharedlibrary(gp_wlm.so)hasbeencombinedintothemetricscollectorsharedlibrary( metrics_collector.so ).

The workload_config table,the get_workload_config() function,andthe set_workload_config() functionhavemovedfromthegpccschemainthepostgresdatabasetothegpmetricsschemainthegpperfmondatabase.

CommandCenterInstallationChangesInstallingPivotalGreenplumDatabase6includestheCommandCentermetricscollectorextensionandworkloadmanagerextension.Thegp_enable_query_metrics serverconfigurationparameterissetto on andthemetricscollectorsharedlibraryisaddedtothe shared_preload_libraries

configurationparameter.

Itisnolongerrequiredtorun gpperfmon_install tocreatethegpperfmondatabasebeforeinstallingCommandCenter.TheCommandCenterinstallercreatesthegpperfmondatabase,thegpmonrole,andthegpmetricsschema,iftheydonotalreadyexist,andaddsentriesforthegpmonroletothepg_hba.conf file.NotethattheCommandCenterinstallerdoesnotcreatetheoldgpperfmontablesorsetthe gp_enable_gpperfmon configurationparameterto on ,sothegpmmon and gpsmon datacollectionagentswillnotbestartedwhenyoustartGreenplumDatabase.Ifyouwanttousetheoldgpperfmontablesandagents,usethe gpperfmon_install utilitytocreatethegpperfmondatabasebeforeyouinstallCommandCenter.SeeTransitioningtothegpmetricsHistorySchemaformoreinformationabouttransitioningtothenewgpmetricshistorydata.

Ifyouincludethe -W optionwiththe gpccinstall command,theinstallerpromptsyoutoenterthepasswordforthegpmonrole.Ifthegpmonroledoesnotalreadyexist,theinstallercreatesitwiththepasswordyouspecify.Withoutthe -W option,theinstallercreatesthegpmonrolewiththedefaultpassword“changeme”.

Theinstallerhasanew -u (upgrade)optionthatinstallsCommandCenterusingtheconfigurationparametersfromthecurrentCommandCenterinstallation.YoucanusethisoptiontoreinstallthesameversionofCommandCenterortoupgradetoanewerversion.

TheCommandCentergpmonsuperusercreatesexternalwebtables,andthisrequirestheGreenplumDatabase gp_external_enable_exec configurationparametertobesetto on .Theparameterisonbydefault,butifithasbeensetto off ,theCommandCenterinstallerwillprintamessageandquit.

TransitioningtothegpmetricsHistorySchema

1

1

©CopyrightPivotalSoftwareInc,2013-2019 5 6.0.0

Page 6: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Therecanbetwosetsofhistorytables,bothmaintainedinthegpperfmondatabase:

tablescreatedbytheGreenplumDatabasegpperfmoninstallationutilitybelongingtothepublicschema

tablescreatedbyCommandCenterbelongingtothegpmetricsschema

CommandCenter6onlyrequiresthegpmetricsschemaanditdisplaysqueryandsystemmetricshistoryfromthegpmetricsschemabydefault.BeforeCommandCenter6,bothsetsofhistorytableswererequiredandCommandCenterdisplayedhistoryfromthetablesinthepublicschemabydefault.

Youcanmaintainbothsetsoftablesifyouchoose,butforbestperformance,useonlythegpmetricsschema.

Tousebothsetsoftables,youmustruntheGreenplumDatabase gpperfmon_install utilitytocreatethegpperfmondatabasebeforeyouinstallCommandCenter.Touseonlythegpmetricshistory,lettheCommandCenterinstallercreatethegpperfmondatabase.Youcandisablethegpperfmonagentsbysettingthe gp_enable_gpperfmon parameterto off andrestartingGreenplumDatabase.

OtherImprovementsNewfilteroptionsareaddedtotheHistoryviewtoselectqueryhistoryby:

completionstatusresourcequeue/priorityorresourcegroupCPUskewgreaterthan0Spillfilesgreaterthan0

Historicalquerysearchperformancehasbeengreatlyimproved.

PartitionsforhistorytablesinthegpmetricsschemaarenowcreatedwithRLEcompressionandthe COMPRESSLEVEL=2 option,forimprovedcompression/performance.

TheCommandCenterwebservernowsupportsonlytheTLSv1.2protocolandaboveforsecuredconnections.

FixedIssuesThefollowingissuesarefixedinthisrelease.

[#166346339]IfCPUSETisenabledforaresourcegroup,theCPU%valueischangedto -1 .ThisvaluepreventededitingresourcegroupsinCommandCenter.CommandCenternowallowsa -1 valueintheCPU%field.

[#167156751]Querytextfilesinthe $MASTER_DATA_DIRECTORY/gpmetrics/query_text directorywerenotcleanedupautomatically.Thisissueisfixed.

KnownIssuesThefollowingareknownissuesinthecurrentGreenplumCommandCenterrelease.

UnabletoViewRealTimeQueriesAfterUpgradingFromaPreviousCommandCenterReleaseIfyouinstallanewversionofGreenplumCommandCenterusingthesameportnumberasthepreviousversion,andyouusetheChromewebbrowser,youmaybeunabletoviewreal-timequeriesuntilafteryouclearthebrowser’scache.SeethenoteinConnectingtotheCommandCenterConsoleforstepstoclearthebrowsercache.

ResourceQueueNameIncorrectforSomeQueriesTodisplaytheresourcequeuenameforqueriesintheQueryMonitor,CommandCentercachesuserIDswithresourcequeuenames.ThecacheisupdatedwhentheCommandCenterbackendreceivesaplannedqueryfromthemetricscollector.Someutilitycommandsarenotplanned,suchas COPYcommandsthathaveno SELECT clause.Thesecommandsusearesourcequeueslot,butarenotpassedthroughanoptimizer.Ifauserisassignedadifferentresourcequeueandthenexecutesanunplannedcommand,theCommandCenterQueryMonitorwilldisplaytheresourcequeuenamethatwaspreviouslycached.

©CopyrightPivotalSoftwareInc,2013-2019 6 6.0.0

Page 7: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AboutPivotalGreenplumCommandCenterPivotalGreenplumCommandCenterisamanagementtoolforthePivotalGreenplumDatabaseBigDataPlatform.ThistopicintroduceskeyconceptsaboutGreenplumCommandCenteranditscomponents.

GreenplumCommandCenterFeaturesGreenplumCommandCentermonitorssystemperformancemetrics,analyzesclusterhealth,andenablesdatabaseadministratorstoperformmanagementtasksinaGreenplumDatabaseenvironment.

GreenplumCommandCenterprovidesabrowser-nativeHTML5graphicalconsoleforviewingGreenplumDatabasesystemmetricsandperformingcertaindatabaseadministrativetasks.TheCommandCenterapplicationprovidesthefollowingfunctionality:

Interactiveoverviewofrealtimesystemmetrics.Drilldowntoseedetailsforindividualclusterhostsandsegments.

Detailedrealtimestatisticsfortheclusterandbyserver.

QueryMonitorviewlistsqueriesexecuting,waitingtoexecute,andblockedbylocksheldbyotherqueries.

QueryDetailviewshowsquerymetrics,querytext,andtheexecutionplanforthequery.

WorkloadManagementviewallowsadministratorsto:

CreateandmanageworkloadstomanageconcurrencyandallocateCPUandmemoryresources.ChangedefaultresourcegroupsforGreenplumDatabaseroles.Createassignmentrulestoassigntransactionstoresourcegroups.

Fourpermissionlevelsallowuserstovieworcanceltheirownorothers’queries,andtoviewormanageadministrativeinformation.

ClusterMetricsviewshowssynchronizedchartsofhistoricalsystemmetrics.

Historyviewlistscompletedqueriesandsystemmetricsplottedoveraselectedtimeperiod.

PermissionsviewtoseeormanageCommandCenterpermissionlevels.

Authenticationviewtoseeoreditthe pg_hba.conf host-basedauthenticationconfigurationfile.

SegmentStatusviewwithsummariesanddetailsbysegment.

StorageStatusviewwithsummariesanddetailsbysegmentdatadirectory.

GreenplumCommandCenterArchitectureThefollowingfigureillustratestheGreenplumCommandCenterarchitecture.

©CopyrightPivotalSoftwareInc,2013-2019 7 6.0.0

Page 8: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

GreenplumCommandCenterWebServerandWebApplicationTheGreenplumCommandCenterwebserverandbackendapplicationcanrunonthemasterorstandbymasterhost—themasterhostisrecommended.Thewebserver,gpccws,isacustomHTTPserverdesignedforCommandCenter.ThewebapplicationisanHTML5andGolanguageapplication.

TheCommandCenterwebserverauthenticatesuserswiththeGreenplumDatabaseauthenticationsystem.AdministratorscanedittheGreenplumDatabasehost-basedauthenticationfile, pg_hba.conf ,intheCommandCenterConsole.CommandCentercanalsobeconfiguredtoauthenticateusersinaKerberosenvironment.

CommandCenterdefinesfouruserauthorizationlevelstomanageusers’accesstotheQueryMonitor,andtoadministrativeinformationandoperations.UserauthorizationismanagedintheAdministrativeareaoftheCommandCenteruserinterface.

GreenplumCommandCenterdisplaysinformationderivedfromseveralsources:

GreenplumDatabaseperformancemonitoringdatabase(gpperfmon)

Operatingsystemprocessaccounting

GreenplumDatabasesystemcatalogtables

Real-timequerymetricscollectionextension

Workloadmanagementextension

GreenplumDatabaseisinstrumentedtoenablecapturingperformancemetricsandtrackingqueryexecution.Theperformancemonitoringdatabaseandthequerymetricscollectionextensiondeployagents—processesrunningoneachhosttocollectmetrics.ThegpperfmonagentsforwardcollecteddatatoanagentontheGreenplumDatabasemaster.Thereal-timequerymetricsagentssubmitcollecteddatadirectlytotheCommandCenterrpcport.TheagentsalsocollectdatafromthehostoperatingsystemsothatqueryperformancecanbecorrelatedwithCPUandmemoryutilizationanddiskspacecanbemonitoredinCommandCenter.

GreenplumDatabasePerformanceMonitoringDatabaseThegpperfmonperformancemonitoringdatabasestorescurrentandhistoricalquerystatusandsysteminformationcollectedfromagentsrunningonthemasterandsegmenthosts.GreenplumCommandCenterusesgpperfmonforhistoricaldataonly;itusesthereal-timequerymetricstomonitoractiveandqueuedqueries.GreenplumDatabasesendsUDPpacketsatvariouspointsduringqueryexecution.The gpsmon processoneachsegmenthostcollectsthedata.Periodically,every15secondsbydefault,a gpmmon agentonthemasterhostsignalsthe gpsmon processtoforwardthecollecteddata.Theagentonthemasterhostreceivesthedataandaddsittothegpperfmondatabase.

TheCommandCenterdatabaseconsistsofthreesetsoftables:

nowtablesstoredataoncurrentsystemmetricssuchasactivequeries

historytablesstoredataonhistoricalmetrics

tailtablesarefordataintransition.Tailtablesareforinternaluseonlyandshouldnotbequeriedbyusers.

Thenowandtaildataarestoredastextfilesonthemasterhostfilesystem,andtheCommandCenterdatabaseaccessesthemviaexternaltables.Thehistorytablesareregulardatabasetablesstoredwithinthegpperfmondatabase.

YoucanrunSQLqueriesonthedatastoredinthegpperfmondatabase.GreenplumCommandCenterrunsqueriesonthedatabaseforinformationpresentedintheCommandCenterConsole.TheGreenplumDatabaseReferenceGuidecontainsreferencesforthetablesinthegpperfmondatabase.

GreenplumDatabaseprovidesamanagementutility, gpperfmon_install ,tocreatethegpperfmondatabaseandenablethegpperfmonagentsonthemasterandsegmenthosts.CreatingthegpperfmondatabaseisaprerequisiteforinstallingGreenplumCommandCenter.SeetheGreenplumDatabaseUtilityGuidefordetailsofrunningthe gpperfmon_install managementutility.

Real-TimeQueryMetricsCollectionThedatacollectedbyreal-timequerymetricscollectionismoredetailedandmorecurrentthanstatisticsrecordedinthegpperfmondatabase.CommandCenteruserscanobservequeriesastheyexecuteand,withsufficientpermissions,cancelproblemqueriestoallowotherqueriestocomplete.

TheGreenplumDatabasequerymetricsextensionandthemetricscollectionagentworktogethertocollectreal-timemetricsandupdatetheCommandCenterapplication.

GreenplumDatabasecallsthequerymetricsextensionwhenaqueryisfirstsubmitted,whenaquery’sstatuschanges,andwhenanodeinthequeryexecutionplaninitializes,starts,orfinishes.Thequerymetricsextensionsendsmetricstothemetricscollectionagentrunningoneachsegmenthost.Theextensionalsocollectsinformationaboutthelocksqueriesholdsothatyoucanseewhichqueriesholdlocksthatblockotherqueries.TheagentpoststhemetricstotheGreenplumCommandCenterrpcport.

©CopyrightPivotalSoftwareInc,2013-2019 8 6.0.0

Page 9: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

The metrics_collection extensionisincludedwithPivotalGreenplumDatabase.Theextensionisenabledbysettingthe gp_enable_query_metrics serverconfigurationparametertoonandrestartingtheGreenplumDatabasecluster.ThemetricscollectionagentisinstalledoneachhostwhenyouinstallGreenplumCommandCenter.TheCommandCenterapplicationmonitorstheagentandrestartsitifneeded.

CommandCenterWorkloadManagementWorkloadssetconcurrency,memory,andCPUresourcelimitsfordatabasetransactionstheymanage.AGreenplumCommandCenterworkloadcorrespondstoaGreenplumDatabaseresourcegroup,butaddsadditionalcapabilitiesthatarenotavailablewithresourcegroups.

CommandCenterallowsadministratorsgreaterflexibilityinassigningtransactionstoworkloads.EveryGreenplumDatabaseroleisassignedtoasingleresourcegroupand,bydefault,transactionsaremanagedbytherole’sresourcegroup.WithCommandCenterworkloadmanagement,administratorscandefinecriteriatoassigntransactionstoworkloadsbasedonattributesotherthantherolesubmittingthetransaction.Currently,assignmentcriteriacanevaluatequerytagsandrolesincombinationwithquerytags.

Aquerytagisakey-valuepairdefinedinthe gpcc.query_tags parameterofadatabasesession.Theparameterhastheformat<tag1>=<value1>;<tag2>=<value2> ,wheretagsandvaluesareuser-definedvalues.Forexample,ifyouwanttorunETLoperationsinaworkloadnamed“etl”,youcoulddefineatagnamed“xact-type”andsetitto“etl”: xact-type=etl .The gpcc.query_tags parametercanbesetasaconnectionparameteronGreenplumDatabaseclientsthatallowit,orwitha SET commandinsidethesessionaftertheconnectionhasbeenestablished,forexampleSETgpcc.query_tags='xact-type=etl'

.

The gp_wlm extensioninPivotalGreenplumDatabaseprovidessupportforCommandCenterworkloads.Initially,GreenplumDatabaseusesresourcequeuestomanageresources.UsingCommandCenterworkloadsrequiresenablingresourcegroupsinGreenplumDatabase.ResourcegroupsarebasedontheLinuxcontrolgroups(cgroups)service,whichmustfirstbeenabledintheoperatingsystem.

©CopyrightPivotalSoftwareInc,2013-2019 9 6.0.0

Page 10: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

InstallingGreenplumCommandCenterPerformthesetaskstoinstallGreenplumCommandCenteronyourGreeplumDatabasesystem:

InstallingGreenplumCommandCenter

SettingtheCommandCenterEnvironment

Additionaltopics:

UpgradingGreenplumCommandCenter

UninstallingGreenplumCommandCenter

©CopyrightPivotalSoftwareInc,2013-2019 10 6.0.0

Page 11: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

role—

title:CreatingthegpperfmonDatabaseThistopicdescribeshowtocreatethegpperfmondatabaseandenablethegpperfmondatacollectionagents.ThistaskmustbecompletedonetimefortheGreenplumDatabasesystem,beforeyouinstallGreenplumCommandCenter.

Whenthedatacollectionagentsareenabled,theirprocessesarestartedandstopped(using gpstart and gpstop )ontheGreenplumsegmenthostsalongwiththeGreenplumDatabaseserverprocesses.

GreenplumDatabaseincludesa gpperfmon_install utilitythatperformsthefollowingtasks:

CreatestheCommandCenterdatabase(gpperfmon).

CreatestheCommandCentersuperuserrole(gpmon).

ConfiguresGreenplumDatabaseservertoacceptconnectionsfromthegpmonrole(editsthe pg_hba.conf and .pgpass files).

SetstheCommandCenterserverconfigurationparametersintheGreenplumDatabaseserver postgresql.conf files.

The gpperfmon_install utilityandtheagentsarepartoftheGreenplumDatabasesoftware.ThetasksinthistopiccanbeperformedbeforeoraftertheCommandCentersoftwareisinstalled.

InstallthegpperfmonDatabase1. LogintotheGreenplummasterhostasthegpadminuser.

$su-gpadmin

2. SourcethepathfilefromtheGreenplumDatabaseinstallationdirectory:

$source/usr/local/greenplum-db/greenplum_path.sh

3. Runthe gpperfmon_install utilitywiththe --enable option.YoumustsupplytheconnectionportoftheGreenplumDatabasemasterserverprocess,andsetthepasswordforthegpmonsuperuserthatwillbecreated.Forexample:

$gpperfmon_install--enable--passwordchangeme--port5432

Thepasswordyouspecifyissavedina .pgpass fileinthegpadminuser’shomedirectory.SeeChangingthegpmonPassword forstepstochangethegpmonpassword.

4. RestartGreenplumDatabaseserver.Thegpperfmondatacollectionagentsdonotstartuntilthedatabaseisrestarted.

$gpstop-r

5. Usingthe ps command,verifythatthedatacollectionprocessisrunningontheGreenplummaster.Forexample:

$ps-ef|grepgpmmon

6. RunthefollowingcommandtoverifythatthegpmonusercanauthenticateandthatthedatacollectionprocessesarewritingtotheCommandCenterdatabase.Ifallofthesegmentdatacollectionagentsarerunning,youshouldseeonerowpersegmenthost.

$psql-Ugpmongpperfmon-c'SELECT*FROMsystem_now;'

Thedatacollectionagentsarenowrunning,andyourGreenplumsystemnowhasagpperfmondatabaseinstalled.Youcanconnecttoitasfollows:

$psqlgpperfmon

©CopyrightPivotalSoftwareInc,2013-2019 11 6.0.0

Page 12: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

gpmonroleAuthenticationThe gpperfmon_install utilityaddsentriesforthegpmonroletothe pg_hba.conf file,whichallowsthegpmonroletomakealocalconnectiontoanydatabaseintheGreenplumclusteronthemasterhost.

localgpperfmongpmonmd5hostallgpmon127.0.0.1/28md5hostallgpmon::1/128md5

Theseentriesprovidethegpmonrolesufficientaccesstomaintainqueryhistoryinthegpperfmondatabase.ForGreenplumCommandCenter,thegpmonusermustalsohavehostaccessfromthehostwheretheCommandCenterwebserverandbackendrun.ThisrequiresthatyouaddanentryfortheCommandCenterhost.

1. Editthe pg_hba.conf file.

#vi$MASTER_DATA_DIRECTORY/pg_hba.conf

2. AddthefollowinglinetoallowthegpmonroletoaccessthegpperfmondatabasefromallhostsintheGreenplumDatabasecluster.SubstitutetheIPaddressofthemasterhostfor<cc-host-ip>.

hostallgpmon<cc-host-ip>/32md5

SeeChangingthegpmonPassword forstepstochangethegpmonuser’spassword.

ConfiguringaStandbyMasterHost(ifenabled)1. Copythe $MASTER_DATA_DIRECTORY/pg_hba.conf filefromyourprimarymasterhosttothesamedirectoryonyourstandbymasterhost.This

ensuresthattherequiredconnectionoptionsarealsosetonthestandbymaster.

2. Copythe .pgpass filefromthegpadminuser’shomedirectoryonyourprimarymasterhosttothesamedirectoryonyourstandbymasterhost.Setthepermissionsonthe .pgpass fileto600(forexample: chmod 0600 ~/.pgpass ).

©CopyrightPivotalSoftwareInc,2013-2019 12 6.0.0

Page 13: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

InstallingPivotalGreenplumCommandCenterThePivotalGreenplumCommandCenterinstallationutilityinstallstheCommandCenterfilesonallhostsintheGreenplumDatabasecluster.

PrerequisitesBeforeinstallingGreenplumCommandCenter,ensurethefollowingrequirementsaremet:

GreenplumDatabasemustbeinstalledandrunning.SeethePivotalGreenplumCommandCenterreleasenotesforcompatibleGreenplumDatabaseversions.

TheGreenplumDatabase MASTER_DATA_DIRECTORY environmentvariablemustbeset.

ThedirectorywhereGreenplumCommandCenterwillbeinstalled, /usr/local/ bydefault,mustbewritablebythegpadminuseronallGreenplumDatabasehosts.SeeSelectingandPreparinganInstallationDirectoryforCommandCenter.

Port28080(default)mustbeopentoTCPconnectionsfromWebclientstotheHTTPserveronthemasterandstandbymasterhosts.GreenplumCommandCenterwebbrowserclientsconnecttothisporttoaccesstheCommandCenterConsole.BrowserconnectionsuseHTTP/HTTPSandWebSocket(WS)/SecureWebSocket(WSS)protocols.AdifferentportnumbercanbespecifiedwhenCommandCenterisinstalled.ToaccesstheCommandCenterwebserverthroughaproxy,theproxymusthaveWebSocketsuport.

Port8899mustbeopenonallhostsintheGreenplumDatabaseclusterforTCPconnections.ThisisanRPCport,usedbythemetricscollectionagentsonthesegmenthoststosendmetricstothebackend.

CommandCenterrequirestheApachePortableRuntimeUtilitylibrary.ThelibraryisnolongerincludedintheGreenplumDatabaselibdirectory,butitisinstalledasadependencyifyouinstalltheGreenplumDatabasedistributionwith yum or apt .Runthecommand yum install apr-util orapt install libapr1 ifyouneedtoinstallthe apr-util library.

IfyouwantCommandCenterservertosupportSSL/TLSencryptionforbrowserconnections,youneedacombinedSSLcertificatefilecontainingtheservercertificateandprivatekey.SeeSSL/TLSEncryptionformoreinformation.

SelectingandPreparinganInstallationDirectoryforCommandCenterTheCommandCenterinstallationdirectory(default /usr/local )mustexistandbewritableoneveryhostintheGreenplumDatabaseclusterbythegpadminuser.TheCommandCenterinstallercreatesadirectorynamed greenplum-cc-web-<version> intheinstallationdirectoryoneveryhost.WhenCommandCenterinstallationiscompletethe greenplum-cc-web-<version> directoryandallofitscontentsmustbeownedbythegpadminuser.

InastandardLinuxsystem,the /usr/local directoryisownedbyrootandisonlywritablebyroot.Ifyouchoosethedefaultinstallationdirectoryoranotherdirectorywheregpadmindoesnothavewritepermission,youmustmakethedirectorywritablebygpadminoneachhostinthecluster.

Youcanusethe gpssh utilitytosetpermissionsonallsegmenthostsatonceifthegpadminrolehassudoaccess.Forexample:

$source/usr/local/greenplum-db-<version>/greenplum_path.sh$gpssh-f<hostfile>'sudochmod777/usr/local'

AftertheCommandCenterinstallationiscomplete,youcanrestorethepreviouspermissionsontheinstallationdirectory.

SeethePivotalGreenplumDatabaseInstallationGuideforinformationaboutsettinguppasswordlessSSH.

InstalltheGreenplumCommandCenterSoftwareRuntheGreenplumCommandCenterinstallerontheGreenplumDatabasemasterhostasthegpadminuser.Theinstallercopiesthesoftwaretoallotherhostsinthecluster.

RuntheGreenplumCommandCenterinstallerontheGreenplumDatabasemasterhost.TheinstallerinstallstheCommandCentersoftwareoneveryhostinyourGreenplumDatabasecluster.ItretrievesthelistofhostsinyourGreenplumDatabaseclusterfromthe gp_segment_configurationsystemtable.

AfteryouhaveruntheinstalleryoucanstartGreenplumCommandCenteronthemasterhost(recommended)oronthestandbymasterhost.

©CopyrightPivotalSoftwareInc,2013-2019 13 6.0.0

Page 14: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

1. DownloadtheGreenplumCommandCenterdistributionfileforyourGreenplumDatabaseversionfromPivotalNetwork andcopyittothegpadminuser’shomedirectoryonthemasterhost.

2. Extracttheinstallerfromthezipfile.

$unzipgreenplum-cc-web-<version>-LINUX-x86_64.zip

Extractingtheinstallercreatesa greenplum-cc-web-<version> directorycontainingthe gpccinstall-<version> installationutility.

TherearefourwaystoruntheGreenplumCommandCenterinstaller:

Interactive–theinstallerpromptsyoufortheinstallationparameters.

Scripted–youruntheinstallerwithaconfigurationfilecontaininginstallationparameters.

Upgrade–theinstallerusestheinstallationparametersfromthecurrentCommandCenterinstallation.

Auto–theinstallerusesdefaultinstallationparameters.

InteractiveInstallation1. Sourcethe greenplum_path.sh scriptintheGreenplumDatabaseinstallationdirectorytoensurethe GPHOME environmentvariableisset.

$source/usr/local/greenplum-db/greenplum_path.sh

2. RuntheGreenplumCommandCenterinstaller.

$cdgreenplum-cc-web-<version>$./gpccinstall-<version>

Youcanaddthefollowingoptionstothe gpccinstall command-line.

The -W optioninstructstheinstallertopromptforthegpmondatabaseuser’spassword.

Ifthegpmonuserdoesnotyetexist,theinstallercreatesitusingthepasswordyouenterattheprompt.Thepasswordisnotsavedanywhere,sobesuretorememberthepasswordyouenter.Ifthegpmonuseralreadyexists,theinstallerusesthepasswordyouenteratthepromptforthegpmonuser.Itignoresanypasswordsetinthe PGPASSWORD environmentvariable,orinthe .pgpass fileinthe gpadmin user’shomedirectory(orinthefilespecifiedinthePGPASSFILE environmentvariable).Ifthegpmonuseralreadyexists,butyoudonotspecifythe -W option,theinstallerusesthepasswordsetinthe PGPASSWORDenvironmentvariableorinthe .pgpass file.Ifthegpmonuserdoesnotyetexistandyoudonotspecify -W (orifyouspecifythe -W optionbutenternopasswordattheprompt)theinstallercreatesthegpmonuserwithadefaultpassword.Seethe .pgpass filetofindthepassword.

The -ssh_path optionallowsyoutospecifythefullpathtoacustomSSHprogram.Ifyoudonotsupplythisoption,theinstallerusesthessh commandonthepath.Example: bash $ ./gpccinstall-<version> --ssh_path /usr/local/bin/ssh -WThe -krbenable optionincludespromptstoconfigureCommandCenterKerberosauthentication.TheKerberospromptsareomittedfromtheinstallationdialogbydefault.

3. Readthroughthelicenseagreementandenter y toaccept.

4. WherewouldyouliketoinstallGreenplumCommandCenter?(Default=/usr/local)PressEntertoacceptthedefaultorenterthedesiredpath.ThedirectorymustexistonallhostsintheGreenplumDatabaseclusterandmustbewritablebythegpadminuser.

5. WhatwouldyouliketonamethisinstallationofGreenplumCommandCenter?(Default=gpcc)EnteranametodisplayonCommandCenterwebpagestoidentifythisGreenplumCommandCenterinstallation.

6. Whatportwouldyoulikethegpccwebservertouse?(Default=28080)ThedefaultCommandCenterlistenportis28080.PressEntertoacceptthedefaultorenteranotherportnumber.

7. (Optional).Thesepromptsappearonlyifyouspecify -krbenable onthe gpccinstall commandline.

Enterwebservernameforthisinstance:(Default=<gpcc-host>)TheKerberoskeytabfilemustcontainaprincipalfortheCommandCenterwebserver.ThewebserverprincipalnamehasthetheformatHTTP/<gpcc-host>@<realm> ,where <gpcc-host> isthehostnameclientsuseinURLswhenconnectingtotheCommandCenterwebserver.

©CopyrightPivotalSoftwareInc,2013-2019 14 6.0.0

Page 15: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

EnterthenameoftheKerberosservice:(Default=postgres)ThedefaultKerberosservicenameforGreenplumDatabaseis postgres .

ChooseKerberosmode(1.normal/2.strict/3.gpmon_only):(Default=1)GreenplumCommandCentersupportsthreedifferentKerberosauthenticationschemes.

1-normalmode(default)–TheCommandCenterKerberoskeytabfilecontainstheCommandCenterprincipalandmaycontainprincipalsforCommandCenterusers.Iftheprincipalintheclient’sconnectionrequestisintheCommandCenter’skeytabfile,CommandCenterusestheclient’sprincipalfordatabaseconnections.Otherwise,CommandCenterusesthegpmonuserfordatabaseconnections.2-strictmode–CommandCenterhasaKerberoskeytabfilecontainingtheCommandCenterserviceprincipalandaprincipalforeveryCommandCenteruser.Iftheprincipalintheclient’sconnectionrequestisinthekeytabfile,thewebservergrantstheclientaccessandthewebserverconnectstoGreenplumDatabaseusingtheclient’sprincipalname.Iftheprincipalisnotinthekeytabfile,theconnectionrequestfails.3-gpmon_onlymode–CommandCenterusesthegpmondatabaseroleforallGreenplumDatabaseconnections.NoclientprincipalsareneededintheCommandCenter’skeytabfile.

EnterpathtothekeytabfileEnterthepathtothekeytabfilecontainingtheKerberosprincipalfortheCommandCenterwebserverand,optionally,CommandCenteruserprincipals.

WhatistheURLoftheCommandCenterwebserver?TheKerberoskeytabfilemustcontainaprincipalfortheCommandCenterwebserver.Theprincipalnameisintheformat HTTP/<gpcc-host>@<realm> ,where <gpcc-host> isthehostnameclientsuseinURLswhenconnectingtotheCommandCenterwebserver.

8. WouldyouliketoenableSSL?Enter y ifyouwanttoenableSSL/TLS(HTTPS)encryptionforclientconnectionstotheCommandCenterwebserver.TheinstallationutilitypromptsforthelocationofthecombinedSSLcertificatefile.

Enterthefullpathofthecertificatefile,includingfilenameEnterthepathtothecombinedSSLcertificatefileinstalledontheCommandCenterhost.Thisfilecontainsacertificateandaprivatekeyforthewebserver.Thefilemustbereadablebythegpadminuser.SeeSSL/TLSEncryptionforinformationaboutcreatingthisfileandinstallingitonyourserver.

9. Chooseadisplaylanguage(Default=English)1.English2.Chinese3.KoreanEnteranumbertochoosealanguagefortheCommandCenteruserinterface.

Theinstallersavesalogoftheinstallationsessioninthecurrentdirectoryinafilenamed gpccinstall.<timestamp>.log .

InstallWithaConfigurationFileYoucanprovideaconfigurationfiletotheGreenplumCommandCenterinstallertoperformanon-interactiveCommandCenterinstallation.Notethatyoumuststillviewandacceptthelicenseagreement.

$cdgreenplum-cc-web-<version>$./gpccinstall-<version>-c<config-file>

Thefollowingtablecontainsthenamesoftheparameterscorrespondingtotheinteractiveinstallationpromptsandtheirdefaultvalues.Defineparametersinaconfigurationfileforanyparametersthathavenodefaultvalueortooverridedefaultvalues.

InstallerPrompt Default Parameter

WherewouldyouliketoinstallGreenplumCommandCenter? /usr/local path

WhatwouldyouliketonamethisinstallationofGreenplumCommandCenter? gpcc display_name

Whatportwouldyoulikethegpccwebservertouse? 28080 web_port

|WouldyouliketoenableKerberos?|false|enable_kerberos||ChooseKerberosmode(1.normal/2.strict/3.gpmon_only):|1|krb_mode||Pleaseprovidethepathtothekeytabfile:||keytab||WhatisthenameoftheGPDBKerberosservice?|postgres|krb_service_name||WhatistheURLoftheCommandCenterwebserver?|gpcc|webserver_url||WouldyouliketoenableSSL?|false|enable_ssl||PleaseprovidethefilepathfortheSSLcertificate:|/etc/ssl/certs/cert.pem|ssl_cert_file||Pleasechooseadisplaylanguage(1.English2.Chinese/3.Korean)|1|language|

Ifthe enable_kerberos parameteristrue,the keytab , webserver_url , krb_mode ,and krb_service_name parametersmustalsobeset.

©CopyrightPivotalSoftwareInc,2013-2019 15 6.0.0

Page 16: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Ifthe enable_ssl parameteristrue,the ssl_cert_file parameterisrequired.

Thefollowinginstallationconfigurationfileexamplesetsallparameterstotheirdefaultvalues.

path=/usr/local#Setthedisplay_nameparamtothestringtodisplayintheGPCCUI.#Thedefaultis"gpcc"#display_name=gpcc

master_port=5432web_port=28080rpc_port=8899enable_ssl=false#Uncommentandsetthessl_cert_fileifyousetenable_ssltotrue.#ssl_cert_file=/etc/certs/mycertenable_kerberos=false#Uncommentandsetthefollowingparametersifyousetenable_kerberostotrue.#webserver_url=<webserver_service_url>#krb_mode=1#keytab=<path_to_keytab>#krb_service_name=postgres#Userinterfacelanguage:1=English,2=Chineselanguage=1

Non-InteractiveInstallationwithDefaultsThenon-interativeinstallationisusefulwheninstallingCommandCenterinacloudenvironment.

1. Sourcethe greenplum_path.sh scriptintheGreenplumDatabaseinstallationdirectorytoensurethe GPHOME environmentvariableisset.

$source/usr/local/greenplum-db/greenplum_path.sh

2. RuntheGreenplumCommandCenterinstallerwiththe -auto option.

$cdgreenplum-cc-web-<version>$./gpccinstall-<version>-auto

UpgradeRunning gpccinstall withthe -u optioninstallsaGreenplumCommandCenterreleaseusingtheconfigurationparametersfromthecurrentCommandCenterinstallation.YoucaninstallanewCommandCenterrelease,orreinstallthecurrentrelease.ThisoptionisusefulafteryouhaveaddednewhoststotheGreenplumDatabaseclusterorreplacedfailedhosts.

Theconfigurationparametersarereadfromthe $GPCC_HOME/conf/app.conf file.

1. Sourcethe greenplum_path.sh scriptintheGreenplumDatabaseinstallationdirectorytoensurethe GPHOME environmentvariableisset.

$source/usr/local/greenplum-db/greenplum_path.sh

2. Sourcethe gpcc_path.sh scriptintheGreenplumCommandCenterinstallationdirectory.

$source/usr/local/greenplum-cc-web-<version>/gpcc_path.sh

3. RuntheGreenplumCommandCenterinstallerwiththe -u option.

$cdgreenplum-cc-web-<version>$./gpccinstall-<version>-u

PreparetheStandbyMasterHostAftertheCommandCentersoftwareisinstalled,youstarttheCommandCenterwebserverandbackendonthemasterhostorthestandbymasterhost.RunningCommandCenteronthemasterhostisrecommended,butpreparingthestandbyhostensuresthestandbycanrunCommandCenterifthe

©CopyrightPivotalSoftwareInc,2013-2019 16 6.0.0

Page 17: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

masterfails.

1. Copythe .pgpass filefromthemasterhosttothestandbymasterhost.Runthesecommandsfromthemaster:

$sshgpadmin@<standby_host>$scpgpadmin@<master_host>:~/.pgpass~$chmod600~/.pgpass

2. IftheGreenplumCommandCenterwebserveristosupportTLS/SSL,aservercertificate.pemfilemustbeobtainedandinstalledonthestandbyhostinalocationreadablebythegpadminuser.Thedefaultpathis /etc/ssl/certs/cert.pem .

3. IfGreenplumCommandCenteristosupportKerberosauthentication,GreenplumDatabasemusthaveKerberosauthenticationsetupandtherequiredprincipalsandkeytabsmustbeinstalledonthestandbyhost.SeeEnablingAuthenticationwithKerberosforKerberossetupinstructions.YoucaninstallCommandCenterwithoutKerberosauthenticationinitiallyandthenenableKerberoslaterbyrunningthe gpcckrbenable command.

NextStepsSettingtheGreenplumCommandCenterEnvironment

StartingandStoppingGreenplumCommandCenter

ConnectingtoGreenplumCommandCenter

NOTETherearetwoalternativemethodsyoucanusetosupplythegpmonuser’spasswordsothatyoudonothavetoputthe .pgpass fileonthehost.CommandCenteronlyrequiresthegpmonpasswordwhenyourun gpccstart , gpccstop ,or gpccstatus .

1. Setthe PGPASSWORD environmentvariablebeforeyourun gpcc commands.Example:

$ PGPASSWORD=changeme gpcc status

2. Addthe -W optionto gpcc commandstohavethecommandpromptyouforthepassword.Example:

$ gpcc start -W

©CopyrightPivotalSoftwareInc,2013-2019 17 6.0.0

Page 18: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

UpgradingGreenplumCommandCenterToupgradeGreenplumCommandCenter,youinstallthenewCommandCentersoftwarerelease,stoptheoldversion,andstartthenewversion.YoucanthenremovetheolderCommandCenterreleasefromyourGreenplumDatabasehosts.

ToupgradetoanewreleaseofGreenplumCommandCenter4.x:

1. DownloadandinstallthenewCommandCenterreleasebyfollowingtheinstructionsinInstallingGreenplumCommandCenter.

2. StopthecurrentCommandCenterrelease.CommandCenter3.x:

$gpcmdr--stop<instance_name>

CommandCenter4.x:

$gpccstop

3. Sourcethe gpcc_path.sh scriptinthenewCommandCenterinstallationdirectory.

$source/usr/local/greenplum-cc-web-<version>/gpcc_path.sh

Note:Alsoupdatethesourcecommandinyourshellstart-upscript,forexample ~/.bashrc.sh or ~/.bash_profile.sh .

4. StartthenewCommandCenterrelease.

$gpccstart

5. UninstalltheolderCommandCenterrelease.See“UninstallingGreenplumCommandCenter”intheGreenplumCommandCenterdocumentationforthereleaseyouareuninstalling.

UpgradingFromGreenplumCommandCenter3.xto4.x

TheGreenplumCommandCenterarchitecturechangedbetweenCommandCenter3.xand4.x.

WithCommandCenter3.x,youinstalledtheGreenplumCommandCentersoftwareonetimeontheCommandCenterhost.YouthencreatedaCommandCenterinstanceforeachGreenplumDatabaseclusteryoumonitoredwithCommandCenter.

CommandCenter4.xdoesnothaveinstances;youinstalltheCommandCentersoftwareonthemasterorstandbymasteroftheGreenplumDatabaseclusteryouwanttomonitorwithCommandCenter.TheinstallercopiesthesoftwaretoeveryhostintheGreenplumDatabasecluster.TomonitoradditionalGreenplumDatabaseclustersyoumustinstalltheCommandCentersoftwareagain,onadifferentmasterorstandbyhost.MonitoringmultipleGreenplumDatabaseclustersrunningonthesamehardwareclusterisnotsupported.

©CopyrightPivotalSoftwareInc,2013-2019 18 6.0.0

Page 19: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

UninstallingGreenplumCommandCenterTouninstallGreenplumCommandCenter,youmuststopboththeCommandCenterConsoleanddisablethedatacollectionagents.Optionally,youmayalsoremoveanydataassociatedwithGreenplumCommandCenterbyremovingyourCommandCenterConsoleinstallationandthegpperfmondatabase.

1. StopCommandCenterConsoleifitiscurrentlyrunning.Forexample:

$gpcc--stop

2. RemovetheCommandCenterinstallationdirectoryfromallhosts.Forexample:

$rm-rf/usr/local/greenplum-cc-web-version

3. Disablethedatacollectionagents.

a. LogintothemasterhostastheGreenplumadministrativeuser(gpadmin):

$su-gpadmin

b. Disablethedatacollecitonagentsbysettingthe gp_enable_gpperfmon serverconfigurationparameteroff:

$gpconfig-cgp_enable_gpperfmon-voff

c. Removeorcommentoutthegpmonentriesin pg_hba.conf .Forexample:

#localgpperfmongpmonmd5#hostgpperfmongpmon0.0.0.0/0md5

d. DroptheCommandCentersuperuserrolefromthedatabase.Forexample:

$psqltemplate1-c'DROPROLEgpmon;'

e. RestartGreenplumDatabase:

$gpstop-r

f. CleanupanyuncommittedCommandCenterdataandlogfilesthatresideonthemasterfilesystem:

$rm-rf$MASTER_DATA_DIRECTORY/gpperfmon/data/*$rm-rf$MASTER_DATA_DIRECTORY/gpperfmon/logs/*

g. IfyoudonotwanttokeepyourhistoricalCommandCenterdata,dropthegpperfmondatabase:

$dropdbgpperfmon

©CopyrightPivotalSoftwareInc,2013-2019 19 6.0.0

Page 20: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SettingtheGreenplumCommandCenterEnvironmentToenablethegpadminusertoexecuteCommandCenterutilitiessuchas gpcc atthecommandline,sourcethe gpcc_path.sh fileintheGreenplumCommandCenterinstallationdirectory.Forexample:

$source/usr/local/greenplum-cc-web-<version>/gpcc_path.sh

The gpcc_path.sh scriptsetsthe GPCC_HOME environmentvariabletotheCommandCenterinstallationdirectoryandaddsthe $GPCC_HOME/bindirectorytothepath.

Toautomaticallysourcethe gpcc_path.sh eachtimeyoulogin,addtheabovesourcecommandtoyourstart-upscript,forexample ~/.bashrc or~/.bash_profile .

©CopyrightPivotalSoftwareInc,2013-2019 20 6.0.0

Page 21: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ConnectingtotheGreenplumCommandCenterConsoleSignintotheCommandCenterConsolewithanameandpassword.IftheGuestAccesstoQueryMonitorfeatureisenabled,youcansigninanonymouslytoseejusttheQueryMonitorview.

OpentheCommandCenterConsoleinasupportedbrowserusingthehostnameandportconfiguredfortheCommandCenterwebserver.Forexample,toopenasecureCommandCenterconnectiononahostnamed smdw atport28080,enterthisURLintoyourbrowser:

https://smdw:28080

IftheViewQueryMonitorlinkispresent,youcanclickittoviewtheQueryMonitorpagewithoutsigningin.ThistakesyouimmediatelytotheQueryMonitorview.ToaccessadditionalCommandCenterfeatures,clickSignInontheQueryMonitorviewandsigninwithavalidCommandCenterusernameandpassword.Ifthelinkisnotpresentonthesign-inpage,aCommandCenteradministratorhasdisabledtheanonymousquerymonitorfeature.

TosigninasaCommandCenteruser,entertheusernameandpasswordofaGreenplumrolethathasbeenconfiguredtoallowauthenticationtoGreenplumCommandCenter,thenclickSignIn.ThisopenstheDashboardpageoftheCommandCenterConsole,whichprovidesagraphicalsystemsnapshotandasummaryviewofactivequeries.SeetheDashboardforinformationabouttheDashboardview.

NotetoChromeBrowserUsers

IfyouinstallanewversionofGreenplumCommandCenterusingthesameportnumberasthepreviousversion,andyouusetheChromewebbrowser,youmaybeunabletoviewreal-timequeriesuntilafteryouclearthebrowser’scache.Followthesesteps.

1. ChooseSettingsfromtheChromemenu.

2. ScrolltothebottomandclickAdvanced.

3. UnderPrivacyandsecurity,clickClearbrowsingdata.

4. ClicktheBasictabandselectCachedimagesandfiles.YoudonothavetoclearBrowsinghistoryorCookiesandothersitedata.

5. ClickCLEARDATAandthenlogintoCommandCenter.

©CopyrightPivotalSoftwareInc,2013-2019 21 6.0.0

Page 22: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AdministeringtheCommandCenterWebServerThegpccwswebserverbinaryandwebapplicationfilesareinstalledinthe bin directoryofyourGreenplumCommandCenterinstallation.

StartingandStoppingtheWebServerStartingtheCommandCenterWebServerrunsthegpccwswebserver,startsthemetricscollectionagentsonthesegmentservers,andstartsalistenerontheCommandCenterrpcport.

Youcanrunthe gpcc commandasthegpadminuseronthemasterhost(recommended)oronthestandbyhost.StartingCommandCenteronthestandbyhostisnotrecommendedbecauseitcancauseheavynetworktrafficbetweentheCommandCenteragentonthemasterhostandthebackendonthestandbyhost.

Toensurethe gpcc commandisonyourpath,sourcethe gpcc_path.sh fileintheCommandCenterinstallationdirectoryoraddittothestartupscriptforyourcommandshell.SeeSettingtheGreenplumCommandCenterEnvironmentforinstructions.The MASTER_DATA_DIRECTORY environmentvariablemustbesettothelocationoftheGreenplumDatabasemasterdatadirectory.

TostartGreenplumCommandCenter

Logontothemasterhostorthestandbyhost.

Tologontothestandbyfromthemasterhost:

$ssh<standby-host>

SourcetheCommandCenterenvironmentalscript.

$source/usr/local/greenplum-cc-<version>/gpcc_path.sh

StarttheCommandCenterwebserverandthemetricscollectionagents.

$gpccstartStartingthegpccagentsandwebserver…2019/05/0701:51:03Agentsuccessfullystartedon5/5hosts2019/05/0701:51:03ViewGreenplumCommandCenterathttp://mdw:28090

TostopGreenplumCommandCenter

$gpccstop2019/05/0701:51:55GPCCwebserverandmetricscollectionagentshavebeenstopped.Usegpccstarttostartthemagain

TochecktheGreenplumCommandCenterstatus

$gpccstatus2019/05/0701:50:13GPCCwebserver:running2019/05/0701:50:14GPCCagents:5/5agentsrunning

Seethe gpcc referencepageforfullsyntaxforthe gpcc command.

ConfiguringtheCommandCenterWebServerThewebserverconfigurationfileisstoredin $GPCC_HOME/conf/app.conf .TheparametersinthisconfigurationfilearesetwhenyouinstallGreenplumCommandCenter.TheinstallercopiestheCommandCenterinstallationdirectory,includingthisconfigurationfile,toeveryGreenplumDatabasehost.

NOTEThe gpcc commandusesthegpmonroletoconnecttoGreenplumDatabase.Itlooksforthegpmonpasswordinthe PGPASSWORD environmentvariableorinthe .pgpass fileinthegpadminuser’shomedirectory.Youcaninsteadappendthe -W flagtothe gpcc commandsbelowtohavegpcc promptyoutoenterthepassword.

©CopyrightPivotalSoftwareInc,2013-2019 22 6.0.0

Page 23: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SeetheWebServerParameterssectionofConfigurationFileReferenceforadescriptionoftheparametersinthisfile.

Youcanseeasummaryofthecurrentconfigurationusingthe gpcc--settings

command.

$gpcc--settingsInstallpath:/usr/localDisplayName:gpccGPCCport:28080Kerberos:enabledKerberoswebservername:mdwKerberosgpdbname:gpadminKerberosmode:gpmon_onlyKerberospath:/home/gpadmin/gpcc-kerberos.keytabSSL:disabled

Ifyoumodifythefileononehostyoushouldcopyittoeveryotherhost.Besuretorestartthewebserverafteryouchangetheconfiguration.Ratherthanmodifyingtheconfigurationdirectly,youcanjuststopCommandCenterandre-runthe gpccinstall-<version> installationcommand.Thisensurestheconfigurationisconsistentonallhosts.

Youcanusethe gpcckrbenable commandtoaddKerberosauthenticationtotheCommandCenterconfiguration.SeeEnablingAuthenticationwithKerberosfordetailsaboutsettingupKerberosontheCommandCenterhost.The gpcckrbenable commandpromptsfortheKerberosprincipalnamesandartifactsandupdatestheconfiguration.

The gpcckrbdisable commandremovesKerberosparametersfromtheCommandCenterconfiguration.

ViewingandMaintainingWebServerLogFilesWebserveraccessanderrorlogmessagesarewrittento $GPCC_HOME/logs/gpccws.log .

IfyouexperienceerrorsviewingtheGreenplumCommandCenterConsole,refertothisfileformoreinformation.

Topreventthewebserverlogfromgrowingtoexcessivesize,youcansetuplogfilerotationusing logrotate or cronolog .

©CopyrightPivotalSoftwareInc,2013-2019 23 6.0.0

Page 24: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AdministeringCommandCenterAgentsTheCommandCentermetricscollectionagent, ccagent ,runsonsegmenthostsandreceivesreal-timemetricsemittedbythemetricscollectiondatabaseextension.Eachsegmenthosthasone ccagent process.Themetricscollectionextensionconnectsto ccagent usingUnixDomainSockets(UDS)totransfermetricsfromGreenplumDatabase.StartingGreenplumCommandCenterwiththe gpcc

startcommandstartstheCommandCenteragenton

eachsegmenthost.StoppingCommandCenterwith gpccstop endstheseprocesses.TheCommandCenterbackendmonitorstheseagentsandrestartsthemwhennecessary.

Thistopicdescribesbasicagentadministrationtasks,includingenablingagentsafteraddinghoststotheclusterandviewingtheagentlogfiles.

AboutthegpperfmonDataCollectionAgentsTheGreenplumDatabase gpperfmon_install utilityenablesthe gpmmon and gpsmon datacollectionagents.GreenplumCommandCenternolongerrequiresthehistorydatatheseagentscollect.YoucanrunthegpperfmondatacollectionagentsandtheCommandCentermetricscollectionagentsinparallel,butunlessyouneedthedatathegpperfmonagentscollectforsomeotherpurpose,youcanimprovetheGreenplumDatabasesystemperformancebydisablingthegpperfmonagents.

Toseeifthegpperfmonagentsareenabled,checkthe gp_enable_gpperfmon serverparameterwiththefollowingcommand.

$gpconfig-sgp_enable_gpperfmon

Ifthe gp_enable_gpperfmon parameterison,disabletheagentsbysettingtheparametertooffandrestartingGreenplumDatabase.

$gpconfig-cgp_enable_perform-voff$gpstop-ar

Formoreinformationaboutthegpperfmondatacollectionagentssee gpperfmon_install intheGreenplumDatabaseUtilityReference.

ConfiguringgpmonRoleLoggingOptionsThemetricscollectionagent ccagent runsqueriesonGreenplumDatabaseonbehalfofCommandCentertoperformactivitiessuchasretrievinginformationtodisplayintheCommandCenterUI,savingstateinthegpperfmonandpostgresdatabases,insertingalerteventrecords,andharvestingqueryhistoryforthegpmetricshistorytables.Theagentrunsthesequeriesusingthegpmondatabaserole.

Ifyoudonotwantallofthisqueryactivitytobeloggedinthe pg_log logfile,youcansetloggingoptionsforthegpmonroleusingthe ALTERROLEcommand.Forexample,thesecommandssetthegpmonroletologonlyDDLstatements( CREATE , ALTER , DROP )andtologonlyfatalandpanicerrors.

ALTERROLEgpmonSETlog_statementTODDL;ALTERROLEgpmonSETlog_min_messagestoFATAL;

Seethelog_statement andlog_min_messages serverconfigurationparametersintheGreenplumDatabasedocumentationforloggingoptions.

AddingandRemovingHostsWhenyouaddorreplaceGreenplumDatabasehosts,youmustreinstalltheGreenplumCommandCentersoftwaretoensurethesoftwareisinstalledonthenewhosts.ItisnotnecessarytouninstallCommandCenterbeforereinstalling.

ViewingandMaintainingAgentLogFilesLogmessagesfortheCommandCentermetricscollectoragentsaresavedinthe logs directoryoftheCommandCenterinstallationdirectoryonthemasterandeachsegmenthost.

Thecurrentlogfileisnamed agent.log .Whenanewlogisstarted,thecurrentlogisrenamedto agent.<timestamp>.log andanew agent.log fileisopened.Youshouldremoveoldlogfilesregularlytorecoverspace.

©CopyrightPivotalSoftwareInc,2013-2019 24 6.0.0

Page 25: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

©CopyrightPivotalSoftwareInc,2013-2019 25 6.0.0

Page 26: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AdministeringthegpperfmonDatabaseDatacollectedbygpmmonandgpsmonagentsisstoredinadedicateddatabasecalledgpperfmon.Thisdatabaserequiresthetypicaldatabasemaintenancetasks,suchascleanupofoldhistoricaldataandperiodic ANALYZE .

SeethegpperfmonDatabaseReference sectionforareferenceofthetablesandviewsinthegpperfmondatabase.

ConnectingtothegpperfmonDatabaseDatabaseadministratorscanconnectdirectlytothegpperfmondatabaseusinganyGreenplumDatabase-compatibleclientprogram(suchas psql ).Forexample:

$psql-dgpperfmon-hmaster_host-p5432-Ugpadmin

BackingUpandRestoringthegpperfmonDatabaseThehistorytablesofthegpperfmondatabasecanbebackedupandrestoredusingtheGreenplumDatabasebackupandrestoreutilities.SeetheGreenplumDatabaseUtilityGuideformoreinformation.

MaintainingtheHistoricalDataTablesAllofthe *_history tablesstoredinthegpperfmondatabasearepartitionedintomonthlypartitions.AJanuary2010partitioniscreatedatinstallationtimeasatemplatepartition.Itcanbedeletedoncesomecurrentpartitionsarecreated.TheCommandCenteragentsautomaticallycreatenewpartitionsintwomonthincrementsasneeded.Administratorsmustperiodicallydroppartitionsforthemonthsthatarenolongerneededinordertomaintainthesizeofthedatabase.

SeetheGreenplumDatabaseAdministratorGuideformoreinformationondroppingpartitionsofapartitionedtable.

©CopyrightPivotalSoftwareInc,2013-2019 26 6.0.0

Page 27: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SettingsTheAdmin>SettingsviewenablesCommandCenteradministratorstoconfiguresettingsforCommandCenterfeatures.

HistorysettingsTurnonEnableGPCChistorydatacollectiontosavequeryhistory,hostmetrics,anddiskusagemetricstotablesinthegpperfmondatabasegmetricsschema.ThisoptiondefaultstoonforaGreenplumDatabase6installation,buttheGreenplumDatabasemetricscollectorextensionisinactiveuntilCommandCenterisstarted.

Enteranumberofsecondstosettheminimumruntimeforaquerytobesavedinhistory.Thedefaultistosaveallqueries.SetthisthresholdtopreventCommandCenterfromfillinghistorywithtrivialqueries.

WhenyouenableGPCChistorydatacollection:

CommandCentersavesqueryandmetricshistoryinthegpmetricsschematablesinthegpperfmondatabase.Onlyqueriesthatexecuteforatleastthenumberofsecondsyouspecifyaresaved.Queryplannodehistoryisonlysavedforqueriesthatrunforatleast10seconds,orthenumberofsecondsyouspecify,ifgreaterthan10.SeegpmetricsSchemaReferenceforinformationaboutthegpmetricshistorytables.

WhenyoudisableGPCChistorydatacollection:

CommandCenterqueryhistoryviewsusehistorydatacollectedbytheGreenplumDatabasegpperfmonagents.

Forbestperformance,setEnableGPCChistorydatacollectiontoonanddisablegpperfmondatacollection.Todisablethegpperfmonagents,settheGreenplumDatabase gp_enable_gpperfmon configurationparametertooffandrestartGreenplumDatabase:

$ gpconfig -c gp_enable_gpperfmon -v 'off'$ gpstop -ar

©CopyrightPivotalSoftwareInc,2013-2019 27 6.0.0

Page 28: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

gpccManagestheGreenplumCommandCenterwebserviceandmetricscollectionagents.

gpcc<action>[-W]

gpcc[--version|-v]

gpcc[--help|-h]

gpcc[--settings]

Actionsstart

StartstheCommandCenterwebserviceandmetricscollectionagents.Addthe -W flagtoforceapromptforthegpmonuserpassword.

stop

StopstheCommandCenterwebserviceandmetricscollectionagents.Addthe -W flagtoforceapromptforthegpmonuserpassword.

status

Displaysthestatus,either Running or Stopped ,ofthewebserverandmetricscollectionagents.Addthe -W flagtoforceapromptforthegpmonuserpassword.

krbenable

EnablesKerberosauthenticationforCommandCenter.

Usethe gpcckrbenable commandtosetupKerberosauthenticationforCommandCenterusersifCommandCenterwasinitiallyinstalledwithoutenablingKerberos.Whenyourun gpcckrbenable , gpcc promptsfor:

thewebservername

thenameoftheGreenplumDatabaseKerberosservice

theCommandCenterKerberosauthenticationmode

thepathtothekeytabfileontheCommandCenterhost.

Beforeyourun gpcckrbenable ,seeEnablingAuthenticationwithKerberostocheckprerequisitesandforhelppreparingtheCommandCenterhosttoallowKerberosauthentication.

krbdisable

DisablesKerberosauthenticationforCommandCenter.

help

Displayssyntaxandhelptextforthe gpcc command.

Options--settings

DisplaysthecurrentvaluesoftheCommandCenterconfigurationparameters.SeeSetupConfigurationFileforalistoftheconfigurationparameters.

--version or -vDisplaystheGreenplumCommandCenterversion.

-W <password>

Theoptional -W optionspecifiesthepasswordforthegpmonuser.The gpcc commandnormallygetsthepasswordfromthe $PGPASSWDenvironmentvariableorthe .pgpass fileinthegpadminuser’shomedirectory.Ifthepasswordisnotavailablewitheitherofthesemethods,the-W optionmustbeincludedtospecifythepasswordwheneveryourun gpcc .

©CopyrightPivotalSoftwareInc,2013-2019 28 6.0.0

Page 29: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

DescriptionTheGreenplumDatabase MASTER_DATA_DIRECTORY environmentvariablemustbesetwhenyourunthe gpcc command.Thisenvironmentvariableisusuallysetinthegpadminuser’sshellinitializationscript( /home/gpadmin/.bashrc ,forexample).If MASTER_DATA_DIRECTORY isnotsetwhenyourungpccstart

, gpcc printsanerrormessageandexists.

Oncestarted,theCommandCenterbackendmonitorsthemetricsagentswithaheartbeat.Ifafailedagentisdetected,thebackendspawnsanewagentprocess.

ExamplesStartCommandCenterandthemetricsagents,promptingforthegpmonpassword.

$gpccstart-WPasswordforGPDBusergpmon:Startingthegpccagentsandwebserver…2018/03/2217:51:51Agentsuccessfullystartedon7/8hosts2018/03/2217:51:51ViewGreenplumCommandCenterathttp://smdw:28080

©CopyrightPivotalSoftwareInc,2013-2019 29 6.0.0

Page 30: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

gpmetricsSchemaReferenceGreenplumCommandCentercreatesthe gpmetrics schemaintheGreenplumDatabasegpperfmontosavealertrulesandlogs,andhistoricalmetricscollectedbytheGreenplumDatabasemetricscollectionsystem.Thegpperfmonschemacontainsthefollowingtables:

gpcc_alert_rule —savesalertrulesconfiguredontheCommandCenterAdmin>Alertspage.

gpcc_alert_log —recordsaneventwhenanalertruleistriggered.

gpcc_database_history —savessummaryqueryactivityinformation.

gpcc_disk_history —savesdiskusagestatisticsforeachGreenplumDatabasehostfilesystem.

gpcc_plannode_history —savesplannodeexecutionstatisticsforcompletedqueries.

gpcc_queries_history table—savesexecutionmetricsforcompletedGreenplumDatabasequeries.

gpcc_system_history table—savessystemmetricssampledfromGreenplumDatabasesegmentshosts.

Ifyousettheschemasearchpathtoincludethe gpmetrics schema,youdonothavetoqualifytablenameswiththe gpmetrics schemaname.TosetthedefaultsearchpathforthegpperfmondatabaseenterthisSQLcommand.

=#ALTERDATABASEgpperfmonSETsearch_pathTOpublic,gpmetrics;

Youmustexitthecurrentsessionandstartanewsessionforthenewsearchpathtotakeeffect.

AlertTablesCommandCenterusesthe gpcc_alert_rule and gpcc_alert_log tablestostorethealertrulesyousetupintheuserinterfaceandtologmessageswhenthealertrulesaretriggered.

gpmetrics.gpcc_alert_ruleTableThe gpcc_alert_rule tablerecordsthealertrulesconfiguredintheCommandCenteruserinterface.Ithasthecolumnsshowninthefollowingtable.

Column Type Description

rule_id integer Uniqueidfortherule.

rule_type integer Reservedforfutureuse.

rule_description charactervarying(512) Textoftherule.

rule_config json JSONstringcontainingparametersforuser-specifiedvalues.

ctime timestamp(0)withouttimezone Timetherulewascreated.

etime timestamp(0)withouttimezone Timetherulebecameinactive,ornullifruleisactive.

The gpcc_alert_rule tablekeepsahistoryofalertruleconfigurations.Whenarulebecomesactive,anewrowisinsertedandthe ctime timestampcolumnissettothecurrenttime;the etime timestampisnull,indicatingthattheruleisstillactive.Whenaruleiseitherdisabledorsupercededbyanewrule,theetime timestampcolumnissettothecurrenttime.Thus,thesetofcurrentlyactiverulesisallrowswherethe etime columnisnull.Arowthathastimestampsinboth ctime and etime columnsisanhistoricalrecordoftheperiodoftimeduringwhichtherulewasactive.

The rule_id column,auniqueinteger,isthedistributionkeyforthetableandisusedtoidentifyasinglealertruleconfiguration.Thiscolumncanbejoinedwiththe rule_id columninthe gpcc_alert_log tabletoidentifytherulethattriggeredeachrecordedalertevent.

The rule_description columncontainsastringthatdescribestheeventthatmatchestherule.ItisthetextdisplayedintheCommandCenterUIfortherule,withuser-specifiedvaluesinserted.

The rule_config columncontainsaJSONstringwithparametersforthevaluesenteredforeachoftherule’sfieldsintheCommandCenterUI.

gpmetrics.gpcc_alert_logTableThe gpcc_alert_log tablehasthecolumnsshowninthefollowingtable.

©CopyrightPivotalSoftwareInc,2013-2019 30 6.0.0

Page 31: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Column Type Description

id integer UniqueIDforthealert.

rule_id integer TheIDoftherulethattriggeredthisalert.

transaction_time timestamp(0)withouttimezone Timethealertwasraised.

content json Containsparametersspecifyingvaluesthattriggeredthealert.

The gpcc_alert_log tableisanappend-only,column-orientedtable,partitionedbymonthonthe transaction_time column.CommandCentercreatesnewpartitionsasneededanremovespartitionsover12monthsold.

Arowisaddedtothe gpcc_alert_log tablewheneveranalertruleismatched.

The id column,auniqueinteger,isthedistributionkeyforthetable.

The transaction_time columnissettothecurrenttimewhenarowiscreated.

The rule_id columncanbejoinedwiththe rule_id columninthe gpcc_alert_rule tabletoaccessdetailsoftherulethattriggeredthealert.

The content columncontainsaJSONstringwithparametersspecifyingdetailsabouttheeventthattriggeredthealert.TheJSONparametersvarywiththetypeofthealert.

ExampleQueryThisqueryliststhetenmostrecentalerts,includingtheconfigurationoftherulethattriggeredeachevent.

gpperfmon=#SELECTl.transaction_time,l.rule_id,r.rule_description,l.contentFROMgpmetrics.gpcc_alert_logASl,gpmetrics.gpcc_alert_ruleASrWHEREl.rule_id=r.rule_idORDERBYl.transaction_timeLIMIT10;

GreenplumDatabaseMetricsHistoryTablesThe gpmetrics queryhistorysavessinformationcollectedbytheGreenplumDatabasemetricscollectionsystemandforwardedtoGreenplumCommandCenter.

Thedistributionkeyforeachtableisa ctime timestampcolumn,whichisthetimewhentherowisaddedtothedatbase.Thetablesarepartitionedbyyearandmonth.GreenplumCommandCentercreatesnewpartitionsautomaticallyasneeded.

Thehistorytablesuseappend-optimized,column-orientedstorage.

CommandCenteronlysavesquerieswithruntimesgreaterthanthevalueofthe min_query_time configurationparameter,foundinthe$MASTER_DATA_DIRECTORY/gpmetrics/gpcc.conf configurationfileonthehostexecutingCommandCenter.Thedefault,0,savesallqueriesinthehistorytable.ThisparametercanbeconfiguredontheCommandCenterAdmin>Settingspage.

gpmetrics.gpcc_database_historyThe gpcc_database_history tablesavessummaryqueryactivitymetricscollectedbytheGreenplumDatabasemetricscollector.ThisdatacanbeusedtoreviewtheGreenplumDatabasequeryloadovertime.

Column Type Description

ctime timestamp(0)withouttimezone Timetherecordwascreated.

queries_total integer Totalnumberofqueriesrunningandqueuedtorun.

queries_running integer Numberofqueriescurrentlyrunning.

queries_queued integer Numberofqueriesqueued,butnotyetrunning.

queries_blocked integer Thenumberofqueriesstarted,butblockedbyothertransactions.

©CopyrightPivotalSoftwareInc,2013-2019 31 6.0.0

Page 32: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

gpmetrics.gpcc_disk_historyThe gpcc_disk_history tablesaveshistoricaldiskusagestatisticsforeachGreenplumDatabasesegmenthostfilesystem.

Column Type Description

ctime timestamp(0)withouttimezone Timetherowwascreated.

hostname charactervarying(64) Nameofthesegmenthost.

filesystem text Pathtothesegment’sdatadirectory.

total_bytes bigint Totalsizeofthefilesystemstorageinbytes.

bytes_used bigint Numberofstoragebytesinuse.

bytes_available bigint Numberofstoragebytesavailable.

gpmetrics.gpcc_plannode_historyThe gpcc_plannode_history tablesavesdetailedmetricsforeachoperation(node)inacompletedqueryplan.EachrowcontainsmetricsforoneoperationthatexecutedononeGreenplumDatabasesegment.Thisinformationallowsreconstructingtheplanandexecutionmetricsforacompletedquery.

Plannodehistoryisonlysavedforqueriesthatexecutefor10secondsormore.The gpcc_queries_history

Column Type Description

ctimetimestamp(0)withouttimezone

Timetherowwascreated.

tmid integer Atimeidentifierforthequery.Allrecordsassociatedwithaquerywillhavethesame tmid .

ssid integerSessionidforthedatabaseconnection.Allrecordsassociatedwiththequerywillhavethesamessid .

ccnt integerCommandnumberwithinthesession.Allrecordsassociatedwiththequerywillhavethesameccnt .

segid integer Id( dbid )ofthesegmentforthisplannode.

procid integer ThepostgresprocessIDforthisplannode.

sliceid integer Idoftheslicetheoperationbelongsto.Operationsthatbelongtothesamesliceexecuteinparallel.

nodeid integer ThequeryplannodeIDforthisoperation.

parent_nodeid integer TheparentqueryplannodeIDfromthequeryplan.

node_type charactervarying(64) Nameoftheoperationtype.

tinittimestamp(6)withouttimezone

Timetheoperationwasinitialized.

tstarttimestamp(6)withouttimezone

Timetheoperationstarted.

tfinishtimestamp(6)withouttimezone

Timetheoperationfinished.

status charactervarying(16) Statusoftheoperation: initialize , executing ,or finished .

planrows doubleprecision Thenumberofoutputrowsestimatedfortheoperation.

planwidth integer Widthofoutputrowsestimatedfortheoperation.

start_cost doubleprecision Numberofpagereadsexpectedtoproducefirstoutputrow.

total_cost doubleprecision Numberofpagereadsexpectedtoproducealloutputrows.

tuple_count bigint

ntuples bigint

nloops bigint

first_tupletimestamp(6)withouttimezone

Timetheoperationproducedthefirstoutputrow.

rel_oid oid ObjectIDoftheoutputrowsproducedbytheoperation.

relation_name charactervarying(64) Nameofthetablethisoperationprocessed,ifany.

index_name charactervarying(64) Nameoftheindexusedbythisoperation,ifany.

©CopyrightPivotalSoftwareInc,2013-2019 32 6.0.0

Page 33: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

alias_name charactervarying(64) AliasfortherelationdecarledintheSQLcommand.

node_seq integer

condition text Conditionexpressionusedforafilterorjoinoperation.

Column Type Description

gpmetrics.gpcc_queries_historyThe gpcc_queries_history tablesavesmetricsforcompletedqueries.

Column Type Description

ctimetimestamp(0)withouttimezone

Timetherowwascreated.

tmid integer Atimeidentifierforthequery.Allrecordsassociatedwiththequerywillhavethesame tmid .

ssid integer Sessionidforthedatabaseconnection.Allrecordsassociatedwiththequerywillhavethesame ssid .

ccnt integer Commandnumberwithinthissession.Allrecordsassociatedwiththequerywillhavethesame ccnt .

usernamecharactervarying(64)

Rolenamethatissuedthequery.

dbcharactervarying(64)

Nameofthedatabasequeried.

costdoubleprecision

Estimatedcosttoexecutequery,computedbythelegacyplannerorGPORCA.

tsubmittimestamp(6)withouttimezone

Timethequerywassubmitted.

tstarttimestamp(6)withouttimezone

Timethequerywasstarted.

tfinishtimestamp(6)withouttimezone

Timethequeryfinished.

statuscharactervarying(16)

Statusofthequery– abort , error ,or done .

rows_out bigint Numberofrowsreturnedbythequery.

error_msg text Errormessage,ifthequeryfailed.

plan_gencharactervarying(16)

PLANNER ifqueryplanwasgeneratedbythelegacyplanner; OPTIMIZER iftheplanwasgeneratedbyGPORCA,thePivotalqueryoptimizer.

query_hashcharactervarying(64)

Hashcodegeneratedfromthetextofthequery.

query_text text Completetextofthequery.Somequeriesmaybereformattedbeforestoringinthehistorydatabase.

application_namecharactervarying(64) Nameoftheclientapplicationthatestablishedthedatabaseconnection.

rsqnamecharactervarying(64)

Ifthe gp_resource_manager configurationparameteris queue ,thenameoftheresourcequeuemanagingthequery.

rsgnamecharactervarying(64)

Ifthe gp_resource_manager configurationparameteris group ,thenameoftheresourcegroupmanagingthequery.

cpu_master bigint TotalCPUusageforthisqueryontheGreenplumDatabasemasterinstance.

cpu_segs bigintTotalCPUusageforthisqueryacrossallsegments,measuredinmilliseconds.ThisisthesumoftheCPUusagevaluestakenfromallactiveprimarysegmentsinthedatabasearray.

cpu_master_percentdoubleprecision

AverageCPUpercentusageonthemasterhostduringexecutionofthisquery.

cpu_segs_percentdoubleprecision

AverageCPUpercentusageonthesegmenthostsduringtheexecutionofthisquery.

Displaystheamountofprocessingskewinthesystemforthisquery.Processing/CPUskewoccurswhenone

©CopyrightPivotalSoftwareInc,2013-2019 33 6.0.0

Page 34: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

skew_cpu doubleprecision

segmentperformsadisproportionateamountofprocessingforaquery.TheskewiscalculatedfromtotalCPUsecondsusedonallsegmentsduringtheexecutionofthequery.

skew_rowsdoubleprecision

Displaystheamountofrowskewinthesystem.Rowskewoccurswhenonesegmentproducesadisproportionatenumberofrowsforaquery.

memory bigint Totalsizeofmemory,inbytes,usedbyallsegmentstoexecutethisquery.

disk_read_bytes bigint Numberofbytesreadfromdisk.

disk_write_bytes bigint Numberofbyteswrittentodisk.

spill_size bigint Totalsizeofspillfilesusedbyallsegmentstoexecutethisquery.

rqprioritycharactervarying(16)

Prioritysettingfortheresourcequeuemanagingthisquery.Blankifresourcegroupmanagementisenabled.

Column Type Description

gpmetrics.gpcc_system_historyThe gpcc_system_history tablesaveshistoricalsystemmetricsforeachGreenplumDatabasehost,includingthemaster,standbymaster,andsegmenthosts.Themetricsincludeinformationaboutmemory,CPU,disk,andnetworkutilitization.

Column Type Description

ctimetimestamp(0)withouttimezone

Timetherowwascreated.

hostname charactervarying(64) Segmentormasterhostnameassociatedwiththesesystemmetrics.

mem_total bigint TotalsystemmemoryinBytesforthishost.

mem_used bigint Systemmemoryused,inBytes,forthishost.

mem_actual_used bigintActualmemoryused,inBytes,forthishost(notincludingthememoryreservedforcacheandbuffers).

mem_actual_free bigintFreeactualmemory,inBytes,forthishost(notincludingthememoryreservedforcacheandbuffers).

swap_total bigint TotalswapspaceinBytesforthishost.

swap_used bigint Swapspaceused,inBytes,forthishost.

swap_page_in bigint Numberofswappagesin.

swap_page_out bigint Numberofswappagesout.

cpu_user doubleprecision PercentageoftimeCPUprocessesexecuteinusermode.

cpu_sys doubleprecision PercentageoftimeCPUprocessesexecuteinsystem(kernel)mode.

cpu_idle doubleprecision PercentageidleCPU.

load0 doubleprecision CPUone-minuteloadaverage.

load1 doubleprecision CPUfive-minuteloadaverage.

load2 doubleprecision CPUfifteen-minuteloadaverage.

quantum integer Intervalbetweenmetricscollections.

disk_ro_rate bigint Diskreadoperationspersecond.

disk_wo_rate bigint Diskwriteoperationspersecond.

disk_rb_rate bigint Bytespersecondfordiskreadoperations.

disk_wb_rate bigint Bytespersecondfordiskwriteoperations.

net_rp_rate bigint Packetspersecondonthesystemnetworkforreadoperations.

net_wp_rate bigint Packetspersecondonthesystemnetworkforwriteoperations.

net_rb_rate bigint Bytespersecondonthesystemnetworkforreadoperations.

net_wb_rate bigint Bytespersecondonthesystemnetworkforwriteoperations.

©CopyrightPivotalSoftwareInc,2013-2019 34 6.0.0

Page 35: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ConfigurationFilesReferenceConfigurationparametersforGreenplumCommandCenterarestoredinthefollowingfiles.

$MASTER_DATA_DIRECTORY/gpperfmon/conf/gpperfmon.conf ,onGreenplumDatabasemasterhostStoresconfigurationparametersfortheGreenplumCommandCenteragents.

$GPCC_HOME/conf/app.conf ,onCommandCenterhost.StoresconfigurationparametersfortheCommandCenterwebapplicationandwebserver.

$MASTER_DATA_DIRECTORY/gpmetrics/gpcc.conf

StoresconfigurationparametersforCommandCenterinterfaceoptionsandalertemails.$MASTER_DATA_DIRECTORY/postgresql.conf

StoresconfigurationparameterstoenabletheGreenplumCommandCenterfeaturesforGreenplumDatabaseserver.Theseparametersarenormallysetusingthe gpconfig GreenplumDatabasemanagementutility.

$GPCC_HOME/bin/ssh-wrapper

GreenplumCommandCenternormallyfindsthe ssh commandonthepath.Ifyourenvironmenthasanincompatibleimplementationofthiscommandonthepath,youcanprovidetheabsolutepathtoyourversioninthe ssh-wrapper script,locatedat $GPCC_HOME/bin/ssh-wrapper .

Forexample:

ssh="/opt/bin/myssh"

©CopyrightPivotalSoftwareInc,2013-2019 35 6.0.0

Page 36: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

CommandCenterConsoleParametersTheCommandCenterConsoleconfigurationfileisontheCommandCenterhostat $GPCC_HOME/webserver/conf/app.conf .

Aftereditingthisfile,reloadtheconfigurationbyrestartingtheCommandCenterConsole.

$gpcc--stop$gpcc--start

appname = gpccws

Thewebserverbinaryfile.Donotchange.

listentcp4 = [true | false]

When true ,theaddresstypeistcp4.Thedefaultis true .

runmode = [prod | dev | test]

Theapplicationmode,whichcanbe dev , prod or test .Thedefault, prod ,istherecommendedsetting.In dev and test modesCommandCenterprintsmoreverboselogmessages.Thesearedifferentlogsthanthelogsaffectedbythe log_level parameter.

session = [true | false]

Usesessionstomanageuserexperience.Thedefaultis true .Sessionsarestoredinmemory.

enablexsrf = [true | false]

EnableCSRFprotection.

xsrfexpire = <seconds>

CSRFexpiretime.Thedefaultis 2592000 seconds.

xsrfkey = <token_string>

TheCSRFtoken.

rendertype = json

Therendertypeofwebserver.Donotchange.

printallsqls = [true | false]

PrintallbackendgpperfmonSQLtothewebserverconsole.Thedefaultis false .

master_port = <port>

TheGreenplumDatabasemasterport.Thedefaultis 5432 .

log_level

Thelevelofmessagestolog: INFO , VERBOSE , DEBUG , WARN , ERROR ,or FATAL .Thedefaultis INFO .

path = /usr/local

PathtothedirectorywhereGreenplumCommandCenterisinstalled.

display_name = <display_name>

Thedisplaynamefortheconsole.

enable_kerberos = [true | false]

TrueifKerberosauthenticationisenabledforCommandCenter.Thedefaultis false .

HTTPSCertFile = </path/to/cert.pem>

HTTPSKeyFile = </path/to/cert.pem>

Setbothofthesepropertiestothefullpathtoa.pemfilecontainingthecertificateandprivatekeyfortheCommandCenterwebserver.

EnableHTTPS = [true | false]

EnablelisteningonthesecureSSLport.TrueifSSLisenabled.Onlyoneof EnableHTTPS or EnableHTTP canbetrue.

EnableHTTP = [true | false]

EnablelisteningontheHTTPport.TrueifSSLisnotenabled.Onlyoneof EnableHTTP or EnableHTTPS canbetrue.

httpsport = <port>

Thewebserverportwhen EnableHTTPS istrue.Thedefaultis28080.

©CopyrightPivotalSoftwareInc,2013-2019 36 6.0.0

Page 37: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

httpport = <port>

Thewebserverportwhen EnableHTTP istrue.Thedefaultis28080.

rpcport = <port>

TheportonwhichtheCommandCenterbackendreceivesdatafrommetricscollectoragents.Thedefaultis8899.

master_host = <hostname>

TheGreenplumDatabasehostname.Thedefaultis localhost .

©CopyrightPivotalSoftwareInc,2013-2019 37 6.0.0

Page 38: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

gpmetricsConfigurationFileReferenceGreenplumCommandCenterusesthe gpcc.conf configurationfiletosaveconfigurationinformationenteredintheCommandCenteruserinterface.Youshouldnotnormallyeditthe gpcc.conf filedirectly.Instead,modifyconfigurationinformationintheCommandCenteruserinterface.

The gpcc.conf fileiscreatedinthe $MASTER_DATA_DIRECTORY/gpmetrics/ directoryontheGreenplumDatabasemasterorstandbyhostwhereyoustartCommandCenter.ThefileisanINI-formatconfigurationfile,containingpropertiesdefinedas key=

valueentries,onepropertyperline.

Property Description

allow_anonymousIf true ,CommandCenteruserscanaccesstheQueryMonitorviewwithoutloggingintoCommandCenter.YoucanchangethissettingontheCommandCenterAdmin>Permissionspage.

resource_queue_import_statusCommandCenterusesthispropertytodeterminewhethertooffertoimportGreenplumDatabaseresourcequeuestoresourcegroupswhenyouaccesstheAdmin>WorkloadMgmtview.Thedefaultis false .

emailFromTheemailaddresstosetonthe“From:”lineofalertemails.Thedefaultis [email protected] .

Note:SettheemailandsmtppropertiesontheCommandCenterAdmin>Alertspage.

emailTo Acomma-separatedlistofemailaddressestosendalertemails.

smtpUsername TheaccountnametousewhenauthenticatingwiththeSMTPserver.

smtpServer TheaddressandportoftheSMTPservertouseforalertemails.

smtpPassword ThepasswordusedtoauthenticatetheSMTPuserwiththeSMTPserver,base64-encoded.

©CopyrightPivotalSoftwareInc,2013-2019 38 6.0.0

Page 39: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SetupConfigurationFileAsetupconfigurationfilecontainspropertiesusedtoconfigureGreenplumCommandCenterwhenyouperformanon-interactiveCommandCenterinstallation.Thefileispassedtothe gpccinstall commandwiththe -c option:

$./gpccinstall-<version>-c<config_file>

Theconfigurationfilecontains name:value or name=value entries,oneperline.Commentsbeginwitha # or ; characterandcontinuethroughtheendoftheline.

SeeInstallingPivotalGreenplumCommandCenterformoreinformationaboutinstallingCommandCenterwithaconfigurationfile.

Parameterspath

ThepathtothedirectorywhereGreenplumCommandCentersoftwarewillbeinstalled.ThedirectorymustbewritablebythegpadminuseronallhostsintheGreenplumCluster.

display_name

ThenametodisplayintheCommandCenteruserinterface.Thedefaultdisplaynameis gpcc .

master_port

TheGreenplumDatabasemasterport.Default: 5432 .

web_port

ThelistenportfortheCommandCenterwebserver.Thedefaultis 28080 .

enable_ssl

True ifclientconnectionstotheCommandCenterwebserveraretobesecuredwithSSL.Thedefaultis false .If true the ssl_cert_fileparametermustbesetandtheSSLcertificatemustbeinstalledonthehostwhereyourunCommandCenter.

ssl_cert_file

If enable_ssl is true ,setthisparametertothefullpathtoavalidcertificateinPEMfileformat.ThecertificatemustbeinstalledonthehostwhereyourunCommandCenter.

enable_kerberos

Setto true toenableKerberosauthentication.

krb_mode

TheKerberosauthenticationschemetouse.Thedefaultis 1 .

1-normalmode(default)-TheCommandCenterKerberoskeytabfilecontainstheCommandCenterprincipalandmaycontainprincipalsforCommandCenterusers.Iftheprincipalintheclient’sconnectionrequestisintheCommandCenter’skeytabfile,CommandCenterusestheclient’sprincipalfordatabaseconnections.Otherwise,CommandCenterusesthegpmonuserfordatabaseconnections.

2-strictmode-CommandCenterhasaKerberoskeytabfilecontainingtheCommandCenterserviceprincipalandaprincipalforeveryCommandCenteruser.Iftheprincipalintheclient’sconnectionrequestisinthekeytabfile,thewebservergrantstheclientaccessandthewebserverconnectstoGreenplumDatabaseusingtheclient’sprincipalname.Iftheprincipalisnotinthekeytabfile,theconnectionrequestfails.

3-gpmon_onlymode-CommandCenterusesthegpmondatabaseroleforallGreenplumDatabaseconnections.NoclientprincipalsareneededintheCommandCenter’skeytabfile.

webserver_url

Thewebserverhostname,fromtheKerberosHTTPserviceprincipal.

keytab

PathtothekeytabfilecontainingKerberosprincipalsfortheCommandCenterwebserverandusers.

Examples

©CopyrightPivotalSoftwareInc,2013-2019 39 6.0.0

Page 40: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

######GPCC4.0setupconfigurationfile#####path=/optdisplay_name=GreenplumDatabaseProductionClustermaster_port=5432webserver_port=28081EnableHTTP=true;allowbothHTTPandHTTPSEnableHTTPS=truessl_cert_file=/etc/ssl/cert.pemenable_kerberos=false

©CopyrightPivotalSoftwareInc,2013-2019 40 6.0.0

Page 41: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SecuringGreenplumCommandCenterGreenplumCommandCenterConsolecanbesecuredbyencryptingnetworktrafficbetweenthewebserverandusers’browsers,authenticatingCommandCenterusers,andmanagingusers’permissionstoaccessCommandCenterfeatures.

SSL/TLSEncryptionGreenplumCommandCentersupportsSSL/TLSencryptiontosecureconnectionsbetweenbrowsersandtheCommandCenterwebserver.CommandCentersupportsTLS1.2protocolandhigher.Whenenabled,CommandCenterusestheSecureWebSocketsAPI,enablinglong-lived,full-duplexconnections,inadditiontoencryption.

ToenableSSL/TLSencryption,youneedacombinedcertificate/keyfilefortheCommandCenterwebserverinplacewhenyouinstallCommandCenter.Thefilecontainsaprivatekeyandaservercertificate.

Youcanrequestakeypairandcertificatefromyourorganization’sinternalcertificateauthorityorfromanexternalcertificateauthority.Youcanalsocreateaself-signedcertificatewithacryptographysuitesuchasOpenSSL.Ifyoucreateaself-signedcertificate,however,clientswillhavetooverrideasecuritywarningwhentheyfirstconnecttotheCommandCenterwebserver.

Tocreatethecombinedcertificate/keyfile,createatextfile,forexample server.pem ,andcopytheentirebodyofprivatekeyandcertificateintoit.Makesuretoincludethebeginningandendtags:

-----BEGINRSAPRIVATEKEY-----<privatekey>-----ENDRSAPRIVATEKEY----------BEGINCERTIFICATE-----<certificate>-----ENDCERTIFICATE-----

Youcanconcatenateadditionalcertificatestotheendofthefileifacertificatechainisrequiredtoauthenticatetheservercertificate.

PlacethefileontheserverwhereCommandCenterwillexecute,forexampleinthe /etc/ssl/certs directoryoftheGreenplumDatabasemasterhost.WhenyouinstallCommandCentertheinstallerpromptsyoutoenterthefullpathtothisfile.SeeCommandCenterConsoleParametersfordetails.

AuthenticationOptionsUsersloggingintoGreenplumCommandCenterareauthenticatedwiththeGreenplumDatabasehost-basedauthenticationsystem.Userscanentercredentialsasausernameandpasswordor,ifKerberosauthenticationisconfigured,byauthenticatingwithKerberosontheirworkstationbeforebrowsingtotheCommandCenterwebserver.

Note:GreenplumCommandCenterdoesnotacceptloginsfromthegpadminuser,orfromusersconfiguredwithtrustauthenticationinthe pg_hba.conffile.

DatabaseusersmustfirstbeaddedtotheGreenplumDatabasebyusingcommandssuchas CREATEROLE or CREATEUSER .The LOGIN privilegeisrequired.Thisexamplecreatesaloginuserwithanencryptedpassword:

CREATEROLEcc_userWITHLOGINENCRYPTEDPASSWORD'changeme';

The pg_hba.conf configurationfiledetermineshowauthenticationwillproceed.Thisfilecontainsalistofentriesthatarecomparedtoattributesoftheuser’sconnectionrequest,includingthetypeofconnection,networklocationoftheoriginatinghost,databasename,andloginusername.Whenamatchisfound,theauthenticationmethodspecifiedintheentryisapplied.

The pg_hba.conf filecanbeviewedbyOperatorsandeditedbyAdminsintheCommandCenterconsoleontheAdmin>Authenticationpage.

The md5 and password authenticationmethodsauthenticatetheusernameandpasswordwiththeGreenplumDatabase pg_roles systemtable.Themd5 methodrequiresthepasswordtobeMD5-encodedwhensentoverthenetwork,soitispreferredoverthe password method,whichsendsthepasswordincleartext.

The ldap authenticationmethodauthenticatestheusernameandpasswordwithanLDAPserver.TheLDAPserverandparametersarespecifiedintheoptionsfieldofthe pg_hba.conf entry.SeethePostgreSQLLDAPauthentication documentationfortheformatoftheLDAPoptions.

The gss authenticationmethodisusedforKerberosauthentication.TouseKerberoswithCommandCenter,Kerberosauthenticationmustbeenabled

©CopyrightPivotalSoftwareInc,2013-2019 41 6.0.0

Page 42: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

fortheGreenplumDatabasesystemandCommandCentermustalsobeconfigured.UsersauthenticatewiththeKerberosKDContheirworkstations(using kinit ,forexample)beforeconnectingtotheCommandCenterwebserver.TherolenameinCommandCenteristheuser’sKerberosprincipalname.

FordetailsaboutsettingupKerberosauthentication,seeEnablingKerberosAuthenticationwithGreenplumCommandCenter.

SeethePostgreSQLAuthenticationmethods documentationforadditionaldetailsoftheauthenticationoptions.

Authorization

CommandCentermanagespermissionlevelsusingGreenplumDatabaserolesandgroups.TheBasic,OperatorBasic,andOperatorpermissionlevelscorrespondtothe gpcc_basic , gpcc_operator_basic ,and gpcc_operator grouprolesinthedatabase.TheAdminpermissionlevelisconferredtorolesthathavethe SUPERUSER privilege.Auserwhohasnotbeenaddedtoanyofthegroupsanddoesnothave SUPERUSER privilegehasthemostrestrictivepermissionlevel,SelfOnly.

GreenplumDatabasesuperuserscanmanagepermissionlevelsontheCommandCenterAdmin>Permissionspage.Superuserscanalsodirectlyassignusersrolesinthedatabasebyusingthe ALTERUSER , ALTERGROUP ,andrelatedcommandstoaddorremoveusersfromgroupsandaddorremovetheSUPERUSER privilege.Ifaroleisconfiguredformorethanonepermissionlevel,CommandCenterusesthehighestpermissionlevel.

CommandCenterusershavethefollowingcapabilities,accordingtotheirpermissionlevels:

SelfOnlyUserscanviewmetricsandviewandcanceltheirownqueries.

AnyGreenplumDatabaseusersuccessfullyauthenticatedthroughtheGreenplumDatabaseauthenticationsystemcanaccessGreenplumCommandCenterwithSelfOnlypermission.Higherpermissionlevelsarerequiredtoviewandcancelother’squeriesandtoaccesstheSystemandAdminControlCenterscreens.

BasicAllowsuserstoviewmetrics,viewallqueries,andcanceltheirownqueries.

UserswithBasicpermissionaremembersoftheGreenplumDatabase gpcc_basic group.

OperatorBasicAllowsuserstoviewmetrics,viewtheirownandothers’queries,canceltheirownqueries,andviewtheSystemandAdminscreens.

UserswithOperatorRead-onlypermissionaremembersoftheGreenplumDatabase gpcc_operator_basic group.

OperatorAllowsuserstoviewtheirownandothers’queries,canceltheirownandother’squeries,andviewtheSystemandAdminscreens.

UserswithOperatorpermissionaremembersoftheGreenplumDatabase gpcc_operator group.

AdminAllowsusersaccesstoallviewsandcapabilitiesintheCommandCenter.

GreenplumDatabaseuserswiththe SUPERUSER privilegeinGreenplumDatabasehaveSuperuserpermissionsinCommandCenter.

Note:ThefunctionalitydescribedinthissectionhasnotbeenfullyimplementedinGreenplumCommandCenter4.0.0.OnlyAdminandSelfOnlypermissionlevelsareavailable.

©CopyrightPivotalSoftwareInc,2013-2019 42 6.0.0

Page 43: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ManagingGreenplumCommandCenterAuthenticationTheAdmin>AuthenticationscreenallowsuserswithOperatorBasic,Operator,andAdminpermissiontoviewtheGreenplumDatabasehost-basedauthenticationfile, pg_hba.conf .

UserswithAdminpermissioncanadd,remove,change,andmoveentriesinthefile.TheCommandCenterUIvalidatesentriestoensurecorrectsyntax.Previousversionsofthefilearearchivedsothatyoucanrestoreanearlierversionorauditchanges.

SeeAuthenticationOptionsforanoverviewofuserauthenticationoptionsforGreenplumDatabaseandGreenplumCommandServer.

SeeConfiguringClientAuthentication intheGreenplumDatabaseAdministratorGuideforadetaileddescriptionofthecontentsofthe pg_hba.conf file.

ViewingtheHost-BasedAuthenticationFileChooseAdmin>AuthenticationtodisplaythecontentoftheGreenplumDatabase pg_hba.conf file.

The pg_hba.conf filecontainsalistofentriesthatspecifythecharacteristicsofdatabaseconnectionrequestsandauthenticationmethods.WhenGreenplumDatabasereceivesaconnectionrequestfromaclient,itcomparestherequesttoeachentryinthe pg_hba.conf entryinturnuntilamatchisfound.Therequestisauthenticatedusingthespecifiedauthenticationmethodand,ifsuccessful,theconnectionisaccepted.

EditingtheHost-BasedAuthenticationFileCommandCenteruserswiththeAdminpermissioncaneditthe pg_hba.conf file.Notethatanychangesyoumakearelostifyoumovetoanotherscreenbeforeyousavethem.

Tochangeanexistingentry,clickanywhereontheentry.EditthefieldsandclickSavetosaveyourchanges,orCanceltorevertchanges.

Tomoveanentryupordowninthelist,clickonthe symbol,dragthelinetothedesiredlocation,andrelease.

Toaddanewentrytotheendofthefile,clickAddNewEntryatthebottomofthescreen.EditthefieldsandclickSavetosaveyourchanges,orCanceltoabandonthenewentry.

Toaddanewentryafteranexistingentry,highlighttheexistingentryandclick .EditthefieldsandclickSavetosaveyourchanges,orCanceltoabandonthenewentry.

©CopyrightPivotalSoftwareInc,2013-2019 43 6.0.0

Page 44: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Tocopyanentry,selecttheentryandclick .Acopyoftheselectedentryisaddedbelowtheselectedentryanddisplayedforediting.EditthefieldsandclickSavetosaveyourchanges,orCanceltoabandonthecopy.

Toaddacommenttothefile,addanentrybyclickingAddNewEntry andthenchoose # fromthe Type list.

Totoggleanentrybetweenactiveandinactive,selectthelineandclicktheactive/inactivetogglecontroltotheright.Thisactionaddsorremovesacommentcharacter( # )atthebeginningoftheentry.

Toremoveanentry,highlightthelineandclick .Theentryisdisplayedwithstrikethroughtext.Youcanrestoretheentrybyhighlightingitandclickingundelete.TheentryispermanentlyremovedwhenyouclickSaveconfigandupdateGPDB.

Tofinishediting,clickSaveconfigandupdateGPDB.ThenclickSaveandUpdatetosaveyourchangesorclickCanceltoreturnwithyoureditsintact.

WhenyouselectSaveandUpdate,the pg_hba.conf fileissavedandrefreshedinGreenplumDatabase.Notethatexistingclientconnectionsareunaffected.

LoadingaPreviousVersionoftheHost-BasedAuthenticationFileWhenyousaveanewversionofthe pg_hba.conf file,acopyissavedintheGreenplumDatabase $MASTER_DATA_DIRECTORY/pg_hba_archive directoryaspg_hba.conf-<timestamp> .

Toviewanarchivedversionofthe pg_hba.conf file,clickLoadversions…andclickthetimestampfortheversiontodisplay.

Toreverttoapreviousversionofthefile,loadthepreviousversionandthenclickSaveconfigandupdateGPDB.TheconfigurationisrefreshedinGreenplumDatabaseandsavedasanewversioninthearchivedirectory.

or

©CopyrightPivotalSoftwareInc,2013-2019 44 6.0.0

Page 45: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ManagingGreenplumCommandCenterPermissionsThePermissionsLevelsforGPCCAccessscreenallowsuserswithOperatorBasic,Operator,orAdminpermissiontoviewCommandCenteruserpermissionsforGreenplumDatabaseusers.UserswithAdminpermissioncansetpermissionsforanyuser.

UserswithOperatorBasic,Operator,andAdminpermissioncanalsoseeiftheGuestAccesstoQueryMonitorfeatureisenabledordisabled,andAdminuserscantogglethisfeatureonandoff.

ViewingUserPermissionsInitially,allGreenplumDatabaseloginusersareincludedinthelistofroleswiththeircurrentpermissionlevels.

Tofilterbyrolename,enterallorpartoftheuser’sdatabaserolenameintheRoleNamefield.Thefilterperformsasimplesubstringsearchanddisplaysuserswithmatchingrolenames.ClicktheRoleNamelabeltoreversethesearchorder.

Tofilterforuserswithaspecificpermissionlevel,choosethepermissionlevelfromthePermissionLevellist.

RoleNameandPermissionLevelfilterscanbeusedtogether.

Toresetthefilters,removealltextfromtheRoleNamefieldandchooseFilterby…fromthePermissionLevellist.

ChangingUserPermissionLevelsUserswithAdminpermissioncanchangepermissionlevels.

1. UsetheRoleNameandPermissionLevelfilterstodisplaytherolesyouwanttochange.

2. Checktheboxnexttoarolenametoselecttheuser,orchecktheboxintheheadingtoselectalldisplayedusers.

3. SelectthenewpermissionslevelforeachuserfromthelistinthePermissionLevelcolumn,orselectanewpermissionlevelforallselectedusers

©CopyrightPivotalSoftwareInc,2013-2019 45 6.0.0

Page 46: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

fromtheChangeSelectedto…list.

EnablingorDisablingGuestAccesstoQueryMonitorWhenenabled,theGuestAccesstoQueryMonitorfeatureallowsanyonewithaccesstotheGreenplumCommandCenterwebservertoclickViewQueryMonitorontheCommandCentersign-inscreenandseetheQueryMonitorpagewithoutloggingin.TheseanonymoususerscannotcancelqueriesandcannotaccessanyotherCommandCenterfeatures.

Whenthisfeatureisoff,theViewQueryMonitorlinkdoesnotappearonthesign-inscreenandanonymoususerscannotseetheQueryMonitorpage.

CommandCenteruserswithAdminpermissioncantogglethefeatureonanoffwithamouseclick.UserswithOperatororOperatorBasicpermissionseeamessagereportingifthefeatureisonoroff.

©CopyrightPivotalSoftwareInc,2013-2019 46 6.0.0

Page 47: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SecuringthegpmonDatabaseUserTheGreenplumDatabasegpmonuserisasuperuserroleusedtomanagethegpperfmondatabase.The gpperfmon_install utility,whichmustberunbeforeyouinstallGreenplumCommandCenterConsole,createsthegpmonrole.

GreenplumDatabaseusesthegpmonroletoupdatethegpperfmondatabasewithdatacollectedbyagentsrunningonthesegmenthosts.TheCommandCenterwebserverusesthegpmonroletoconnecttothegpperfmondatabaseaswellasdatabasesmonitoredbytheCommandCenter.

When gpperfmon_install createsthegpmonrole,itpromptsforapassword,whichitthenaddstothe .pgpass fileinthegpadminuser’shomedirectory.Theentryinthe .pgpass fileissimilartothefollowing:

*:5432:gpperfmon:gpmon:changeme

SeeThePasswordFile inthePostgreSQLdocumentationfordetailsaboutthe .pgpass file.

The .pgpass fileisrequiredontheGreenplumDatabasemasterhosttostartthegpperfmondatacollectionagents.IfyourunGreenplumCommandCenteronadifferenthost,youcancopythe .pgpass filetothathost,oryoucanruntheCommandCenter gpcc managementutilitywiththe -W optiontorequestpasswordentryeachtimeyoustartorstopCommandCenterorrequeststatus.

Inthe $MASTER_DATA_DIRECTORY/pg_hba.conf authenticationfile, gpperfmon_install createstheseentries:

localgpperfmongpmonmd5hostallgpmon127.0.0.1/28md5hostallgpmon::1/128md5

IfyouauthenticateuserswithKerberos,youcanalsosetupKerberosauthenticationforthegpmonroleontheGreenplummasterandstandbyhosts.KerberosauthenticationissupportedwithTCPconnectionsonly; local entriesuseLinuxsocketsandauthenticatewiththe .pgpass filepassword,evenifyouhaveenabledKerberosfor host entries.

ChangingthegpmonPasswordTochangethegpmonpassword,followthesesteps:

1. LogintoGreenplumDatabaseasasuperuserandchangethegpmonpasswordwiththe ALTERROLE command:

#ALTERROLEgpmonWITHENCRYPTEDPASSWORD'new_password';

2. OntheGreenplummasterhost,updatethepasswordinthe .pgpass fileinthegpadminhomedirectory( ~/.pgpass ).Replacetheexistingpasswordinthelineorlinesforgpmonwiththenewpassword.

*:5432:gpperfmon:gpmon:new_password

3. Ensurethatthe .pgpass fileisownedbygpadminandRW-accessiblebygpadminonly.

$chowngpadmin:gpadmin~/.pgpass$chmod600~/.pgpass

4. RestartGreenplumCommandCenterwiththe gpcc utility.

$gpccstop$gpccstart

AuthenticatinggpmonwithKerberosIfyouauthenticateGreenplumDatabaseandCommandCenteruserswithKerberos,youcanalsoauthenticatethegpmonuserwithKerberos.

Besuretoalsoupdatethe .pgpass fileonthestandbymasterhost.

©CopyrightPivotalSoftwareInc,2013-2019 47 6.0.0

Page 48: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ToprepareforinstallingCommandCenterwithKerberosauthentication,followthesesteps:

1. CreatethegpperfmondatabaseusingtheGreenplumDatabase gpperfmon-install managementutility.SeeCreatingthegpperfmonDatabase.

2. OntheKDC,createakeytabfilecontainingtheKerberosprincipalforthegpmonuser,justasyouwouldforanyKerberos-authenticatedclient.InstallthefileontheGreenplummasterandstandbyhosts.

3. Updatetheentriesforgpmoninthe $MASTER_DATA_DIRECTORY/pg_hba.conf filetousethe gss authenticationmethod.

hostallgpmon0.0.0.0/0gssinclude_realm=0krb_realm=GPDB.EXAMPLE.COM

Notethat local entriesin pg_hba.conf cannotbeauthenticatedwithKerberos.Ifthereisa local entryforthegpmonuser,itwillusethe .pgpass filetoauthenticatewiththedatabase.SeeThepg_hba.conffile inthePostgreSQLdocumentationforcomplete pg_hba.conf filedocumentation.

4. Logintothemasterhostasgpadminandauthenticatethegpmonuser.

$kinitgpmon

5. InstallGreenplumCommandCentertosetuptheKerberos-enabledCommandCenter.

©CopyrightPivotalSoftwareInc,2013-2019 48 6.0.0

Page 49: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

EnablingAuthenticationwithKerberosIfyouhaveenabledKerberosauthenticationforGreenplumDatabase,youcansetupGreenplumCommandCentertoacceptconnectionsfromKerberos-authenticatedusers.

GreenplumDatabaseandCommandCenterincludesupportfortheGenericSecurityServiceApplicationsProgramInterface(GSS-API)standard.Arelatedstandard,SimpleandProtectedGSS-APINegotiationMechanism(SPNEGO),describestheprotocolGSS-APIclientsandserversusetoagreeonthemethodofauthentication.

WithaSPNEGO-compliantwebapplicationsuchasCommandCenter,theclientandserveragreeontheauthenticationmethodontheclient’sinitialHTTPrequest.IfKerberosauthenticationisnotsupportedonbothendsoftheconnectiontheserverfallsbacktobasicauthentication,anddisplaysaloginformrequestingausernameandpassword.IfauserhasauthenticatedontheworkstationwithKerberosandhasavalidticketgrantingticket,thewebbrowserofferstheuser’scredentialtotheCommandCenterwebserver.AKerberos-enabledCommandCenterwebserverisconfiguredtohandletheauthenticateduser’sconnectionrequestinoneofthreemodes,calledstrict,normal,orgpmon-only.

StrictCommandCenterhasaKerberoskeytabfilecontainingtheCommandCenterserviceprincipalandaprincipalforeveryCommandCenteruser.Iftheprincipalintheclient’sconnectionrequestisinthekeytabfile,thewebservergrantstheclientaccessandthewebserverconnectstoGreenplumDatabaseusingtheclient’sprincipalname.Iftheprincipalisnotinthekeytabfile,theconnectionrequestfails.

NormalTheCommandCenterKerberoskeytabfilecontainstheCommandCenterprincipalandmaycontainprincipalsforCommandCenterusers.Iftheprincipalintheclient’sconnectionrequestisinCommandCenter’skeytabfile,itusestheclient’sprincipalfordatabaseconnections.Otherwise,CommandCenterusesthegpmonuserfordatabaseconnections.

gpmon-onlyCommandCenterusesthegpmondatabaseroleforallGreenplumDatabaseconnections.NoclientprincipalsarerequiredintheCommandCenter’skeytabfile.Thisoptioncanbeused,forexample,ifCommandCenterusersauthenticatewithActiveDirectoryandyoudonotwanttomaintainclientprincipalsinthekeytabfile.

IfyouhavesetupKerberosauthenticationforGreenplumDatabase,mostoftheconfigurationrequiredtoenableCommandCenterKerberosauthenticationhasbeendone.TheCommandCenterKerberosconfigurationbuildsupontheGreenplumDatabaseKerberossetup.

KerberosauthenticationcanbeenabledbyrespondingtopromptswhenyouinstallCommandCenter,oryoucanusethe gpcc--krbenable

commandto

enableKerberosafterCommandCenterhasbeeninstalled.

BeforeYouBeginKerberosauthenticationmustbeenabledforGreenplumDatabase.SeeUsingKerberosAuthentication forinstructions.Makesurethefollowingprerequisitesaremetbeforeyoucontinue:

The krb5-workstation packageandassociatedlibraries( libkrb5* )mustbeinstalledontheGreenplummasterhostandeachclientworkstation.

ThedateandtimeontheGreenplummasterhostandallclientworkstationsmustbesynchronizedwiththeKDC.

The krb5.conf configurationfilemustbethesameontheKDChost,theGreenplumDatabasemasterhost,andclientworkstations.

TheKDCdatabasemusthaveaserviceprincipalforGreenplumDatabase.ThedefaultservicenameforGreenplumDatabaseispostgres/<master-host>@<realm> .Youcanchooseaservicenameotherthan postgres ,butitmustmatchthevalueofthe krb_srvnameparameterinthe $MASTER_DATA_DIRECTORY/postgresql.conf file.

AkeytabfilewiththeGreenplumDatabaseprincipalmustbeinstalledontheGreenplummasterhostandidentifiedbythe krb_server_keyfileparameterinthe $MASTER_DATA_DIRECTORY/postgresql.conf file.

EachclientworkstationcanhaveakeytabfilecontainingtheirKerberosprincipal, <username>@<realm> .

AddCommandCenterPrincipalstotheKDCDatabaseBeforeyouconfigureCommandCenterforKerberosauthentication,youmustcreatetherequiredKerberosprincipals.AlloftheprincipalsusedwithCommandCenterarecreatedintheGreenplumDatabaseKerberosrealm.CommandCenteruserscanusethesameKerberosprincipaltoauthenticatewithCommandCenterandGreenplumDatabase.

CommandCenterServicePrincipal

©CopyrightPivotalSoftwareInc,2013-2019 49 6.0.0

Page 50: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AserviceprincipalisneededfortheCommandCenterwebserver.Thisprincipalhastheformat HTTP/<host>@<realm> .Forexample,ifusersaccessCommandCenterattheURL http://mdw.example.com:28080 ,the <host> partoftheservicekeyis mdw.example.com andthe <realm> partistheGreenplumDatabaseKerberosrealm,forexample GPDB.KRB .

NotethatKerberosauthenticationonlyworksifCommandCenterusersenterthehostinthesameformatspecifiedintheKerberosserviceprincipal.IftheprincipalspecifiestheFQDN,forexample,usingthehost’sIPaddressinthebrowserURLwillnotwork;thewebserverwillfallbacktobasicauthentication.

GreenplumDatabasegpmonUser

CommandCenterusesthegpmonGreenplumroletoaccessthegpperfmondatabase,whichcontainsdatapresentedintheCommandCenterUI.

YoucanchoosetoauthenticatethegpmonuserwithKerberosorwithbasicauthentication.TouseKerberos,youmustcreateaprincipalforthegpmonuser.

IfyouchoosetousebasicauthenticationyoudonotneedaKerberosprincipalforthegpmonuser.ThegpmonuserwillauthenticatewithGreenplumDatabaseusingthepasswordsavedinthe .pgpass fileinthegpadminuser’shomedirectoryonthehostrunningCommandCenter.IfyourunCommandCenteronahostotherthantheGreenplumDatabasemasterhost,youmustcopythe .pgpass filefromthemasterhosttotheCommandCenterhost.SeeChangingthegpmonPassword forinstructionstomanagethegpmonpassword.

CommandCenterUsers

AddKerberosprincipalsforanyCommandCenteruserswhodonotalreadyhaveprincipalsintheKDCforGreenplumDatabase.

AddingKerberosPrincipalsToaddtherequiredprincipals,performthefollowingstepsasrootontheKDCserver.

1. AddaprincipalfortheCommandCenterwebservice.Besuretospecifythe <gpcc-host> inthesameformatthatusersshouldenterthehostintheirbrowsers.

#kadmin.local-q"addprinc-randkeyHTTP/<gpcc-host>@<realm>"

2. IfyouwantthegpmondatabaseusertouseKerberosauthentication,addagpmonprincipal.

#kadmin.local-q"addprincgpmon@<realm>"

3. AddprincipalsforanynewCommandCenterusers.

#kadmin.local-q"addprinccc_user1@<realm>"

RepeatforeachnewCommandCenteruser.

SetUpKeytabFilesAfteryouhavecreatedalloftheKerberosprincipalsneeded,youcreateanddistributekeytabfiles.KeytabfilescontainKerberosprincipalsandencryptedkeysbasedontheprincipals’Kerberospasswords.KeytabfilesareneededfortheGreenplumDatabasemasterandstandbyhostsandtheCommandCenterhost.

YoucanalsocreateakeytabfileforeachGreenplumDatabaseorCommandCenterusercontainingjusttheuser’sprincipal.Thiskeytabfileisinstalledontheuser’sworkstationtoenabletheusertoauthenticatetoKerberos.Notethatallkeytabfilesmustcontainthemostrecentversionsoftheprincipals’keys.

CommandCenterRunningontheGreenplumMasterHostIftheGreenplumCommandCenterwebserverisrunningontheGreenplumDatabasemasterhost,CommandCentercansharetheGreenplumDatabasekeytabfile.Youneedtocreateakeytabfilethatcontainsthefollowingprincipals:

Servicekeyforthe postgres processontheGreenplumDatabasemasterhost,forexample postgres/[email protected] .

ServicekeycreatedforCommandCenterintheprevioussection,forexample HTTP/[email protected].

©CopyrightPivotalSoftwareInc,2013-2019 50 6.0.0

Page 51: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AprincipalforeveryKerberos-authenticatedGreenplumDatabaseorCommandCenteruser.

AllservicekeysandprincipalsshouldbeintheGreenplumDatabaserealm.

TocreateakeytabfileforGreenplumDatabaseandCommandCenter,performthefollowingstepsasrootontheKDCserver.

1. CreateakeytabfilecontainingtheGreeplumDatabaseservicekey,thecommandcenterservicekey,andalldatabaseandCommandCenterusers.

kadmin.local-q"ktadd-kgpdb-kerberos.keytabpostgres/[email protected]/[email protected]"

Youcanenteroneormoreprincipalswitheach ktadd command.Youcanspecifyawildcardusingthe -glob option.Forexamplethiscommandaddsallprincipalsinthe GPDB.KRB realm,includingserviceprincipalsandadminusers.

kadmin.local-q"ktadd-kgpdb-kerberos.keytab-glob*@GPDB.KRB"

2. CopythekeytabyoucreatedtotheGreenplumDatabasemasterhost,replacingtheoldkeytabfile.Thelocationofthefileisgivenbythekrb_server_keyfile parameterinthe $MASTER_DATA_FILE/postgresql.conf file.Setthepermissionsonthefilesothatitcanbereadonlybythegpadminuser.

3. UpdateanyentriesrequiredfornewGreenplumDatabaseprincipalsinthe pg_hba.conf fileand pg_ident.conf files.SeeUpdatetheGreenplumDatabase pg_hba.conf Filefordetails.

CommandCenterRunningontheStandbyMasterIftheCommandCenterwebserverisonadifferenthostthantheGreenplumDatabasemaster,youneedseparatekeytabfilesforGreenplumDatabaseandCommandCenter.ThekeytabfileforGreenplumDatabasemaynotrequireanyupdates,butyouwillneedtocreateakeytabfileforCommandCenter.

TheGreenplumDatabasekeytabfilemustcontaintheGreenplumDatabaseservicekeyandallprincipalsforuserswithdatabaseaccess.

TheCommandCenterkeytabfilecontainstheCommandCenterservicekeyandprincipalsforusersthathaveCommandCenteraccess.UserswithCommandCenteraccessmustalsohaveGreenplumDatabaseaccess,souserprincipalsintheCommandCenterkeytabfilemustalsobeintheGreenplumDatabasekeytabfile.

UpdatetheGreenplumDatabasekeytabifyoucreatednewdatabaserolesandprincipalsforCommandCenter.Forexample,ifyouwanttouseKerberosauthenticationforthegpmonuser,youmustcreateaprincipalandaddittoboththeGreenplumDatabaseandCommandCenterkeytabfiles.

TocreatethekeytabfileforCommandCenter,performthefollowingstepsasrootontheKDChost.

```

1. CreateakeytabfileandaddtheCommandCenterservicekey.

kadmin.local-q"ktadd-kgpcc-kerberos.keytabHTTP/[email protected]"

2. IfyouwanttoauthenticatethegpmonuserwithKerberos,addthegpmonprincipal.

kadmin.local-q"[email protected]"

3. AddprincipalsforallCommandCenterusers:

kadmin.local-q"[email protected][email protected]"

Youcanenteroneormoreprincipalswitheach ktadd command.

4. Enter quit toexit kadmin.local .

5. CopythekeytabyoucreatedtothethehostrunningCommandCenter,forexample:

$scpgpcc-kerberos.keytabgpadmin@<host-name>:/home/gpadmin

6. Updateanyentriesrequiredfornewprincipalsinthe pg_hba.conf fileand pg_ident.conf filesontheGreenplummaster.SeeUpdatetheGreenplumDatabasepg_hba.confFile.

©CopyrightPivotalSoftwareInc,2013-2019 51 6.0.0

Page 52: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

UpdatetheGreenplumDatabasepg_hba.confFileTheGreenplumDatabase $MASTER_DATA_DIRECTORY/pg_hba.conf configurationfiledetermineswhichauthenticationmethodstousetoallowdatabaseaccess.

IfyoucreatednewCommandCenterusers,youmayneedtoaddanentrytoallowaccessviaCommandCenter.Theentryforanindividualuserhasthisformat:

hostdatabase<user-name><gpccCIDR>gss[options]

Authenticationforthegpmonuserneedstobesetupinthe pg_hba.conf fileinoneofthefollowingways.

Basicauthentication

The /home/gpadmin/.pgpass filecontainsthepasswordforgpmontouse.SeeChangingthegpmonPassword fordetails.Anentryinthe pg_hba.conffilespecifiesthemd5authenticationmethodforgpmon:

localallgpmonmd5

Trustauthentication

OntheGreenplumDatabasemasterhostonly,thegpmonusercanaccessdatabaseswithoutauthentication:

localallgpmontrust

The /home/gpadmin/.pgpass fileisnotneeded.

Kerberosauthentication

AKerberosprincipalhasbeencreatedforthegpmonuserandaddedtotheGreenplumDatabaseandCommandCenterkeytabfiles.

hostallgpmon<gpccCIDR>gss[options]

Removeanyexistingrejectrulesforgpmon:

hostallgpmon<auth-method>reject

SeeUsingKerberosAuthentication formoreinformationaboutthe pg_hba.conf file.

EnableKerberosforCommandCenterSetupCommandCentertousetheCommandCenterkeytabfileyoucreated.

IfyouareaddingKerberosauthenticationtoanexistingCommandCenter,usethe gpcc command.Forexample:

$gpcc--krbenable

EntertheCommandCenterhostnameandpathtothekeytabfileattheprompts.SeethegpccReferenceformoreinformation.

AuthenticatingWithKerberosontheClientWorkstationTouseKerberosCommandCenterauthentication,theusermusthaveauthenticatedwithKerberosusingthe kinit command-linetool.

TheuserthenaccessestheCommandCenterwebserverwithaURLcontainingthehostnameintheformatspecifiedintheCommandCenterserviceprincipalandtheportnumber,forexample http://mdw.example.com:28080 .

Theuser’swebbrowsermustbeconfiguredtousetheSPNEGOprotocolsothatitofferstheuser’sKerberosprincipaltothewebbrowser.Themethodforconfiguringwebbrowsersvarieswithdifferentbrowsersandoperatingsystems.SearchonlinetofindinstructionstoenableSPNEGOwithyourbrowserandOS.

©CopyrightPivotalSoftwareInc,2013-2019 52 6.0.0

Page 53: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

©CopyrightPivotalSoftwareInc,2013-2019 53 6.0.0

Page 54: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

MonitoringtheGreenplumDatabaseSystemDashboard

ClusterState

SegmentStatus

ClusterMetrics

HostMetrics

StorageStatus

©CopyrightPivotalSoftwareInc,2013-2019 54 6.0.0

Page 55: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

DashboardTheDashboarddisplayswhenyoufirstsignintoPivotalGreenplumCommandCenter.TheDashboardprovidesaquickviewofthecurrentsystemstatus,SegmentHealth,Queries,CPU,Memory,andDiskusage.

Clickingonapanelprovidesmoredetailedinformationaboutthemetric.TheAlertspanelshowsthemostrecentmessagesfromtheGreenplumDatabaselogfile.SomeinformationisavailableonlytoCommandCenteruserswithAdminorOperatorpermissionlevel.

SystemInformationThefollowingsysteminformationisdisplayedatthetopofthepage.

UptimeTheelapsedtimesincetheGreenplumDatabasesystemwaslaststarted.

GPDBVersionTheversionoftheGreenplumDatabasesoftwarethemonitoredclusterisrunning.

GPCCVersionTheversionoftheGreenplumCommandCentersoftware.

ConnectionsThenumberofactiveGreenplumDatabasesessions(clientconnections).

ServerThedisplaynameforthisGreenplumCommandCenter.

LastSyncDateandtimethedatawaslastsynchronized.TheCommandCenteruserinterfaceupdatesviewswithlivedataevery15seconds.

SegmentHealthTheSegmentHealthsectionoftheDashboardprovidesaquickoverviewofthestatusofthedatabasesystemandsegmentsthisCommandCentermonitors.

DatabaseState

©CopyrightPivotalSoftwareInc,2013-2019 55 6.0.0

Page 56: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

DatabaseStateisthecurrentstateoftheGreenplumDatabasesystem.Followingaresomepossibledatabasestates:

Normal:Thedatabaseisfunctioningwithnomajorerrorsorperformanceissues.

Segment(s)Down:Thedatabaseisinchange-trackingmodeorresyncmode.Overallperformanceandsystemreliabilityisgreatlyreduced.SeethePivotalGreenplumDatabaseSystemAdministratorGuideforinformationaboutresolvingthiscondition.

StandbyDown:Themasterstandbyinstancecannotbereached.

DatabaseUnreachable:TheGreenplumPerformanceMonitoragentcannotconnecttothedatabase.Thedatabaseislikelydown.SeethePivotalGreenplumDatabaseSystemAdministratorGuidefortroubleshootinginformation.

Unbalanced:Somesegmentsarenotrunningintheirpreferredroles.Thatis,primariesarerunningasmirrorsandmirrorsarerunningasprimaries,resultinginunbalancedprocessing.

Resyncing:Thedatabaseisperformingarecoveryorrebalanceoperation.

SegmentStatusThebargraphintheSegmentStatussectionshowstheupordownstatusofalldatabasesegmentsinyourPivotalGreenplumDatabasesystem.Acolorindicatorandassociatednumberindicatethenumberofdatabasesegmentsthatarecurrentlyinthatparticularstate.Segmentscanhavethefollowingstates:

Up(Green)

Down(Red)

ClickingtheSegmentStatuspaneldisplaystheSegmentStatusCommandCenterpage.

DiskUsageSummaryThischartdisplaystotaldiskusageanddiskavailablefortheGreenplummasterhostandsegmenthostsatthelastsynchronization.Hoveroverthecharttoseetheamountofdiskused,free,andtotal.

QueriesThisgraphdisplaysasummaryviewofactiveandqueuedqueriesforthelast60minutes.ClickonthecoloreddotnexttotheRunningorQueuedlabeltotogglethelineonoroff.Atleastonelinemustbevisibleatalltimes.Hoveroverthegraphtodisplaythenumberofqueriesforeachvisiblelineatthatpointintime.

CPUThisgraphdisplaysaverageCPUusageacrosstheentirecluster,forthelast60minutes.Thegraphdisplaysseparatelinesforsystemprocessesanduserprocesses.TheuserCPUusageincludestheGreenplumdatabasemaster,standby,andsegmentprocesses.ClickonthecoloreddotnexttotheSystemorUserlabeltotogglethatlineonoroff.Atleastonelinemustbevisibleatalltimes.

HoveringthecursoroveralineinthegraphdisplaysasmallwindowwiththepercentageofCPUusedatthatpointintimeforthevisiblelinesandthetotalifboththesystemanduserlinesarevisible.

MemoryThisgraphdisplaystheaveragepercentofmemoryusedacrosstheentireclusteroverthelast60minutes.Hoveroverthelinetodisplaythepercentofmemoryusedatthatpointintime.

Anerrormessageorstateotherthantheabovemaybeanindicationofanetworkconnectivityproblem,orofanotherundetectedproblemintheGreenplumDatabasesystem.Runthe`gpstate`utilityonthemasterhosttodetermineifthereareissuestotroubleshootintheGreenplumDatabasesystem.

©CopyrightPivotalSoftwareInc,2013-2019 56 6.0.0

Page 57: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AlertsAdminandOperatorpermissionlevelsonly

TheAlertspaneldisplaysrecentmessagesfromtheGreenplumDatabase pg_log logfile.Thepanelisupdatedateachsynchronization.Filterthemessagesbyseveritylevelusingthecontrolsatthetoprightofthepanel.

©CopyrightPivotalSoftwareInc,2013-2019 57 6.0.0

Page 58: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

GreenplumDatabaseClusterStateTheGreenplumCommandCenterDashboardprovidesaquickviewofthecurrentsystemstatus,SegmentHealth,Queries,CPU,Memory,andDiskusage.Clickingonapanelprovidesmoredetailedinformationaboutthatmetric.TheAlertspanelshowsthemostrecentmessagesfromtheGreenplumDatabaselogfile.SomeinformationisavailableonlytoCommandCenteruserswithAdminorOperatorpermissionlevel.

SystemInformationThefollowingsysteminformationisdisplayedatthetopofthepage.

UptimeTheelapsedtimesincetheGreenplumDatabasesystemwaslaststarted.

GPDBVersionTheversionoftheGreenplumDatabasesoftwarethemonitoredclusterisrunning.

GPCCVersionTheversionoftheGreenplumCommandCentersoftware.

ConnectionsThenumberofactiveGreenplumDatabasesessions(clientconnections).

ServerThedisplaynameforthisGreenplumCommandCenter.

LastSyncDateandtimethedatawaslastsynchronized.TheCommandCenteruserinterfaceupdatesviewswithlivedataevery15seconds.

SegmentHealthTheSegmentHealthsectionoftheDashboardprovidesaquickoverviewofthestatusofthedatabasesystemandsegmentsthisCommandCentermonitors.

DatabaseStateDatabaseStateisthecurrentstateoftheGreenplumDatabasesystem.Thestatecanbeoneofthefollowing:

©CopyrightPivotalSoftwareInc,2013-2019 58 6.0.0

Page 59: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Normal:Thedatabaseisfunctioningwithnomajorerrorsorperformanceissues.

Segment(s)Down:Thedatabaseisinchange-trackingmodeorresyncmode.Overallperformanceandsystemreliabilityisgreatlyreduced.SeethePivotalGreenplumDatabaseSystemAdministratorGuideforinformationaboutresolvingthiscondition.

DatabaseUnreachable:TheGreenplumPerformanceMonitoragentcannotconnecttothedatabase.Thedatabaseislikelydown.SeethePivotalGreenplumDatabaseSystemAdministratorGuidefortroubleshootinginformation.

Unbalanced:Somesegmentsarenotrunningintheirpreferredroles.Thatis,primariesarerunningasmirrorsandmirrorsarerunningasprimaries,resultinginunbalancedprocessing.

Resyncing:Thedatabaseisperformingarecoveryorrebalanceoperation.

SegmentStatusThebargraphintheSegmentStatussectionshowstheupordownstatusofalldatabasesegmentsinyourPivotalGreenplumDatabasesystem.Acolorindicatorandassociatednumberindicatethenumberofdatabasesegmentsthatarecurrentlyinthatparticularstate.Segmentscanhavethefollowingstates:

Up(Green)

Down(Red)

ClickingtheSegmentStatuspaneldisplaystheSegmentStatusCommandCenterpage.

DiskUsageSummaryThischartdisplaystotaldiskusageanddiskavailablefortheGreenplummasterhostandsegmenthostsatthelastsynchronization.Hoveroverthecharttoseetheamountofdiskused,free,andtotal.

QueriesThisgraphdisplaysasummaryviewofactiveandqueuedqueriesforthelast60minutes.ClickonthecoloreddotnexttotheRunningorQueuedlabeltotogglethelineonoroff.Atleastonelinemustbevisibleatalltimes.Hoveroverthegraphtodisplaythenumberofqueriesforeachvisiblelineatthatpointintime.

CPUThisgraphdisplaysaverageCPUusageacrosstheentirecluster,forthelast60minutes.Thegraphdisplaysseparatelinesforsystemprocessesanduserprocesses.TheuserCPUusageincludestheGreenplumdatabasemaster,standby,andsegmentprocesses.ClickonthecoloreddotnexttotheSystemorUserlabeltotogglethatlineonoroff.Atleastonelinemustbevisibleatalltimes.

HoveringthecursoroveralineinthegraphdisplaysasmallwindowwiththepercentageofCPUusedatthatpointintimeforthevisiblelinesandthetotalifboththesystemanduserlinesarevisible.

MemoryThisgraphdisplaystheaveragepercentofmemoryusedacrosstheentireclusteroverthelast60minutes.Hoveroverthelinetodisplaythepercentofmemoryusedatthatpointintime.

AlertsAdminandOperatorpermissionlevelsonly

TheAlertspaneldisplaysrecentmessagesfromtheGreenplumDatabase pg_log logfile.Thepanelisupdatedateachsynchronization.Filterthemessagesbyseveritylevelusingthecontrolsatthetoprightofthepanel.

©CopyrightPivotalSoftwareInc,2013-2019 59 6.0.0

Page 60: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

©CopyrightPivotalSoftwareInc,2013-2019 60 6.0.0

Page 61: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SegmentStatusTheSegmentStatuspageprovidesahealthoverviewfortheGreenplumDatabasesegmentsanddetailsforeachprimaryandmirrorsegment.

SegmentSummaryGreenplumDatabaseismostefficientwhenallsegmentsareoperatingintheirpreferredroles.TheSegmentSummarypaneltellsyoutheoverallsegmentstatusandifanymirrorsareactingasprimaries.

TheSegmentSummarypanelprovidesthefollowinginformation:

DatabaseStateThedatabasestatecanbeoneofthefollowing:

Normal:Thedatabaseisfunctioningwithnomajorerrorsorperformanceissues.

Segment(s)Down:Thedatabaseisinchange-trackingmodeorresyncmode.Overallperformanceandsystemreliabilityisgreatlyreduced.SeethePivotalGreenplumDatabaseSystemAdministratorGuideforinformationaboutresolvingthiscondition.

DatabaseUnreachable:TheGreenplumPerformanceMonitoragentcannotconnecttothedatabase.Thedatabaseislikelydown.SeethePivotalGreenplumDatabaseSystemAdministratorGuidefortroubleshootinginformation.

Unbalanced:Somesegmentsarenotrunningintheirpreferredroles.Thatis,primariesarerunningasmirrorsandmirrorsarerunningasprimaries,resultinginunbalancedprocessing.

Resyncing:Thedatabaseisperformingarecovertyorrebalanceoperation.

MirrorsActingasPrimaryThenumberofmirrorsegmentsactingasprimarysegments.

RecommendedActionsSuggestsactionstoperformtorestoretheclustertobalance.Theseinclude:

RecoverandRebalance

Rebalance

Theseactionsareexecutedfromthecommandlineusingthe gprecoverseg Greenplummanagementutility.See gprecoverseg inthePivotalGreenplumDatabaseUtilityReferenceformoreinformation.

©CopyrightPivotalSoftwareInc,2013-2019 61 6.0.0

Page 62: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

TotalSegmentsThetotalnumberofprimaryandmirrorsegmentsintheGreenplumcluster.

SegmentHostsThetotalnumberofsegmenthostsintheGreenplumcluster.

SegmentHealthTheSegmentHealthpanelcontainschartsforGreenplumDatabasesegments’status,replicationmode,andpreferredroles.

StatusNumbersofsegmentsthataredownandup.

ReplicationModeAchartthatshowsthenumberofsegmentsineachofthepossiblereplicationmodes.

NotSyncing:Theprimarysegmentandmirrorsegmentareactiveandallchangestotheprimarysegmenthavebeencopiedtothemirrorusingafileblockreplicationprocess.

ChangeTracking:Ifaprimarysegmentisunabletocopychangestoitsmirrorsegmentusingthefilereplicationprocess,itlogstheunsentchangeslocallysotheycanbereplicatedwhenthemirroragainbecomesavailable.Thiscanhappenifamirrorsegmentgoesdownorifaprimarysegmentgoesdownanditsmirrorsegmentautomaticallyassumestheprimaryrole.

Resyncing:Whenadownsegmentisbroughtbackup,administratorsinitiatearecoveryprocesstoreturnittooperation.Therecoveryprocesssynchronizesthesegmentwiththeactiveprimaryandcopiesthechangesmissedwhilethesegmentwasdown.

Synced:Onceallmirrorsandtheirprimariesaresynchronized,thesystemstatebecomessynchronized.

PreferredRolesTheredportionofthePreferredRolechartshowsthenumbersofsegmentsthatnotoperatingintheirpreferredprimaryormirrorroles.Ifthechartisnotsolidgreen,theperformanceoftheGreenplumclusterisnotoptimal.

Primaryandmirrorsegmentsaredistributedevenlyamongthesegmenthoststoensurethateachhostperformsanequivalentshareoftheworkandprimarysegmentsandtheirmirrorsegmentsresideondifferentsegmenthosts.Whenaprimarysegmentgoesdown,itsmirroronanotherhostintheclusterautomaticallyassumestheprimaryrole,increasingthenumberofprimarysegmentsrunningonthathost.Thisunevendistributionoftheworkloadwillaffectqueryperformanceuntilthedownsegmentisrestoredandthesegmentsarereturnedtotheiroriginal,preferred,roles.

SegmentTableThetableatthebottomoftheSegmentStatuspagecontainsadetailedrowforeveryprimaryandmirrorsegmentintheGreenplumCluster.Thetablehasthefollowingcolumnsforeachsegment:

HostnameThenameofthesegmenthostwherethesegmentisrunning.

AddressThenetworkinterfaceonthesegmenthostforthesegment.

PortTheportnumberassignedtothesegment.

DBIDTheuniqueidentifierforthesegmentinstance.

ContentIDThecontentidentifierforthesegment,from0tothenumberofsegmentsminus1.AprimarysegmentanditsmirrorhavethesameContentID.Themasterandstandbymaster,whichhaveContentID−1,areexcludedfromthetable.

Status“UP”ifthesegmentisrunning,“DOWN”ifthesegmenthasfailedorisunreachable.

RoleThesegment’scurrentrole,either“primary”or“mirror”.

©CopyrightPivotalSoftwareInc,2013-2019 62 6.0.0

Page 63: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

PreferredRoleThesegment’sintendedrole,either“primary”or“mirror”.

ReplicationModeThereplicationstatusforthesegment.SeeSegmentHealthforpossiblevalues.

LastEvent|[Total]Thedateandtimeoflastsegmenthealth-relatedactivity.Clicktodisplayalistofrecentevents.

©CopyrightPivotalSoftwareInc,2013-2019 63 6.0.0

Page 64: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ClusterMetricsTheClusterMetricspageshowsconsolidatedstatisticsforallsegmenthostsintheGreenplumcluster.Masterandstandbymasterhostsareexcludedfromthemetrics.

Thechartsdisplaymetricsforthelasttimeperiodsetbythecontrolinthetoprightcornerofthescreen.

UsetheShow/hideChartscontroltochoosewhichmetricstodisplay.

Hoveroveranyofthechartstoseevaluesforthemetricsatapointintimeinpop-upboxes.Thechartsaresynchronizedsothathoveringoveranychartshowsthesamepointintimeinallcharts.

Thecurrentvalueofametricisshownintheupperrightcornerofitschart.

Onchartswithmultiplemetrics,togglethedisplayforalineonoroffbyclickingtheline’slabelinthelegendatthetoprightofthechart.Atleastonelinemustbedisplayed.Alllinesareredisplayedatthenextquantuminterval.

Thepagehaschartsforthefollowingmetrics:

QueriesThenumberofqueriesrunningandthenumberofqueriesqueuedtorun.

CPUThepercentageCPUusedbysystemprocessesandthepercentageCPUusedbyuserprocesses.

MemoryPercentageofmemoryinuse.

Memoryiscalculatedasfollows:

Total=MemTotalFree=MemFree+Buffers+CachedUsed=MemTotal-Free

DiskI/ODiskreadandwriteratesinmegabytespersecond.

NetworkNetworkI/Oreadandwriteratesinmegabytespersecond.NetworkmetricsincludetrafficoverallNICs(networkinterfacecards),includinginternalinterconnectandadministrativetraffic.

LoadSystemloadaveragefor1-minute,5-minute,and15-minuteperiods.

SwapPercentageofswapspaceused.

©CopyrightPivotalSoftwareInc,2013-2019 64 6.0.0

Page 65: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

HostMetricsTheHostMetricspagedisplaysatableofthehostsintheclusterwithstatisticscollectedatthemostrecentquantuminterval.

Atthetop,LastSyncdisplaysthetimethestatisticswerelastupdated.

Clickacolumnheadertosortthetablebythatcolumn.Clickagaintotogglebetweenascendinganddescendingsort.Masterandstandbyhostsarenotincludedinthesortandarealwaysdisplayedfollowingthesortedlistofsegmenthosts.

Foreachserver,thefollowingcolumnsaredisplayed:

HostnameThehostnamenameoftheserver.

CPUTotal/Sys/User(%)ThetotalpercentageofCPUinuseisdisplayednexttoagraphillustratingtheCPUusedforsystemanduserprocesses.HoveroverthetablecelltoshowthepercentagesusedforsystemanduserprocessesandthepercentageCPUidle.

MemoryInUse(%)Thepercentageofhostmemoryinuseisdisplayednexttoagraphillustratingthememoryinuseandavailable.Hoveroverthetablecelltoseememoryusedandavailableingigabytes.

Memoryiscalculatedasfollows:

Total=MemTotalFree=MemFree+Buffers+CachedUsed=Total-Free

DiskR(MB/s)|SkewDiskreadrateinmegabytespersecondisdisplayednexttoagraphofcalculateddiskreadskew.HoveroverthetablecelltoseeaLow/Medium/Highratingfordiskskew.

DiskW(MB/s)|SkewDiskwriterateinmegabytespersecondisdisplayednexttoagraphofcalculateddiskwriteskew.HoveroverthetablecelltoseeaLow/Medium/Highratingfordiskwriteskew.

NetR(MB/s)|SkewNetworkreadrateinmegabytespersecondisdisplayednexttoagraphofcalculatednetworkreadskew.HoveroverthetablecelltoseeaLow/Medium/Highratingfornetworkreadskew.

NetW(MB/s)|SkewNetworkwriterateinmegabytespersecondisdisplayednexttoagraphofcalculatednetworkwriteskew.HoveroverthetablecelltoseeaLow/Medium/Highratingfornetworkwriteskew.

AboutSkewCalculations

©CopyrightPivotalSoftwareInc,2013-2019 65 6.0.0

Page 66: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

DiskandNetworkskewratingsarecalculatedaseachserver’sstandarddeviationfromthemeancalculatedfromallsegmenthosts.

LowValueiswithin1standarddeviationfromthemean.(Note:ifthevarianceofthesetislessthan3,skewisconsideredlowregardlessofdeviationfrommean.)

ModerateValueisbetween1and2standarddeviationsfromthemean.

VeryHighValueisgreaterthan3standarddeviationsfromthemean.

©CopyrightPivotalSoftwareInc,2013-2019 66 6.0.0

Page 67: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

StorageStatusTheStorageStatuspageshowscurrenthistoricaldiskusageforGreenplummasterandsegmenthosts.

DiskUsageSummaryYoucanseecurrentdiskspaceinuse,spacefree,andtotalspaceintheDiskUsageSummarypanel.Diskspacemetricsforthesegmenthosts(GPSegments)andthemaster(GPMasters)areshowninseparatebarcharts.

TheGPSegmentsbarchartshowscombineddiskspaceforallsegments.

TheGPMastersbarchartshowscombineddiskspaceformasterandstandbymaster.

Clickeitherofthesummarychartstoseedetailsbyhost:spaceused,free,andtotalingigabytesandasapercentageofthetotal.ClickahostnametoseedetailsforeachfilesystemonthehostthathasoneormoreGreenplumDatabasedatadirectories.

GPSegmentsUsageHistoryTheGPSegmentsUsageHistorypanelpresentsachartofpercentageofdiskspaceinuseforthetimeperiodsetbythecontrolinthepanelheader.

HoveroverthecharttoseethepercentagediskinusebyallGreenplumDatabasesegmentsatanygivenpointintime.

GPMastersUsageHistoryTheGPMastersUsageHistorypanelpresentsachartofpercentageofdiskspaceinusebythemasterandstandbymastersforthetimeperiodsetbythecontrolinthepanelheader.

Hoveroverthecharttoseethepercentagediskinuseatanygivenpointintime.

©CopyrightPivotalSoftwareInc,2013-2019 67 6.0.0

Page 68: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

MonitoringandManagingGreenplumDatabaseQueriesQueryMonitor

QueryDetails

QueryHistory

©CopyrightPivotalSoftwareInc,2013-2019 68 6.0.0

Page 69: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

QueryMonitorTheQueryMonitorviewallowsyoutoviewinformationforallGreenplumDatabaseserverqueries,includingdetailsaboutqueriesrunning,queuedtorun,andblockedbyotherqueries.UserswithAdminorOperatorpermissioncanseeandcancelallusers’queries.

IfaCommandCenteradministratorhasenabledQueryMonitorGuestAccess,anyoneabletoaccesstheCommandCenterwebservercanviewthesystemstatusandquerylistonthispagewithoutsigningintoCommandCenter.Anonymoususers,however,cannotcancelqueriesoraccessanyotherCommandCenterfeatures.

Withtheinformationavailableinthisview,GreenplumDatabaseadministratorscaneasily:

Understandhowthesystemisbeingused—bothinreal-timeandtrendingovertime.

Identifyanddiagnoseproblemquerieswhiletheyarerunning,detectskew,findrunawayqueries,andsoon.

Reviewandbalancethequeryloadonthesystembybetteroptimizingandschedulingthequeryload.

Cancelqueriesthatdisruptsystemperformance.

QueryMetricsTheQueryMonitortabledisplaysthefollowingcolumnsforqueries.

QueryIDAnidentificationstringforthequery.Ifthecolumnisblank,noqueryIDhasbeenassignedyet.IntheConsole,thislookslike“1295397846-56415-2”.CommandCentergeneratesthisIDbycombiningthequeryrecord’s tmid , ssid ,and ccnt fields.

tmid isatimeidentifierforthequery.

ssid isthesessionid.

ccnt isthenumberofthecommandwithinthesession.

Status

©CopyrightPivotalSoftwareInc,2013-2019 69 6.0.0

Page 70: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Thestatusofthequery.Thiscanbeoneofthefollowing:

Queued:thequeryhasnotyetstartedtoexecute

Running:executionhasstarted,butisnotyetcomplete

Blocked:thequeryiswaitingforoneormoreotherqueriestoreleaselocks

Done:completedsuccessfully

Cancelling:cancelrequestsent,cancelpending

Cancelled:terminated,nolongerrunning

IdleTransaction:thetransactionisopen,butidle,forexample,waitingwhileauserinaninteractivesessionentersastatement

UserTheGreenplumDatabaserolethatsubmittedthequery.

DatabaseThenameofthedatabasethatwasqueried.

WorkloadTheresourcegrouporresourcequeuethatismanagingthequery.

SubmittedThetimethequerywassubmittedtothequeryplanner.

QueuedTimeTheamountoftimethequeryhasbeen(orwas)inqueueawaitingexecution.

RunTimeTheamountoftimesincequeryexecutionbegan.

SpillFilesThetotalsizeofspillfilescreatedforthequery.GreenplumDatabasecreatesspillfileswhenthereisinsufficientmemorytotoexecutethequeryinmemory.SeeManagingSpillFilesGeneratedbyQueries forinformationaboutspillfiles.

BlockedbyShowsthenumberoflocksblockingthequery.Hoveroverthecolumntodisplaydetailsofthelocks.Thetipshowsthetypeofeachlock,theIDofthetransactionorquerythatholdsthelock,theGreenplumDatabaseroleholdingthelock,andtheamountoftimethequeryhasbeenblocked.

UsingtheQueryMonitorControlsClickacolumnheadingtosorttherowsonthatcolumninascendingordescendingorder.

Clickthecheckboxattheleftofarowtochooseaquerytocancelorexport.Clickthecheckboxintheheadingrowtochooseallqueries.

ClickCancelQuerytocancelselectedqueries.

ClickExporttodownloadacomma-separatedvalues(CSV)textfilecontainingrowsfortheselectedqueries.Whennoqueriesareselected,allrowsareexported.Thedefaultfilenameis spreadsheet.csv .

ClickanyqueryIDtoseetheQueryDetails,includingmetrics,thetextofthequery,andthequeryplan.

©CopyrightPivotalSoftwareInc,2013-2019 70 6.0.0

Page 71: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

QueryDetailsTheQueryDetailsviewdisplaysquerymetrics,thetextofthequery,andthequeryplanandprogressforasinglequeryselectedfromtheQueryMonitorview.

QueryExecutionMetricsTheQueryID,executionstatus,andruntimeofthequeryaredisplayedatthetop.

Thefollowingmetricsaredisplayedforthequery.

UserTheGreenplumDatabaserolethatsubmittedthequery.

DatabaseThenameofthedatabasethatwasqueried.

WorkloadThenameoftheresourcegrouporresourcequeuethatismanagingthequery.

PlannerThenameofthequeryplannerusedforthisquery,GPORCAorLegacy.

©CopyrightPivotalSoftwareInc,2013-2019 71 6.0.0

Page 72: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SubmittedThetimethequerywassubmittedtothequeryplanner.

QueuedTimeTheamountoftimethequeryhasbeen(orwas)inqueueawaitingexecution.

RunTimeTheamountoftimesincequeryexecutionbegan.

Est.ProgressAnestimateofthepercentageofthequeryexecutioncompleted.TheestimateiscalculatedfromrowcountandcostestimatesgeneratedbyeithertheGPORCAorlegacyplannerfortheparticularqueryandtheavailablestatistics.Theestimatedoesnotaccountforthemanyotherfactorsthatcanaffectqueryexecutionsoitshouldnotbeseenasareliablepredictorofquerycompletiontime.

Theprogressforeachplannodeiscalculatedastheratioofactualrowsproducedtotheplanner’sestimateofthetotalnumberofrowsthenodewillproduce:

Theoverallprogressforthequeryisestimatedusingthecalculatednodeprogressandtheplanner’scostestimates:

Iftheestimateisgreaterthan100%andthequeryhasnotyetcompleted,99.9%completionisreported.100%isreportediftheformulaproducesanestimatedpercentagegreaterthan100%.

CPUMasterCurrentCPUpercentontheGreenplumDatabasemasterhostforthisquery.

CPUSegments(Activequeriesonly.)CurrentCPUpercentaverageforallsegmentprocessesexecutingthisquery.Thepercentagesforallprocessesrunningoneachsegmentareaveraged,andthentheaverageofallthosevaluesiscalculatedtorenderthismetric.CurrentCPUpercentaverageisalwayszeroinhistoricalandtaildata.Themasterandstandbymasterareexcludedfromthecalculation.

CPUTimeTotalCPUtimeconsumedbyallprocessesonallsegmentsexecutingthisquery.

CPUSkewTheamountofCPUskew.CPUskewoccurswhenqueryexecutorprocessesforonesegmentuseadisproportionateamountofCPUcomparedtoprocessesforothersegmentsexecutingthequery.Thisvalueiscalculatedas

1−(average_segment_CPU/maximum_segment_CPU)

MemoryMemoryconsumedbyallsegmentprocessesexecutingthequery.

SpillFilesThetotalsizeofspillfilescreatedforthequery.GreenplumDatabasecreatesspillfileswhenthereisinsufficientmemorytoexecutethequeryinmemory.SeeManagingSpillFilesGeneratedbyQueries forinformationaboutspillfiles.

DiskRThecurrentaveragediskreadrateforallsegmenthosts.

DiskWThecurrentaveragediskwriterateforallsegmenthosts.

LocksandBlocksContainstwolistsoflockscurrentlyblockingtransactions.Clickalisttoexpandandviewthecontents.

Alistoflocksheldbythisquery,includingthetypeofeachlockandthequeriesblockedbythatlock.

©CopyrightPivotalSoftwareInc,2013-2019 72 6.0.0

Page 73: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Alistofqueriesthatholdlocksthatblockthisqueryandthelocktype.

QueryTextandExecutionPlanThequerytextandthequery’splanandexecutionprogressareshowninthelowerpanelsoftheQueryDetailsview.Thetextofthequeryisdisplayedintheleftpanel,andtheplanandprogressisdisplayedintherightpanel.

QueryTextTheQueryTextpaneldisplaysthetextofthequeryasitwassubmittedtoGreenplumDatabase.

CommandCentercandisplayupto100Kcharacters.IfyouclickCOPY,upto100Kcharactersofthequerytextarecopiedtotheclipboard.

Ifthequerytextislongerthan100Kcharacters,amessageisdisplayedwithalinkyoucanusetodownloadthefulltextofthequery.ThenameofthetextfileistheIDofthequerywitha .txt extension.Thefileisavailabletodownloadfor24hoursafterthequerycompletes,oruntilthequeryhasbeensavedtohistory,oncehistorycollectionisenabled.

QueryPlanandProgressThePlan&Progresstabinthelowerrightpanelisagraphicalrepresentationofthequeryplanwithanimationandreal-timemetricstoshowexecutionprogress.Eachboxinthetreerepresentsastepinthequeryexecutionplan.TheboxesarelabeledwiththeoperationtheyrepresentandhaveaCPUusagemetric.Queryexecutionbeginsatthebottomofthetreeandendsatthetop.

Beforeastepbeginstoexecute,theboxhasasolidwhitefill.Whenthestepbecomesactive,theboxisanimatedwithagreenandwhitefilltoindicatethattheoperatorisworking.Whenthestephascompleted,theboxhasasolidgreenfill.

Queryexecutionplansareexecutedin“slices,”portionsofthequeryplanthatsegmentscanworkonindependentlyinparallel.Theplanisslicedwhereveradatamotionoperatoroccurs.ThetimedisplayedintheupperrightcornerofeachboxistheamountofCPUtimeusedforallstepsintheslicetowhichthestepbelongs.Thevisualqueryplandoesnotillustrateslices,butyoucanfindinformationaboutslicesinthetextualplan.

Ifyouclickastep,theboxexpandstoshowadditionaldetails.

©CopyrightPivotalSoftwareInc,2013-2019 73 6.0.0

Page 74: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Theexpandedplanboxcontainsthefollowingmetrics.

Thetypeofoperator.Whentheoperatorisatablescan,thenameofthescannedtableisincluded.SeeQueryPlanExecutionfordescriptionsoftheoperators.

Informationrelatedtothecurrentoperation,suchasthehashkey,mergekey,joincondition,orfiltercondition.

RowSkew-theamountofrowskewforthecurrentoperator,avaluefrom0%to100%.Rowskewoccurswhensomesegmentsprocessmorerowsthanothersegments.Thepercentageiscalculatedas (1 − (average_segment_rows / maximum_segment_rows)) * 100 .

EstimatedCompletion-thecurrentpercentageofactualrowstoestimatedrowsforthisplanstep.Thepercentagecanexceed100%iftheoperationproducesmorerowsthantheoptimizer’sestimate.Thepercentagechangesto“Completed”whentheoperationcompletes.

ActualRows-Thecurrentnumberofrowsproducedbythisstep.Notethatfornestedjoinoperators,theActualRowsisestimatedsincetheactualrowcountsarenotavailablewhilethejoinisexecuting.

EstimatedRows-Theestimatednumberofrowstheoperatorwillproduce.

TextualPlanSelecttheTextualPlantabandclickRUNEXPLAINtogeneratethetextrepresentationoftheexplainplan.

TheRUNEXPLAINbuttonisdimmedifCommandCenterisunabletogeneratetheexplainplan.CommandCenterisunabletogeneratetheexplainplanifthesizeofthequerytextisgreaterthan100Kcharactersorifthequerytextcontainsmultiplestatements.

©CopyrightPivotalSoftwareInc,2013-2019 74 6.0.0

Page 75: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ThetextualplanistheoutputoftheGreenplumDatabase EXPLAIN commandforthequery.Thequeryplanstepsarelabeledwitharrows( -> )andthestructureofthequeryplantreeisindicatedwithindentation.

The Optimizerstatus: lineatthebottomofthetextualplanreportswhethertheexplainplanwasgeneratedusingtheGPORCAoptimizer(PQO)orthelegacyqueryoptimizer.

Forhelpreadingthetextualexplainplanseethe EXPLAIN commandintheGreenplumDatabaseReferenceGuideandQueryProfiling intheGreenplumDatabaseAdministratorGuide.SeeQueryExecutionfordescriptionsofthequeryoperators.

©CopyrightPivotalSoftwareInc,2013-2019 75 6.0.0

Page 76: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

HistoryTheHistorypageallowsyoutodisplaysystemmetricsandqueriesexecutedduringaspecifiedtimeperiod.

SetthetimeperiodtodisplaybyenteringdatesandtimesintheFromandTodateandtimefields.Youcanenterdatesbytypingthemintothedatefieldorbychoosingfromthepop-upcalendar.Enter24-hourtimesinHH:MMformat.

IntheFilterQueriesBysectionyoucanrestrictqueriesthatdisplayinthequerytableatthebottomofthepage.

Database-Chooseonlyqueriesthatraninaspecifieddatabase.

User-Chooseonlyqueriedexecutedbyaspecifieduser.

OntheAdmin>Settingspageyoucanenablesavingthereal-timemetricscollectedbytheGreenplumDatabasemetricscollectorextensiontohistoryinthegpmetricsschemaofthegpperfmondatabase.Whenyouenablecollectingthishistory,theCommandCenterHistory,QueryMonitor,andQueryDetailviewsallusedataderivedfromthesamedatacollectionmethod.

IfyoudisableGPCCqueryhistorycollectionontheAdmin>Settingspage,thehistoryviewsdisplaydatacollectedandsavedinthegpperfmondatabasebythe gpmmon and gpsmon agents.Thatdataisnotderivedfromthereal-timemetricsdisplayedontheQueryMonitorandQueryDetailview.Variationsshouldbeexpectedduetothedifferentdatacollectionmethods.

©CopyrightPivotalSoftwareInc,2013-2019 76 6.0.0

Page 77: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Status-Choosequeriesthatcompletedwiththespecifiedstatus: Done , Cancelled ,or Error .

ResQueueorResGroup-Choosequeriesexecutedbyaspecifiedresourcequeueorresourcegroup.

Priority-ChoosequeriesthatexecutedwitharelativeCPUpriority: min , low , medium , high ,or max .ThisoptionisonlyavailablewhenGreenplumDatabaseisusingresourcequeue-basedresourcemanagement.

HasCPUSkew-ChoosequeriesthatcompletedwithCPUskewgreaterthanzero.

HasSpill-Choosequeriesthatgeneratedspillfiles.

ClickSearchtodisplayresultsthatmatchyourchoices.

Hoveroveratimelinetoseethemetricsatthatpointintimeforallunhiddencharts.

Youcanclickanddragonacharttozoominonatimerange.ClickSearchtoupdatethequerylistandchartstotheselectedrange.

Scrollchartsleftorrightbyhoveringovertheedgeofthechartandclickinganarrow.Click‹or›tomoveinhalfsteps.Click«or»tomoveinfullsteps.

Chartsofthefollowingmetricsareavailable.Showorhidethematanytimewiththechecklistattheupperrightoftheview.

QueriesThenumberofqueriesrunning,thenumberofqueriesqueuedtorun,andthenumberofqueriesblocked.

CPUThepercentageofCPUusedbysystemprocessesandthepercentageofCPUusedbyuserprocesses.

MemoryPercentageofmemoryinuse.

DiskI/ODiskreadandwriteratesinmegabytespersecond.

NetworkNetworkI/Oreadandwriteratesinmegabytespersecond.NetworkmetricsincludetrafficoverallNICs(networkinterfacecards),includinginternalinterconnectandadministrativetraffic.

LoadSystemloadaveragefor1-minute,5-minute,and15-minuteperiods.

SwapPercentageofswapspaceused.

QueryMetricsTheQuerytabledisplaysqueriesthatwereactiveduringthespecifiedtimeperiod,includingqueriesthatstartedbeforeorfinishedafterthespecifiedtime.However,queriesthatarestillactivearenotincludedinthetable;thesequeriescanbeviewedontheQueryMonitorpage.

Thequerytablehasthefollowingcolumns:

QueryIDAnidentificationstringforthequery.IntheConsole,thislookslike“1295397846-56415-2”.

StatusThefinalstatusofthequery.Thiscanbeoneofthefollowing:

Done

Cancelled

Error

UserTheGreenplumDatabaseuserwhosubmittedthequery.

DatabaseThenameofthedatabasethatwasqueried.

SubmittedThetimethequerywassubmittedtothequeryplanner.

QueuedTimeThetimethequerywaitedbeforeitwasexecuted.Inadditiontotimeinthequeue,thisincludesothertimesuchastimeintheoptimizer.

©CopyrightPivotalSoftwareInc,2013-2019 77 6.0.0

Page 78: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

RunTimeTheamountoftimethequeryrequiredtoproducearesult.

EndedThetimethequerycompletedorwascancelled.

CPUSkewTheamountofCPUskew.CPUskewoccurswhenqueryexecutorprocessesforonesegmentuseadisproportionateamountofCPUcomparedtoprocessesforothersegmentsexecutingthequery.ThisvalueisthecoefficientofvariationfortheCPUusedbyprocessesrunningthisqueryoneachsegment,multipliedby100.Forexample,avalueof.95isshownas95.

SpillFilesThetotalsizeofspillfilescreatedforthequery.GreenplumDatabasecreatesspillfileswhenthereisinsufficientmemorytoexecutethequeryinmemory.SeeManagingSpillFilesGeneratedbyQueries forinformationaboutspillfiles.

ResGrouporResQueueThenameoftheresourcegrouporresourcequeueforthequery.

Priority(ResQueueonly)AqueryexecuteswiththeCPUpriorityassignedtoitsresourcequeue.

FormoreinformationaboutResourceQueues,ResourceGroups,andQueryPlans,refertotheGreenplumDatabaseAdministratorGuide.

©CopyrightPivotalSoftwareInc,2013-2019 78 6.0.0

Page 79: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

QueryHistoryDetailsTheQueryHistoryDetailsviewdisplaysquerymetrics,thetextofthequery,andthequeryplanandexecutionstatisticsforasinglequeryselectedfromtheQueryHistoryview.

QueryHistoryMetricsTheQueryID,executionstatus,andruntimeofthequeryaredisplayedatthetop.

Thefollowingmetricsaredisplayedforthequery.

UserTheGreenplumDatabaserolethatsubmittedthequery.

DatabaseThenameofthedatabasethatwasqueried.

ResGroup/ResQueueThenameoftheresourcegrouporresourcequeuethatismanagingthequery.

PlannerThenameofthequeryplannerusedforthisquery,GPORCAorLegacy.

SubmittedThetimethequerywassubmittedtothequeryplanner.

QueuedTimeThetimethequerywaitedbeforeitwasexecuted.Inadditiontotimeinthequeue,thisincludesothertimesuchastimeintheoptimizer.

RunTimeTheamountoftimethequeryexecuted.

CPUMasterTheCPUpercentontheGreenplumDatabasemasterhostforthisquery.

CPUSegments

©CopyrightPivotalSoftwareInc,2013-2019 79 6.0.0

Page 80: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

CPUpercentaverageforallsegmentprocessesexecutingthisquery.Thepercentagesforallprocessesrunningoneachsegmentareaveraged,andthentheaverageofallthosevaluesiscalculatedtorenderthismetric.Themasterandstandbymasterareexcludedfromthecalculation.

CPUTimeTotalCPUtimeconsumedbyallprocessesonallsegmentsexecutingthisquery.

CPUSkewTheamountofCPUskew.CPUskewoccurswhenqueryexecutorprocessesforonesegmentuseadisproportionateamountofCPUcomparedtoprocessesforothersegmentsexecutingthequery.Thisvalueiscalculatedas

1−(average_segment_CPU/maximum_segment_CPU)

MemoryMemoryconsumedbyallsegmentprocessesexecutingthequery.

SpillFilesThetotalsizeofspillfilescreatedforthequery.GreenplumDatabasecreatesspillfileswhenthereisinsufficientmemorytoexecutethequeryinmemory.SeeManagingSpillFilesGeneratedbyQueries forinformationaboutspillfiles.

DiskRTheaveragediskreadrateforallsegmenthosts.

DiskWTheaveragediskwriterateforallsegmenthosts.

LocksandBlocksContainslistsofqueriesblockedbylocksthisqueryholds,andqueriesheldbyothertransactionsthatblockthistransaction.Clickalisttoexpandandviewthecontents.

QueryTextandExecutionPlanThequerytextandthequery’splanandexecutionprogressareshowninthelowerpanelsoftheQueryDetailsview.Thetextofthequeryisdisplayedintheleftpanel,andtheplanandprogressisdisplayedintherightpanel.Theplanisavailableonlyforqueriesthatranforatleasttenseconds.

QueryTextTheQueryTextpaneldisplaysthetextofthequeryasitwassubmittedtoGreenplumDatabase.

CommandCentercandisplayupto100Kcharacters.IfyouclickCOPY,upto100Kcharactersofthequerytextarecopiedtotheclipboard.

Ifthequerytextislongerthan100Kcharacters,amessageisdisplayedwithalinkyoucanusetodownloadthefulltextofthequery.ThenameofthetextfileistheIDofthequerywitha .txt extension.Thefileisavailabletodownloadfor24hours.

QueryPlanandProgressThePlan&Progresstabinthelowerrightpanelisagraphicalrepresentationofthequeryplanwithmetricstoshowtheplannedandactualqueryexecution.Eachboxinthetreerepresentsastepinthequeryexecutionplan.Theboxesarelabeledwiththeoperationtheyrepresent.Queryexecutionbeginsatthebottomofthetreeandendsatthetop.

Queryexecutionplansareexecutedin“slices,”portionsofthequeryplanthatsegmentscanworkonindependentlyinparallel.Theplanisslicedwhereveradatamotionoperatoroccurs.ThetimedisplayedintheupperrightcornerofeachboxistheamountofCPUtimeusedforallstepsintheslicetowhichthestepbelongs.Thevisualqueryplandoesnotillustrateslices,butyoucanfindinformationaboutslicesinthetextualplan.

Ifyouclickastep,theboxexpandstoshowadditionaldetails.

©CopyrightPivotalSoftwareInc,2013-2019 80 6.0.0

Page 81: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Theexpandedplanboxcontainsthefollowingmetrics.

Thetypeofoperator.Whentheoperatorisatablescan,thenameofthescannedtableisincluded.SeeQueryPlanExecutionfordescriptionsoftheoperators.

Informationrelatedtothecurrentoperation,suchasthehashkey,mergekey,joincondition,orfiltercondition.

RowSkew-theamountofrowskewforthecurrentoperator,avaluefrom0%to100%.Rowskewoccurswhensomesegmentsprocessmorerowsthanothersegments.Thepercentageiscalculatedas (1 − (average_segment_rows / maximum_segment_rows)) * 100 .

EstimationAccuracy-apercentagecalculatedfromtheestimatedrowsthenodewouldproduceandtheactualrowsthenodeproducedwhenthequeryexecuted.Thepercentageiscalculatedas min(estimated_rows, actual_rows) / max(estimated_rows, actual_rows) * 100

ActualRows-Thenumberofrowsproducedbythisstep.

EstimatedRows-Theestimatednumberofrowstheoperatorwillproduce.

TextualPlanSelecttheTextualPlantabandclickRUNEXPLAINtogeneratethetextrepresentationoftheexplainplan.The EXPLAIN commandisrunagainstthecurrentstateofthedatabase,sotheplangeneratedmaydifferfromthetheplanusedwhenthequeryexecuted.

TheRUNEXPLAINbuttonisdimmedifCommandCenterisunabletogeneratetheexplainplan.CommandCenterisunabletogeneratetheexplainplanifthesizeofthequerytextisgreaterthan100Kcharactersorifthequerytextcontainsmultiplestatements.

©CopyrightPivotalSoftwareInc,2013-2019 81 6.0.0

Page 82: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ThetextualplanistheoutputoftheGreenplumDatabase EXPLAIN commandforthequery.Thequeryplanstepsarelabeledwitharrows( -> )andthestructureofthequeryplantreeisindicatedwithindentation.

The Optimizerstatus: lineatthebottomofthetextualplanreportswhethertheexplainplanwasgeneratedusingtheGPORCAoptimizer(PQO)orthelegacyqueryoptimizer.

Forhelpreadingthetextualexplainplanseethe EXPLAIN commandintheGreenplumDatabaseReferenceGuideandQueryProfiling intheGreenplumDatabaseAdministratorGuide.SeeQueryExecutionfordescriptionsofthequeryoperators.

©CopyrightPivotalSoftwareInc,2013-2019 82 6.0.0

Page 83: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AlertsOntheAdmin>Alertspage,anadministratorcansetupalertrulestodetectandrespondtoeventsoccurringintheGreenplumDatabasesystemandincurrentlyexecutingdatabasequeries.Whenaruleismatched,CommandCenterlogsarecord.

YoucansetupemailalertsbyconfiguringanSMTPserverinGreenplumDatabaseorinCommandCenter.Additionally,youcancreatea send-alert.sh shellscripttoforwardalertstootherdestinations,suchasanSMSgatewayoraSlackchannel.Ifthescriptispresent,CommandCenterrunsitwheneveranalertisraised.

CommandCentercreatesthe gpmetrics schemainthegpperfmondatabasetostorebothrulesandlogrecords.SeegpmetricsSchemaReferenceforinformationaboutthe gpcc_alert_rule and gpcc_alert_log tablesinthe gpmetrics schema.

Thistopiccontainsthefollowingsubtopics:

ConfiguringAlertRules

ConfiguringAlertEmail

CreatingaSendAlertScript

ConfiguringAlertRulesClickEDITtomanagealerteventrules.Toenableanalertrule,enteranydatarequiredinthefieldsandcheckthebox.Unchecktheboxtodisabletherule.ClickSAVEwhenyouhavefinishedmakingchangestothealertconfiguration.

Segmentfailure

Analertisraisedwhenoneormorefailedsegmentsaredetected.Afterthealertemailisraised,CommandCenterwillraisethealertevery30minutesuntilthesegmentsarerecovered.

Averagememory(segmenthosts)exceeds[%]for[N]min

Analertisraisedwhentheaveragememoryforallsegmenthostsexceedsthespecifiedpercentageforthespecifiednumberofminutes.CommandCentersamplesallsegmenthostsevery15secondsandcalculatesthemeanofthesamples.Onlymemoryinuseisconsidered;memoryforbuffersandcacheisnotincluded.

Memory(master)exceeds[%]for[N]min

Analertisraisedwhenthepercentofmemoryusedonthemasterhostexceedsthespecifiedpercentageforthespecifiednumberofminutes.CommandCentersamplesmemoryusageonthemasterhostevery15secondsandcalculatesthemeanofthesamples.Onlymemoryinuseisconsidered;memoryforbuffersandcacheisnotincluded.

Totaldiskspaceexceeds[%]full

Analertisraisedwhenthetotalofdiskspaceinuseforallsegmenthostsexceedsthespecifiedpercentage.CommandCentergatherstheavailablediskspaceandtotaldiskspacefromeachsegmenthostintheGreenplumDatabasecluster.Thepercentoftotaldiskspaceinuseiscalculatedbythefollowingformula:

©CopyrightPivotalSoftwareInc,2013-2019 83 6.0.0

Page 84: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

100 - sum(<available disk space>) / sum(<total disk space>) * 100

Adiskspacealertisraisednomorethanonceevery24hours.

Numberofconnectionsexceeds[N]

Analertisraisedwhenthetotalnumberofdatabaseconnectionsexceedsthenumberspecified.Thenumberofconnectionsischeckedevery30seconds.Afteranalertisraised,themetricscollectorchecksthenumberofconnectionsevery30minutesuntilthenumberofconnectionsdropsbelowthethreshold,andthenitresumescheckingevery30seconds.

AverageCPU(segmenthosts)exceeds[%]for[N]min

AnalertisraisedwhentheaveragepercentofCPUusedforallsegmenthostsexceedsthespecifiedpercentageforthespecifiednumberofminutes.CommandCentersamplesallsegmenthostsevery15secondsandcalculatesthemeanofthesamples.

CPU(master)exceeds[%]for[N]min

AnalertisraisedwhentheCPUusageonthemasterhostexceedsthespecifiedpercentageforthespecifiednumberofminutes.CommandCentersamplesCPUusageonthemasterhostevery15secondsandcalculatesthemeanofthesamples.

Outofmemoryerrors

Analertisraisedwhenanexecutingqueryfailswithanoutofmemory(OOM)error.Notethatnoalertisraisedifthereisinsufficientmemorytostartthequery.

Spillfilesforaqueryexceeds[GB]

Analertisraisedwhenthetotaldiskspaceconsumedbyarunningquery’sspillfilesexceedsthespecifiednumberofgigabytes.Analertisraisedonlyonceperquery.

Queryruntimeexceeds[N]min

Analertisraisedwhenaqueryruntimeexceedsthenumberofminutesspecified.Thisalertisraisedjustonceforaquery.

Queryisblockedfor[N]min

Analertisraisedifaqueryremainsinablockedstateforlongerthanthespecifiednumberofminutes.Ifanalertisraised,andthenthequeryunblocks,runs,andblocksagainforthespecifiedtime,anadditionalalertisraised.Blockedtimeexcludesthetimeaqueryisqueuedbeforeitruns.Itispossiblefora“Queryruntimeexceeds[N]min”ruletoalsotriggerwhileaqueryisblocked.

ConfiguringAlertEmailCommandCenterrequiresanSMTPservertosendalertemails.IfSMTPhasbeenconfiguredforGreenplumDatabase,CommandCenterwillusetheconfiguredSMTPserver,andifprovided,theSMTPuserandpassword.Youmustentervaluesforthefieldsintherightcolumn,Sendemailsto,andFrom,whetheryouusetheGreenplumDatabaseSMTPserverorconfigureanotherone.

CommandCenterfirstattemptsanencryptedTLSconnectionandthenfallsbacktoanunencryptedconnectionifTLSisnotsupported.TheSMTPservermustsupportoneofthefollowingauthenticationmethods:NONE,PLAIN,LOGIN,orCRAM-MD5.CommandCenterwillusethemostsecureofthesemethodstheSMTPserverallows.

ConfiguringemailWithCommandCenterClickEDITintheManageemailconfigurationpanel.

©CopyrightPivotalSoftwareInc,2013-2019 84 6.0.0

Page 85: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ThealertemailconfigurationissetwiththefollowingGreenplumDatabaseserverconfigurationparameters:

SMTPServeraddress

ThenameorIPaddressoftheSMTPserverandtheSMTPportnumber.Theportnumberistypically587forconnectionswithTLSencryptionor465withoutencryption.Ifthe gp_email_smtp_server configurationparameterissetinGreenplumDatabase,itisprefilledhere.Askyoursystemadminforthecorrectvaluestoenter.Example: smtp.example.com:465

Username

TheusernameoftheaccounttoauthenticatewiththeSMTPserver.Ifthe gp_email_smtp_password configurationparameterissetinGreenplumDatabase,itisprefilledhere.Thisisanoptionalfield,onlyrequirediftheSMTPserverrequiresausernameforauthentication.Example:[email protected]

Password

ThepasswordfortheSMTPusername.Forsecurity,thepasswordismasked.Ifthe gp_email_smtp_password configurationparameterissetinGreenplumDatabase,thatvalueisusedhere.Thisfieldisoptional,onlyneedediftheSMTPserverrequiresausernameandpasswordforauthentication.

Sendemailsto

Toaddanaddresstothelist,entertheaddressandpressEnter.Toremoveanemailaddress,clickthe X ontheaddress.

From

Theemailaddresstouseforthe From: addressinthealertemail.Example: [email protected] .Ifyouleavethisfieldblank,CommandCenterusesthedefaultvalue, [email protected] .

WhenyouclickSAVE,CommandCentersendsatestemailtotheaddressesintheSendemailstofield.Theemailcontainsalistofthecurrentlyconfiguredalertrules.IfthereisanerrorintheSMTPserverorusername/passwordconfigurationandtheemailcannotbesent,CommandCenterdisplaysanerrormessage.

ConfiguringemailforGreenplumDatabaseThefollowingserverconfigurationparametersareusedtoconfigureSMTPemailforGreenplumDatabase.

gp_email_smtp_server

TheSMTPserverandport.Example: smtp.example.com:465

gp_email_smtp_userid

ThenameofausertoauthenticatewiththeSMTPservice.Example: [email protected]

gp_email_smtp_password

ThepasswordfortheSMTPuser.

gp_email_from

Theemailaddresstosetastheemailsender.Example: [email protected]

©CopyrightPivotalSoftwareInc,2013-2019 85 6.0.0

Page 86: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

gp_email_to

Asemicolon-separatedlistofemailaddressestoreceivealertmessages.Example [email protected];[email protected]

CommandCenterusesthe gp_email_smtp_server , gp_email_smtp_userid ,and gp_email_smtp_password parametersiftheyareset.Itignorestheremainingparameters.

Youcancheckthecurrentvalueofaconfigurationparameterbyrunningthe gpconfig-s

commandonthemasterhost,forexample:

$gpconfig-sgp_email_smtp_server

Usethe gpconfig-c

optiontosetthevaluesofserverconfigurationparameters,forexample:

$gpconfig-cgp_email_smtp_server-v"smtp.example.com:465"$gpconfig-cgp_email_smtp_userid-v"[email protected]"$gpconfig-cgp_email_smtp_password-v"changeme"$gpconfig-cgp_email_from-v"[email protected]"$gpconfig-cgp_email_to-v"[email protected];[email protected]"

Run gpstop-u

toreloadtheconfigurationfilesafterchangingtheseconfigurationparameters.

CreatingaSendAlertScriptThesendalertscriptisashellscriptthatyoucanusetosendCommandCenteralertstodestinationssuchasSMSgateways,pagers,teamcollaborationtoolslikeSlack,chatservers,archivefiles,alternativeemailservers,andsoon.YoucanusethesendalertscriptinadditiontosendingemailfromCommandCenter,orasanalternativetosendingalertemailsfromCommandCenter.

CommandCenterlooksforthescript $MASTER_DATA_DIRECTORY/gpmetrics/send-alert.sh onthehostwhereCommandCenterisrunning—eitherthemasterhostorstandbyhost.Ifthefileexistsandisexecutablebythegpadminuser,CommandCenterexecutesthescript.Thefollowingvariablesaresetonthecommandlinewhenthescriptruns.

Variable Description

LINK URLoftheGreenplumCommandCenterwebserver.

QUERYID IDofthequery,ifthealertwastriggeredbyaquery.

SERVERNAME NameoftheGreenplumCommandCenterserver.

QUERYTEXT Thetextofthequery,ifthealertwastriggeredbyaquery.

ACTIVERULENAME Currenttexttheofrule,withuser-specifiedvaluesincluded.

LOGID Valueofthisalert’s id columninthe gpmetrics.gpcc_alert_log table.

RULEDESCRIPTION Textoftherule,includinguser-specifiedvalues,atthetimethealertwasraised.

ALERTDATE Datethealertwasraised.

ALERTTIME Timethealertwasraised.

SUBJECT Subjectlineforemail.

Anexamplescriptthatyoucancustomizeisprovidedat $GPCC_HOME/alert-email/send_alert.sh.sample .TheexampleformatsthealertasHTMLemailtextandpipesitthroughtheLinux mail command.

Tosetupasendalertscript:

1. Copythe $GPCC_HOME/alert-email/send_alert.sh.sample fileto $MASTER_DATA_DIRECTORY/gpmetrics/send-alert.sh .

2. Customizethescriptwithcodetoformatanddeliverthealerttoyourdesireddestination.

3. Run gpccstart torestartCommandCenterandenablethescript.

©CopyrightPivotalSoftwareInc,2013-2019 86 6.0.0

Page 87: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ManagingGreenplumDatabaseWorkloadsAboutWorkloads

ManagingGreenplumDatabaseResourceGroups

ImportingResourceQueuestoResourceGroups

AccessingtheWorkloadManagementConfigurationProgrammatically

TroubleshootingEnablingResourceGroups

©CopyrightPivotalSoftwareInc,2013-2019 87 6.0.0

Page 88: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AboutGreenplumCommandCenterWorkloadManagementGreenplumDatabasesegmenthostshaveasetamountofmemory,CPU,I/O,andnetworkresources.Iftheseresourcesstarttorunshortduetoheavydatabaseload,queriescanfailortheentiredatabasesystemcanbecomeunacceptablyslow.Forthisreason,itisimportanttomanagedatabaserequeststopreventresourcedepletion.

SeeUsingResourceGroups intheGreenplumDatabaseAdministratorGuideforafulldescriptionofresourcemanagementfeaturesavailablewithresourcegroupsandinstructionstoenableresourcegroupsinGreenplumDatabase.

OntheCommandCenterAdmin>WorkloadMgmtview,youcanperformthefollowingtasks:

CreatenewresourcegroupsinGreenplumDatabase

Deleteexistingresourcegroups

Changethenumberofconcurrenttransactionseachresourcegroupallows

ChangethepercentagesofavailablesystemCPUandmemoryeachresourcegroupmanages

ChangeGreenplumDatabaseroles’defaultresourcegroups

Writequeryassignmentrulestooverrideauser’sdefaultresourcegroupwhenatransactionexecutes

FormoreinformationaboutLinuxcgroupsandGreenplumDatabaseresourcegroupsseeUsingResourceGroups intheGreenplumDatabaseAdministratorGuide.

AboutQueryAssignmentRulesGreenplumDatabasedeferstothemetricscollectordatabaseextensiontoassigntransactionstoresourcegroups.CommandCenteruserswithAdminpermissionlevelcancreateassignmentrulesinCommandCentertoassigntransactionstoresourcegroups.

Whenatransactionbegins,GreenplumDatabasecallsthemetricscollectorextensiontodeterminetheresourcegroup.Theextensionevaluatestheassignmentrulesand,ifamatchingruleisfound,returnsthatrule’sresourcegroup.Ifnoassignmentrulematches,GreenplumDatabasefallsbacktothedefaultbehavior,assigningthetransactiontotheresourcegroupspecifiedforthecurrentuserinthe pg_authid systemtable.

AssignmentrulescanredirectatransactiontoaresourcegroupbasedonquerytagsoracombinationofquerytagsandtheGreenplumDatabaseroleexecutingthetransaction.

Aquerytagisauser-definedname=valuepairthatyoucansetinaGreenplumDatabasesessionwhenresourcegroup-basedworkloadmanagementisenabled.Querytagsaredefinedbysettingthe gpcc.query_tags parameterontheconnectstringwhenrequestingadatabaseconnectionorinthesessionwith SETgpcc.query_tagsTO'<query-

tags>'.Multiplequerytagscanbesetbyseparatingthemwithasemicolon.Querytagsaresetbeforeatransactionbegins

andcannotbechangedinsideofatransaction.

SeeWorkloadManagementfordetailsaboutcreatingassignmentrulesandforexamplesthatusequerytags.

GreenplumDatabasehastworesourcemanagementsystems:resourcequeuesandresourcegroups.CommandCenterworkloadmanagementisbasedonresourcegroups,theresourcemanagementsystemintroducedinGreenplumDatabaseversion5.ResourcegroupsrequireenablingLinuxcontrolgroups(cgroups),soGreenplumDatabaseinitiallyissettoperformresourcemanagementusingresourcequeues.

WhenCommandCenterstarts,itcheckstheresourcemanagementsystemenabledinyourGreenplumDatabasesystem.IfyouhavenotyetenabledresourcegroupsinyourGreenplumDatabasesystem,theCommandCenterworkloadmanagementviewdisplaysamessageencouragingyoutoenableresourcegroups,includingalinktodocumentationwiththeprocedureforcompletingthetask.WhenyoustartCommandCenterafterenablingresourcegroups,clicktheENABLEWORKLOADSbutton.CommandCenterpresentsaviewtohelpyousettheintialresourcegroupconfigurationbyimportingyourexistingresourcequeuestoresourcegroups.

©CopyrightPivotalSoftwareInc,2013-2019 88 6.0.0

Page 89: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

WorkloadManagement

DefiningResourceGroupsandResourceAttributesCommandCenterallowsyoutoviewresourcegroupsthathavebeencreatedinGreenplumDatabase,toaddordeleteresourcegroups,andtoedittheresourcegroupattributesConcurrency,CPU%,andMemory%.

1. ClickEDITtoopentheResourceGroupeditor.

2. Todeletearesourcegroup,selecttheresourcegroup,andclicktheminussignthatappearsattheright.Youcannotdeletethe default_group or admin_group resourcegroups.YoucannotdeletearesourcegroupthatisassignedtoanyGreenplumDatabaserole.

3. Toaddaresourcegroup,clickADDRESOURCEGROUPandenteranamefortheresourcegroupintheNamecolumn.Resourcegroupnamesmustbeuniqueandarecase-sensitive.

4. AdjustthevaluesoftheConcurrency,CPU%,andMemory%resourcegroupattributes.Concurrency

Themaximumnumberofconcurrenttransactions,includingactiveandidletransactions,thatarepermittedintheresourcegroup.Concurrencysetsthe CONCURRENCY attributeoftheresourcegroup.ThetotaloftheConcurrencycolumnscannotexceedthevalueoftheGreenplumDatabase max_connections masterserverconfigurationparameter.

CPU%ThepercentageofCPUresourcesavailabletothisresourcegroup.ThepercentageistheportionofthetotalCPUpercentageallocatedforallresourcegroups(reservedCPUsexcluded),whichissetwiththe gp_resource_group_cpu_limit serverconfigurationparameter.CPU%setsthe CPU_RATE_LIMIT attributeoftheresourcegroup.

Memory%Thepercentageofmemoryresourcesavailabletothisresourcegroup.Thepercentageistheportionofthetotalmemoryallocatedforallresourcegroups,whichissetwiththe gp_resource_group_memory_limit GreenplumDatabaseconfigurationparameter.ChangingtheMemory%valuesetsthe MEMORY_LIMIT attributeoftheresourcegroup.

MinmemoryperqueryTheminimumamountofmemoryallocatedtoaquery.ThiscolumnisrecalculatedasyouadjustConcurrencyandMemory%settings.Thevalueistheresourcegroup’stotalshareofsystemmemory,lesstheresourcegroup’ssharedmemorypool(20%bydefault),dividedbythevalueintheConcurrencycolumn.ThepercentageofmemoryallocatedtothesharedmemorypoolcanbechangedbysettingtheMEMORY_SHARED_QUOTA attributeoftheresourcegroupusingtheALTERRESOURCEGROUP SQLcommand.Eachquerymanagedbytheresourcequeueisallocatedthisamountofmemory.Ifaqueryneedsmorememory,itisallocatedfromtheresourcegroupsharedmemorypoolandtheglobalsharedmemorypool,ifavailable.

ThetotalsoftheCPU%andMemory%columnsmustnotexceed100%.YoushouldnotallowthetotaloftheCPU%columntoexceed90%,becausethiscouldcauseresource-intensivequeriestoconsumenearlyallCPU,starvingotherGreenplumDatabaseprocesses.IfthetotaloftheMemory%columnislessthan100%,theunreservedmemoryispartoftheresourcegroupsharedglobalmemorypool.See“GlobalSharedMemory”inUsingResourceGroups intheGreenplumDatabaseAdministratorGuideforinformationabouttheglobalresourcegroupsharedmemorypool.

5. ClickApplytosaveyourchangesorclickCanceltoabandonyourchanges.

Tochangevaluesofthe MEMORY_AUDITOR , CPUSET , MEMORY_SHARED_QUOTA ,or MEMORY_SPILL_RATIO resourcegroupattributes,usethe ALTERRESOURCEGROUP SQLcommand.

©CopyrightPivotalSoftwareInc,2013-2019 89 6.0.0

Page 90: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AssigningRolestoResourceGroupsEveryGreenplumDatabaseroleisassignedtoasingleresourcegroupinthe pg_roles systemtable.Transactionsexecutedbyarolearemanagedbyitsassignedresourcegroup,unlessyoucreateanassignmentruletooverridethedefault.

Youcanviewthecurrentresourcegroupassignmentsforallrolesandchangearole’sresourcegroupbyaddingittoadifferentresourcegroup.

Tomovearoletoadifferentresourcegroup:

1. Enterallorpartoftherolenameintheaddrolefieldbeneaththenewresourcegroup.

2. ChoosetherolefromthelistthatisdisplayedandpressEnter.

ThechangeisimmediatelyappliedtotheGreenplumDatabase pg_roles systemtable.

DefiningWorkloadManagementRulesQueryassignmentrulesallowyouassigntransactionstoaresourcegroupbasedonuser-definedquerytagsand,optionally,thecurrentroleinthedatabasesession.Whennorulematches,thetransactionisassignedtotherole’sdefaultresourcegroup.SeeAboutAssignmentRulesformoreinformationaboutassignmentrules.

SeeAccessingtheWorkloadConfigurationProgrammaticallyforinformationaboutretrievingandsettingrulesprogrammaticallywithdatabasefunctions.

1. ClickEDITtoopentheWorkloadManagementRuleseditor.

2. Todeletearule,selecttheruleandclicktheminussignthatappearsattheright.

3. Toaddanassignmentrule,clickADDASSIGNMENTRULEandfillinthefields.QueryTags

Thefirstfieldisalistofquerytagstomatchagainstthe gpcc.query_tags parameterintheGreenplumDatabasesession.Aquerytagisauser-defined<name>=<value>pair.Separatemultiplequerytagswithsemicolons.SeeDefiningandSettingQueryTagsformoreinformation

©CopyrightPivotalSoftwareInc,2013-2019 90 6.0.0

Page 91: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

aboutquerytags.Role

(Optional)Ifyouenterarolenameinthisfield,therulematchesonlyifboththequerytagsandrolematchthetagsandcurrentroleinthedatabasesession.

ResourceGroupChoosearesourcegroupfromthelist.

Changetheorderoftheassignmentrulesbydraggingarule’shandle(attheleft)upordown.Assignmentrulesareevaluatedfromtoptobottom.GreenplumDatabaseappliesthefirstrulethatmatches.UsetheActive/Inactivetoggletomakearuleactiveorinactive.

4. ClickAPPLYtosaveyourchanges.

DefiningandSettingQueryTagsAquerytagisauser-defined<name>=<value>pair,setintheGreenplumDatabase gpcc.query_tags parameterintheGreenplumDatabasesession.Thegpcc.query_tags parameterisdefinedwhenthe gp_wlm databaseextensionisenabledinthepostgresdatabase.Ifyoutrytosetquerytagswhenthegp_wlm extensionisnotenabled,yougetanunrecognizedconfigurationparametererror.Toseeiftheextensionisenabled,runthefollowingcommand.

$psqlpostgres-c"\dx"ListofinstalledextensionsName|Version|Schema|Description--------+---------+--------+--------------------------------------gp_wlm|0.1|gpcc|GreenplumWorkloadManagerExtension(1row)

Whenyousubmitatransactionandthe gp_wlm extensionisenabled,GreenplumDatabasecallsthe gp_wlm extensiontodeterminetheresourcegroupforthetransaction.TheextensionevaluatesthecurrentroleandquerytagssetinthesessionagainsttherulesyouhavedefinedinCommandCenter.Ifthereisamatch,theextensionreturnstherule’sresourcegroup.Ifthereisnomatch,GreenplumDatabaseassignsthetransactiontotherole’sdefaultresourcegroup.

Thefollowingcommand,executedintheGreenplumDatabasesession,setsthe appName and appUser querytagsto“tableau”and“bi_sales”,respectively.

=#SETgpcc.query_tagsTO'appName=tableau;appUser=bi_sales';

Tomatcharule,alltagsintherule’squerytagfieldmustbepresentinthe gpcc.query_tags parameterinthedatabasesession.Theorderofthetagsisnotsignificant,andthe gpcc.query_tags parametercanhaveasupersetofthetagsdefinedinthe queryTags value.

Ifyousetthe gpcc.query_tags parameterinsideofatransaction,youmustcommitthetransactionbeforethenewquerytagsareusedtoevaluateassignmentrules.

Youcansetthevalueofthe gpcc.query_tags parameterusingthe SET command,asintheexampleabove,orasaconnectionparameterwithdatabaseclientsthatsupportit,suchas psql .Followingaretwoexamplesthatshowhowtospecifyquerytagsonthe psql commandline.

$PGOPTIONS="-cgpcc.query_tags='appName=tableau;appUser=bi_sales'"psql

$psqlpostgresql://mdw:5432/postgres?options="-cgpcc.query_tags%3D'appName%3Dtableau;appUser%3Dbi_sales'"

Inthesecondexample,itisnecessarytocodetheequalssignsas %3D toprevent psql frominterpretingthequerytagsascommand-linearguments.

©CopyrightPivotalSoftwareInc,2013-2019 91 6.0.0

Page 92: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ImportingResourceQueuestoResourceGroupsGreenplumCommandCenterworkloadmanagementworkswithresourcegroups,thenewGreenplumDatabaseresourcemanagementsystem.ThedefaultresourcemanagementsystemforGreenplumDatabaseisresourcequeues.TousetheCommandCenterworkloadmanagementfeatures,youmustfirstenableresourcegroupsinGreenplumDatabase.

CommandCentercanassistyouinenablingresourcegroupsandinimportingexistingresourcequeuestoresourcegroups.

StepOne:EnableResourceGroupsinGreenplumDatabaseIfyourGreenplumDatabasesystemisstillconfiguredtouseresourcequeues,theCommandCenterAdmin>WorkloadMgmtviewdescribesthebenefitsofresourcegroupsandworkloadmanagementwithCommandCenterandprovidesalinktotheGreenplumDatabasedocumentationtohelpyouenableresourcegroups.

ClickVIEWRESOURCEGROUPSETUPGUIDEforinstructionstoenableresourcegroupsinyourGreenplumDatabasesystem.

StepTwo:PreviewandConfigureResourceGroupImportsAfteryouhaveenabledresourcegroupsandrestartedGreenplumDatabase,restartCommandCenter( gpcc

start),login,andchooseAdmin>Workload

Mgmt.

Theworkloadmanagementviewnowdisplaysapreviewofresourcegroupsconvertedfromyourexistingresourcequeues.Youcanusethisone-timeviewtoconvertyourGreenplumDatabaseresourcequeuestoresourcegroups.

©CopyrightPivotalSoftwareInc,2013-2019 92 6.0.0

Page 93: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Theresourcegrouplistincludestherequired admin_group and default_group resourcegroups,andarowforeachofyourexistingresourcequeues.

Rolesareassignedtotheresourcegroupmatchingtheresourcequeuetowhichtheyareassigned.ClickthePreviewroleslinktoseetheroleassignments.

Ifyouwanttosetupresourcegroupslater,youcanclickSKIPIMPORT.Onlythe default_group and admin_group resourcegroupsarecreated.Roleswiththesuperuserattributeareassignedtothe admin_group resourcegroup;roleswithoutsuperuserprivilegeareassignedtothe default_group resourcegroup.

IfyouwantCommandCentertoimportresourcequeuestoresourcegroups,youmustcompletetheresourceallocationfieldsforallresourcegroups.

SettheConcurrency,CPU%,andMemory%resourcegroupattributestoallocateGreenplumDatabaseresourcestotheresourcequeues.TheConcurrencyfieldsmusteachcontainapositiveinteger.TheCPU%andMemory%fieldsmusteachcontainpositiveintegersbetween1and99andthetotalsfortheCPU%andMemory%columnsmustnotexceed100%.SeeDefiningResourceGroupsandResourceAttributesforhelpdeterminingthevaluestoenter.

TheIMPORTRESOURCEGROUPSbuttonisdisableduntilyouhaveenteredvalidvaluesintheallocationfieldsforeveryresourcegroup.

Whenyouarereadytoimporttheresourcegroups,clickIMPORTRESOURCEGROUPStocreatetheresourcegroups.

StepThree:EnableCommandCenterWorkloadManagementAfteryouimport(orskipimporting)resourcequeuestoresourcegroups,youcanenableCommandCenterworkloadmanagement.

©CopyrightPivotalSoftwareInc,2013-2019 93 6.0.0

Page 94: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

ClickENABLEWORKLOADMANAGEMENTtoenableworkloadmanagementinGreenplumCommandCenter.GreenplumCommandCentercreatesthegp_wlm extension,the gpcc.workload_config table,andtheassociateduser-definedfunctionsinGreenplumDatabase.

YouarenowabletousetheCommandCenterWorkloadManagementinterfacetoadd,remove,andconfigureresourcegroups;changeroleassignments;anddefineworkloadmanagementrules.

SeeWorkloadManagementforhelpusingtheCommandCenterWorkloadManagementview.

©CopyrightPivotalSoftwareInc,2013-2019 94 6.0.0

Page 95: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AccessingtheWorkloadConfigurationProgrammaticallyTheGreenplumDatabaseworkloadmanagementextension gp_wlm createsatableinthegpperfmondatabasetostoretheworkloadmanagementrules,anduser-definedfunctionstogetorsettheworkloadmanagementrules.

The gpmetrics.workload_config tablestorestheworkloadmanagementrulesasaJSONvalue.Youcanusethe gpmetrics.get_workload_config() andgpmetrics.set_workload_config() functionstoreadandwritethisJSONvalue.

ThistopicisareferencefortheworkloadmanagementconfigurationJSONdocumentandthegetandsetfunctions.

WorkloadManagementRulesJSONFormatThissectiondescribestheJSONobjectthatstorestheresourcegroupassignmentrules.Theobjecthastwomembers:

a version key/valuepair

an assignmentRules arraycontainingoneelementforeachassignmentrule

versionpair

versionThe version valueisaninteger.Itisreservedforfutureuse.Itcanbesetto 1 .

assignmentRulesarray

assignmentRulesThe assignmentRules arrayhasoneelementforeachassignmentrule.EachelementmapstheruletoaresourcegroupinGreenplumDatabaseanddefinestheconditionsthatassignatransactiontothatresourcegroup.

GreenplumCommandCenterevaluateseachruleinthe assignmentRules arrayfromtoptobottomandstopsatthefirstmatch,sotheorderisimportant.

Theelementsinthe assignmentRules arraycanhavethefollowingkey/valuepairs.

resourceGroupNameThenameoftheGreenplumDatabaseresourcegroup.TheresourcegroupmustalreadyexistorhavebeencreatedinGreenplumDatabasewiththeCREATE RESOURCE GROUP SQLstatement.

roleNameThenameofaGreenplumDatabaseroletomatchagainstthecurrentroleidentifierintheGreenplumDatabasesession.ThecurrentroleisinitiallythedatabaserolethatauthenticatedwiththeGreenplumDatabasesystemtobeginthesession.Auserwithsufficientprivilegescanchangethecurrentroleinthedatabasesessionusingthe SET ROLE SQLcommand.

Ifnoroleisspecifiedintheassignmentruleandthequerytagsmatch,thetransactionisassignedtothespecifiedresourcegroup.Ifthe roleNamevalueispresent,however,thecurrentdatabaseusermustmatchthespecifiedrole.

queryTagsAlistofquerytagstomatchagainstthe gpcc.query_tags parameterintheGreenplumDatabasesession.Aquerytagisauser-defined<name>=<value>pair.Separatemultiplequerytagswithsemicolons.Forexample,thefollowingstatement,executedintheGreenplumDatabasesession,setsthe appName and appUser querytagsto“tableau”and“bi_sales”,respectively.

Warning!The gpmetrics.workload_config tableshouldonlybeaccessedbyusingthe gpmetrics.get_workload_config() and gpmetrics.set_workload_config()functionsortheCommandCenteruserinterface.Donotdropthetablewhiletheworkloadmanagementextensionisenabled.

The gpmetrics.set_workload_config() functionrequiresvalidJSONsyntax,butdoesnotvalidatetheworkloadmanagementrules.YoumustensurethattheJSONvaluecontainsa version variableandcorrectlyspecifiedassignmentrules.

©CopyrightPivotalSoftwareInc,2013-2019 95 6.0.0

Page 96: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

=#SETgpcc.query_tagsTO'appName=tableau;appUser=bi_sales';

Tomatch,alltagsintheassignmentrule’s queryTags valuemustbepresentinthe gpcc.query_tags parameterinthedatabasesession.Theorderofthetagsisnotsignificant,andthe gpcc.query_tags parametercanbeasupersetofthetagsdefinedinthe queryTags value.

Ifthe queryTags valueisempty,ortheparameteromitted,therulewillmatcheverysessionforthe roleName databaserole.

Ifyousetthe gpcc.query_tags parameterinsideofatransaction,youmustcommitthetransactionbeforethenewquerytagsareusedtoevaluateassignmentrules.

The gpcc.query_tags parametercanbespecifiedusingthe SET command,asabove,orasaconnectionparameterwithdatabaseclientsthatsupportit,suchas psql .Herearetwoexamplesthatshowhowtospecifyquerytagsonthe psql commandline:

$PGOPTIONS="-cgpcc.query_tags='appName=tableau;appUser=bi_sales'"psql

$psqlpostgresql://mdw:5432/postgres?options="-cgpcc.query_tags%3D'appName%3Dtableau;appUser%3Dbi_sales'"

Inthesecondexample,itisnecessarytocodetheequalssignsas %3D toprevent psql frominterpretingthequerytagsascommand-linearguments.

disabledIfsetto true ,theassignmentruleisignoredwhenCommandCenterevaluatesrulestoassigntransactionstoworkloads.Thisparameterisoptionalanditsdefaultvalueis "false" .

gpmetrics.get_workload_config()RetrievesthecurrentworkloadassignmentrulesasaJSONvalue.

Example

gpperfmon=#SELECTgpmetrics.get_workload_config();get_workload_config--------------------------------------------------------{"version":1,"assignmentRules":[{"resourceGroupName":"admin_group","roleName":"optionalRoleToFilterWith","queryTags":"exampleKey1=exampleValue1;exampleKey2=exampleValue2","disabled":true},{"resourceGroupName":"default_group","queryTags":"exampleKey1=exampleValue1;exampleKey2=exampleValue2","disabled":true}]}(1row)

gpmetrics.set_workload_config()Setstheworkloadassignmentrules.TheargumentisavalidJSONvaluecontainingtheassignmentrules.SeeJSONParametersfordescriptionsoftheparameters.

Ifyoucall gpmetrics.set_workload_config() withinatransaction,youmustcommitthetransactionbeforetheworkloadmanagmentextensionappliesthenewrules.

The gpmetrics.set_workload_config() functionacceptsanyvalidJSONvalue.Youmustensurethatthevaluecontainsa version elementandaproperlyspecifiedassignmentrulesparameter.

©CopyrightPivotalSoftwareInc,2013-2019 96 6.0.0

Page 97: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Example

postgres=#SELECTgpmetrics.set_workload_config('{"version":1,"assignmentRules":[{"resourceGroupName":"default_group","roleName":"gpadmin","queryTags":"appName=tableau;appUser=bi_sales"},{"resourceGroupName":"admin_group","roleName":"gpadmin","queryTags":"appName=tableau;appUser=bi_acct","disabled":true}]}');set_workload_config---------------------t(1row)

©CopyrightPivotalSoftwareInc,2013-2019 97 6.0.0

Page 98: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

TroubleshootingEnablingResourceGroupsIfyouexperienceproblemsenablingresourcegroupsinGreenplumCommandCenter,reviewthefollowinglisttoensureprerequisitesaremetandallofthedependenciesareproperlyconfigured.

RedHat6.xand7.xandCentOS6.xand7.xarecurrentlysupported.

YoumustberunningGreenplumDatabaseversion5.7.0orlater.

ConfiguretheLinuxcgroupskernelfeatureonyourhostsbyfollowingtheinstructionsat“Prerequisite”inUsingResourceGroups .

Makesurethe /etc/cgconfig.d/gpdb.conf filecontainstheobjectsperm,cpu,andcpuacct.Ifthedocumentisincorrectandthe gp_resource_manager

configurationparameterissetto "group" ,GreenplumDatabasecanhangatstartup.

groupgpdb{perm{task{uid=gpadmin;gid=gpadmin;}admin{uid=gpadmin;gid=gpadmin;}}cpu{}cpuacct{}}

OnRedHat7,makesureyourun cgconfigparser-L/etc/cgconfig.d toparsechangestothe /etc/cgconfig.d/gpdb.conf file.Thiscommandmustalsobesetuptorunatboottime.

SettheGreenplumDatabase gp_resource_manager serverconfigurationparameterto "group" andrestartGreenplumDatabase.

$gpconfig-cgp_resource_manager-v"group"$gpstop-ar

Verifybyshowingthevalueoftheparameter:

$gpconfig-sgp_resource_managerValuesonallsegmentsareconsistentGUC:gp_resource_managerMastervalue:groupSegmentvalue:group

AfterinstallingaPivotalGreenplumDatabasedistribution,the shared_preload_libraries configurationparametercontainsthemetricscollectorsharedlibrary.Makesurethislibraryisstillpresent:

$gpconfig-sshared_preload_librariesValuesonallsegmentsareconsistentGUC:shared_preload_librariesMastervalue:metrics_collectorSegmentvalue:metrics_collector

Checkthatthesharedlibraryexistsat $GPHOME/lib/postgresql/metrics_collector.so .Ifthelibrarydoesnotexist,makesureyouhaveinstalledthePivotalGreenplumDatabasedistribution.ThisextensionisnotavailableintheGreenplumDatabaseOpenSourceversion.Ifthesharedlibraryfileexistsinthe $GPHOME/lib/postgresql directory,butnotinthe shared_preload_libraries parameter,additwiththe gpconfig

command:

$gpconfig-cshared_preload_libraries-v'metrics_collector'

Notethatadding metrics_collector tothe shared_preload_libraries parameterdoesnotenablethemetrics_collectororgp_wlmextensions,butisaprerequisiteforenablingthem.

ThegpmonusermustbeabletoconnecttodatabasesfromtheCommandCenterhost.Makesuretoadda host entrylikethefollowinginthe$MASTER_DATA_DIRECTORY/pg_hba.conf file.

hostallgpmon<IP_of_host>/32md5

Checkwhetherthe gp_wlm extensionisinstalled.TheextensionisaddedwhenyouclickEnableWorkloadsintheGreenplumCommandCenter

©CopyrightPivotalSoftwareInc,2013-2019 98 6.0.0

Page 99: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Admin>WorkloadMgmtview.

$psqlgpperfmon\dxgpperfmon=#\dxListofinstalledextensionsName|Version|Schema|Description-------------------+---------+------------+---------------------------------------gp_wlm|0.1|gpmetrics|GreenplumWorkloadManagerExtensionmetrics_collector|1.0|gpmetrics|GreenplumMetricsCollectorExtensionplpgsql|1.0|pg_catalog|PL/pgSQLprocedurallanguage(3rows)

Makesurethe gpmetrics.workload_config tableandfunctionsarepresentinthegpperfmondatabase:

gpperfmon=#\dgpmetrics.workload_configTable"gpmetrics.workload_config"Column|Type|Modifiers----------+---------+-----------dist_col|integer|config|json|Distributedby:(dist_col)

gpperfmon=#\dfgpmetrics.*ListoffunctionsSchema|Name|Resultdatatype|Argumentdatatypes|Type-----------+--------------------------------+------------------+----------------------+--------gpmetrics|get_workload_config|json||normalgpmetrics|metrics_collector_start_worker|void||normalgpmetrics|set_workload_config|boolean|wlm_json_configjson|normal(3rows)

Ifthe gpmetrics.workload_config tableorthefunctionsarenotpresent,droppingandrecreatingthegp_wlmextensionwillcreatethem.Notethatanyassignmentrulessavedinthe gpmetrics.workload_config tablewillhavetoberecreatedinCommandCenter.

$psqlgpperfmongpperfmon=#DROPEXTENSIONgp_wlm;DROPEXTENSIONgpperfmon=#CREATEEXTENSIONgp_wlm;CREATEEXTENSION

©CopyrightPivotalSoftwareInc,2013-2019 99 6.0.0

Page 100: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

QueryMonitorHelpTopicsCPU

CPUSkew

Locks

QueryOptimization

Memory

SpillFiles

©CopyrightPivotalSoftwareInc,2013-2019 100 6.0.0

Page 101: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

CPUTheCPUpercentmetricistheaveragecurrentCPUpercentageforallbackendprocessesexecutingthisquery.Thepercentagesforallprocessesrunningaqueryoneachsegmentareaveraged,andthentheaverageofallthosevaluesiscalculatedtorenderthismetric.

YoucanmanagethepercentageofCPUthatqueriescanconsumebycreatingworkloadsandspecifyingthemaximumpercentofCPUeachworkloadcanconsume.Thatpercentageisfurtherdividedamongthesegmentsrunningoneachhostandthenamongtheconcurrentqueriestheworkloadcanexecute.

CPUallocatedtoidleworkloadsisreallocatedtoactivequeriesandreclaimedwhentheidleworkloadbecomesactiveagain.ThismeansthattheCPUpercentvalueforaquerycanexceedlimitsdefinedforworkloadsandcanincreaseanddecreaseasotherqueriesstartorfinish.

MemoryanddiskI/OresourcesaremorelikelycausesfordegradedqueryperformancethanlackofCPUcycles.ThewaystoreduceCPUcontentionmirrorthesolutionsforinsufficientmemory:

ReduceconcurrencyofworkloadstomakemoreCPUavailabletoeachquery.

ReducethenumberofworkloadsandreallocateCPUtotheremainingworkloads.

IfCPUisnotconstrainedandthesizeofspillfilesforsomequeriesisverylarge,makesurethatthe gp_workfile_compress_algorithm serverconfigurationparameterissetto zlib andnot none .CompressingspillfilesreducesdiskI/O,butusesCPUcylestocompressanddecompressthedata.

SeeUsingResourceGroups formoreaboutmanagingperformancewithresourcegroups.

IfyourGreenplumDatabasesystemisconfiguredtomanageresourceswithresourcequeues,seeUsingResourceQueues .

©CopyrightPivotalSoftwareInc,2013-2019 101 6.0.0

Page 102: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

CPUSkew

WhatisCPUSkew?CPUskewoccurswhentheworktoexecuteaqueryisnotdistributedevenlyamongthesegments.

TheCPUmetricistheaverageoftheCPUpercentagesusedbyeachprocessexecutingthequery.TheCPUskewmetricisavariancestatisticbasedonthedifferencebetweentheaverageandeachsegment’scurrentCPUmetric.ThesmallertheCPUskew,themoreequallytheworkisdistributed.TheCPUskewmetricvariesbetween0.0(noskew)and1.0.Thelowertheskewmetricthemorefullythedatabasecluster’sresourcesareutilized.

CPUskewisusuallyrelatedtothevolumeofdataprocessedbythesegmentswhileexecutingthequeryexecutionplan.Therearetwotypesofskewyoushouldinvestigate:dataskewandcomputationalskew.

DataSkewAhighCPUskewmaybeanindicationofdataskew,wheretablesusedbythequeryaredistributedunevenly,sothatsomesegmentshavemoredatatoprocessthantheirpeers.Youcancheckfordataskewinatablebyrunningaquerylikethisone:

=#SELECTgp_segment_id,COUNT(*)FROM<table-name>GROUPBYgp_segment_id;

Therowcountshouldbeapproximatelyequalforeachsegment.Iftherowsaredistributedunevenly,checkthedistributionkeyforthetable.Agooddistributionkeyisacolumnorlistofcolumnswithuniqueornearlyuniquevalues,suchasthetable’sprimarykey.SettingthedistributionpolicytoDISTRIBUTEDRANDOMLY alsoensuresawell-distributedtable,butprecludestakingadvantageofperformance-enhancingstrategiessuchasco-locationfortableswithequivalentprimarykeys.

ComputationalSkewHighCPUskewcanbetheresultofcomputationalskew,whichoccursduringqueryexecution.Someoftheoperationsinthequeryplancancausesomesegmentstodomoreworkthanothers.Forexample,joins,sorts,oraggregationsoncolumnswithlowcardinalityorunevenlydistributedvaluescancontributetoCPUskewbycausingsomesegmentstoprocessmanymoretuplesthanothers.

SeeDistributionandSkew intheGreenplumDatabaseAdministratorGuideandTuningSQLQueries intheGreenplumDatabaseBestPracticesguideformorehelpfindingthecausesofskew.

©CopyrightPivotalSoftwareInc,2013-2019 102 6.0.0

Page 103: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

LocksGreenplumCommandCenterdisplaysthelockscurrentlyheldbyqueriesandqueriesblockedbylocks.

Ablockoccurswhenonequeryneedstoacquirealockthatconflictswithalockheldbyanotherquery.Ifaqueryisblockedforalongperiodoftime,youcaninvestigatetheblockingqueryand,ifnecessary,canceloneofthequeries.

Lockscanbeacquiredusingthe LOCKTABLE SQLstatement.SomeSQLcommandsacquirelocksautomatically.Followingaredescriptionsofthelockmodes,theGreenplumDatabasecommandsthatacquirethem,andwhichlockmodesconflictwiththem.

ACCESSSHAREAcquiredby SELECT and ANALYZE commands.

ConflictswithACCESSEXCLUSIVElocks.

Ingeneral,anyquerythatonlyreadsatableanddoesnotmodifyitacquiresthislockmode.

ROWSHAREAcquiredby SELECT FOR SHARE command.

ConflictswithEXCLUSIVEandACCESSEXCLUSIVElocks.

AROWSHARElockisplacedonthespecifiedtableandanACCESSSHARElockonanyothertablesreferencedinthequery.

ROWEXCLUSIVEAcquiredby INSERT and COPY commands.

ConflictswithSHARE,SHAREROWEXCLUSIVE,EXCLUSIVE,andACCESSEXCLUSIVElocks.

AROWEXCLUSIVElockisplacedonthespecifiedtableandACCESSSHARElocksareplacedonanyotherreferencedtables.

SHAREUPDATEEXCLUSIVEAcquiredby VACUUM and VACUUM FULL .

ConflictswiththeSHAREUPDATEEXCLUSIVE,SHARE,SHAREROWEXCLUSIVE,EXCLUSIVE,andACCESSEXCLUSIVElocks.

SHAREUPDATEEXCLUSIVEprotectsatableagainstconcurrentschemachangesand VACUUM runs.

SHAREAcquiredby CREATE INDEX .

ConflictswithROWEXCLUSIVE,SHAREUPDATEEXCLUSIVE,SHAREROWEXCLUSIVE,EXCLUSIVE,andACCESSEXCLUSIVElocks.

Protectsatableagainstconcurrentdatachanges.

SHAREROWEXCLUSIVEThislockmodeisnotautomaticallyacquiredbyanyGreenplumDatabasecommand.

ConflictswithROWEXCLUSIVE,SHAREUPDATEEXCLUSIVE,SHARE,SHAREROWEXCLUSIVE,EXCLUSIVE,andACCESSEXCLUSIVElocks.

EXCLUSIVEAcquiredby UPDATE , SELECT FOR UPDATE ,and DELETE commandsinGreenplumDatabase.

ConflictswithROWSHARE,ROWEXCLUSIVE,SHAREUPDATEEXCLUSIVE,SHARE,SHAREROWEXCLUSIVE,EXCLUSIVE,andACCESSEXCLUSIVElocks.ThislockmodeallowsonlyconcurrentACCESSSHARElocks-atablecanbereadbyanothertransactionwhilethislockisheld.ThisismorerestrictivelockingthaninregularPostgreSQL.

ACCESSEXCLUSIVEAcquiredbythe ALTER TABLE , DROP TABLE , TRUNCATE , REINDEX , CLUSTER ,and VACUUM FULL commands.DefaultlockmodeforLOCK TABLE statementsthatdonotspecifyalockmode.Alsobrieflyacquiredby VACUUM (without FULL )onappend-optimizedtablesduringprocessing.

Conflictswithalllocks.

Thislockmodeguaranteesthattheholderistheonlytransactionaccessingthetableinanyway.

FormoreonlocksinGreenplumDatabasequeries,seetheLOCK commandReference.SeealsoTuningSQLQueries .

©CopyrightPivotalSoftwareInc,2013-2019 103 6.0.0

Page 104: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

©CopyrightPivotalSoftwareInc,2013-2019 104 6.0.0

Page 105: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

MemoryTheGreenplumCommandCenterQueryMonitorreportsthecurrenttotalmemoryconsumedbyallprocessesexecutingaquery.Whenthereisinsufficientmemoryavailableforaquerytocomplete,thequeryhasanerrorstatusinthequerymonitorandanoutofmemoryerrorislogged.

IfyouhaveenabledresourcegroupsinGreenplumDatabase,youcanmanagetheamountofmemoryavailabletoqueriesbytuningresourcegroupparameters,andbysettingGreenplumDatabaseconfigurationparametersthataffectresourcegroupmemory.

Foradetaileddescriptionofresourcegroupmemorymanagement,seeUsingResourceGroups intheGreenplumDatabaseAdministratorGuide.

Ifyouareusingresourcequeues,seeMemoryandResourceManagementwithResourceQueues andUsingResourceQueues forwaystotroubleshootmemoryproblemswithresourcequeues.

SeeTuningSQLQueries forhelpwithqueryoptimization.

ThefollowingsummarydescribestheresourcegroupparametersandrelatedGreenplumDatabaseserverconfigurationparametersthatdeterminetheamountofmemoryavailabletodatabasequeriesandhowconfigurationchoicesaffectconcurrency,spillfileusage,andqueryperformance.

ResourceGroupMemoryConfigurationParametersAresourcegrouphasparameters CONCURRENCY , MEMORY_LIMIT , MEMORY_SHARED_QUOTA ,and MEMORY_SPILL_RATIO ,whichdeterminehowmuchmemoryisallocatedtoexecuteaquery.The CPU_LIMIT parameterhasnoeffectonmemoryallocation.Seethe CREATERESOURCEGROUP

SQLreferenceforcommandsyntaxandinformationabouttheseparameters.

MEMORY_LIMIT

Thisparametersetstheamountofmemorytheresourcegroupmanagesasapercentageofthememoryavailabletoresourcegroups.Thesumofallresourcegroups’ MEMORY_LIMIT smustnotexceed100.Ifthesumofallresourcegroups’ MEMORY_LIMIT sislessthan100,theremaining,unallocatedmemoryisglobalresourcegroupsharedmemory,availabletoqueriesfromallresourcegroupsonafirst-come,first-servedbasis.

MEMORY_SHARED_QUOTA

Aresourcegroupdividesthememoryitmanagesintoafixedportionandasharedportion,calledresourcegroupsharedmemory.Thisparameterspecifiesthepercentageofaresourcegroup’smemorythatisshared.Thedefaultis20andthevaluecanrangefrom0to100.

CONCURRENCY

Thisparameterlimitsthenumberofconcurrenttransactionsaresourcegroupallows.Thefixedportionofthememorytheresourcegroupmanagesisdividedequallyamong CONCURRENCY transactionslots.Everytransactionstartswiththisfixedportionofmemoryand,ifneeded,GreenplumDatabaseusesadditionalmemoryfromtheresourcegroupsharedmemoryandglobalresourcegroupsharedmemory.

MEMORY_SPILL_RATIO

Thisparametersetsalimitfortheamountofmemoryaquerycanusebeforeitspillstodisk.Theparametervalueisexpressedasapercentageofthefixedmemoryallocation.Thedefaultis20andthevaluecanrangefrom0to100.Ahighervalueusesmorememory,butcanimprovequeryperformance.Atransactioncanoverridethisvaluebysettingthe memory_spill_ratio configurationparameterinthesession.

Whenaqueryexecutes,GreenplumDatabaseallocatesmemorytoitfromthefixedportionoftheresourcegroup’smemory.Ifthequeryneedsmorememoryandtheresourcegrouphasavailablesharedmemory,GreenplumDatabaseallocatesadditionalmemory.Ifinsufficientsharedmemoryisavailable,GreenplumDatabaseallocatesadditionalmemoryfromglobalsharedmemory,ifavailable.Iftherequiredmemoryisnotavailablethetransactionfails.

GreenplumDatabaseMemoryConfigurationParametersThefollowingGreenplumDatabaseconfigurationparametersaffectresourcegroupmemoryallocationandconcurrency.

gp_resource_group_memory_limit

ThisGreenplumDatabaseserverconfigurationparametersetsthepercentageofeachhost’ssystemmemorytobemanagedbyresourcegroups.Thedefaultis 0.7 (70%).Thismemoryisdividedequallyamongtheprimarysegmentsoneachhost,andfurtherdividedamongresourcegroupswiththe MEMORY_LIMIT resourcegroupparameter.Anymemorynotallocatedtoresourcegroupsbecomesglobalsharedmemoryavailabletoqueriesfromallresourcegroups.See gp_resource_group_memory_limit foracompletereferenceforthisparameter.

gp_resgroup_memory_policy

ThisparameterdetermineshowGreenplumDatabaseallocatesmemorytoqueryoperators.Thedefaultvalue, eager_free ,re-allocatesmemoryfromcompletedoperatorstooperatorslaterinthequeryplan.Thealternativevalueforthisparameter, auto ,allocatesafixedamountofmemorytooperatorsthatarenotmemory-intensiveandtheresttothememory-intensiveoperators.Thedefaultvalueisusuallytheoptimalsetting.Seegp_resgroup_memory_policy foracompletereferenceforthisparameter.

©CopyrightPivotalSoftwareInc,2013-2019 105 6.0.0

Page 106: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

memory_spill_ratio

Atransactioncanoverridetheresourcegroup’s MEMORY_SPILL_RATIO valuebysettingthe memory_spill_ratio configurationparameterinthesession.Thevalueisapercentageofthefixedmemoryallocationfortransactionsintheresourcegroup,expressedasanintegerfrom0to100.Theperformanceofquerieswithlowmemoryrequirementscanbeimprovedbysettingthe memory_spill_ratio parameterinthesessiontoalowsetting,forexample0to2.See memory_spill_ratio formoreinformationaboutthisparameter.

©CopyrightPivotalSoftwareInc,2013-2019 106 6.0.0

Page 107: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

QueryPlanExecutionTheGreenplumDatabaselegacyandGPORCAqueryoptimizersgenerateexecutionplansthatproducetheresultsrequestedbythequery.Aplanisasequenceofoperators,suchastablescans,joins,sorts,aggregates,anddatamotions.

WhenyouselectaqueryontheCommandCenterQueryMonitorview,aQueryDetailsviewpresentsagraphicalrepresentationoftheexecutionplan.

YoucanswitchbetweenthegraphicalandtexualrepresentationsofthequeryexecutionplanbyselectingthePlan&ProgresstabortheTexualPlantab.Inthetextualformat,eachplannodeisflaggedwithanarrow( -> ).Inthegraphicalview,thenodesarerepresentedbyboxesthatfillastheplanexecutes.

Aqueryexecutionplanexecutesfromthebottomup.Eachnodeintheplanperformsanoperationandpassesresultsuptothenextnodeintheplan.

The Optimizerstatus: lineontheTextualPlantabreportswhethertheexplainplanwasgeneratedusingtheGPORCAoptimizerorthelegacyqueryoptimizer.

SlicesandGangsSegmentscanworkonportionsofaqueryinparallel,eachsegmentexecutingoperatorsindependentlyontheirlocaldata.Whentheplanrequiresexchangingdatabetweensegments,adatamotionoperatorcoordinatesthedatatransferbetweensegments.Theplanisdividedinto“slices”wherethesedatamotionsoccur.

Adatamotionnodeinatextualqueryplanidentifiesthesliceandthenumberofsegmentsparticipatinginthemotion.

Example:

->BroadcastMotion4:4(slice2;segments:4)(cost=0.00..867.15rows=10000width=30)

Inabroadcastmotion,eachsegmentbroadcastsallofitsrowsforatableoverthenetworksothateverysegmenthasacompletecopyofthetable.Inthisexample,thebroadcastmotionmarksthecompletionof slice2 withfoursegmentssendingandfoursegmentsreceiving.

Eachsegmenthasoneormorebackendprocessesworkingonaslice.Backendprocessesworkingonthesameslicearecalleda“gang”.

OperatorsOperatorsareprocessesthattakeasinputdatabasetablesortheoutputfromotheroperators,andperformsomeactiontoproduceatransformedoutput.

ScanOperators

InitplanAquerythatrunsbeforethemainqueryisoptimizedtofindthepartitionstoscan.

SequentialscanTheoptimizermaychooseasequentialtablescanifthereisnoindexontheconditioncolumnorifmostrowsareexpectedtosatisifythecondition.Becauseeachsegmentscansanequalportionofthedatainparallelwithothersegments,atablescaninGreenplumDatabaseisveryefficient.Aqueryonapartitionedtablemaybeabletoeliminatepartitionstomakethescanevenfaster.

Append-onlyscanScansrowsinarow-oriented,append-optimizedtable.

Append-onlycolumnarscanScansrowsinacolumn-oriented,append-optimizedtable.

DynamictablescanScansselectedpartitionsinapartitionedtable.

FunctionscanAFunctionScannodeselectsthepartitionstoscan.Thefunctioncanbeoneofthefollowing:

©CopyrightPivotalSoftwareInc,2013-2019 107 6.0.0

Page 108: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

gp_partition_expansion -choosesallnodes

gp_partition_selection -choosesapartitionwithanequalityexpression

gp_partition_inversion -choosespartitionswitharangeexpression

IndexscanScansaB-treeindexonatabletofindrows.Therowsarethenretrievedfromdisk.

BitmapindexscanABitmapIndexScanisanindexscanoptimizedbystoringrowsinabitmapinsteadofretrievingthemfromthetableimmediately.Whenthescaniscomplete,rowsinthebitmapareretrievedwithaBitmapHeapScanoperation.

BitmapAndandBitmapOrGeneratesanewbitmapbyrunninglogicalANDorORonmultiplebitmaps.

BitmapheapscanRetrievesrowsfromheapstorageusingabitmapgeneratedbyaBitmapindexscanorBitmapAndorBitmapOroperation.

NestedloopwithinnersequentialscanjoinForeachrowinthefirsttable,theoperatortestseveryrowinthesecondtablewithasequentialscan.

Onetablemustbebroadcastsothateverysegmentcancompareallrowsofonetablewiththerowsithasfromtheothertable.Thisisexpensiveandisbestusedonlyforsmalltables.

NestedloopwithinnerindexscanForeachrowinthefirsttable,theoperatorsearchesanindexonthesecondtable.

Onetablemustbebroadcastsothateverysegmentcancompareallrowsofonetablewiththerowsithasfromtheothertable.

AppendConcatenatesdatasets.Forexample,combinesrowsscannedfrommultiplepartitions.

FilterSelectsrowsusinga WHERE clause.

LimitLimitsthenumberofrowsreturned.

MaterializeSavesresultsfromasubselectsothatitisnotnecessarytoprocesstheinnertableforeveryrowintheoutertable.

JoinOperators

HashjoinCreatesahashtableonthejoinkeyofthesmallertable.Scansthelargertableandlooksupmatchingrowsinthehashtable.Hashjoinisveryfast.Thehashtableisheldinmemory,soahashjoincanusealotofmemory,dependingonthesizeofthesmallertable.

SortmergejoinThetablestobejoinedaresortedonthejoinattributeandthenscannedinparalleltofindthematchingvalues.Thisisagoodjoinmethodfortablesthataretoolargetouseahashjoin.

ProductjoinJoinseveryqualifyingrowinthefirsttablewitheveryqualifyingrowinthesecondtable.Thistypeofjoincanbeveryexpensiveifspillfilesmustbeused.

SortandAggregateOperators

SortSortsrowstoprepareforoperationssuchasanaggregationormergejoin.

GroupbyGroupsrowsbyoneormorecolumns.

Group/hashaggregate

©CopyrightPivotalSoftwareInc,2013-2019 108 6.0.0

Page 109: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Aggregatesrowsusingahash.

MotionOperatorsBroadcastmotion

Everysegmentsendsitsownlocaldatatoallothersegmentinstancessothateverysegmentinstancehasacompletelocalcopyofthetable.

RedistributionmotionSendsdatafromonetabletoanothersegmentsothatmatchingrowsarelocatedtogether,enablingalocaljoin.

GathermotionAllsegmentssendrowstothemasterwheretheyaregatheredintoasingleresultset.

DMLOperatorsAssert

Performsconstraintschecking.

SplitUsedforupdateoperations.

©CopyrightPivotalSoftwareInc,2013-2019 109 6.0.0

Page 110: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SpillFilesGreenplumCommandCenterreportsthetotalsizeforallspillfilescreatedforaquery.

GreenplumDatabasecreatesspillfiles,alsocalledworkfiles,tosaveintermediateresultswhenthereisinsufficientmemorytoexecuteaqueryinmemory.DiskI/Oismuchslowerthanmemoryaccess,soaquerythatcreatesspillfileswilltakelongertocomplete.

InvestigatingSpillFileUsageThe gp_toolkit schemacontainsviewsyoucanusetoseedetailsaboutspillfileusageforcurrentqueries.Youcanseethenumberandsizesofspillfilescreatedforeachoperatorinaqueryexecutionplan,andtotalsbyqueryandsegment.Thisisusefulinformationtodetectdataskewandtohelptunequeries.

Seethegp_toolkitAdministrativeSchema referencefordescriptionsoftheseviews.

EliminatingorReducingSpillFilesYoucanworktoeliminatespillfilesbyincreasingtheamountofmemoryavailabletothequeryorbyoptimizingthequerytousethememoryavailablemoreefficiently.

Youmaybeabletorevisethequerytopreventspillingbyeliminatingorpostponingmemory-intensiveoperators.

FollowingaresomewaystoincreasememoryavailabletoquerieswhenresourcegroupresourcemanagementisenabledinGreenplumDatabase.

Decreasetheresourcegroup’sconcurrencysothateachquery’sshareofmemoryincreases.

Increasetheresourcegroup’s MEMORY_SHARED_QUOTA parametertoincreasetheamountofresourcegroupsharedmemory.

Decreasethepercentageofmemoryallocatedtoallresourcegroupstoincreasetheamountofglobalsharedmemory.

Whenresourcequeueresourcemanagementisactive,GreenplumDatabasecandetectandterminate“runaway”queriesthatconsumeahighpercentageofavailablememory.Youcanpreventrunawayqueriesbylimitingthenumberofspillfilescreatedorthetotalsizeofspillfilescreated.Seethegp_workfile_limit* configurationparametersbelowformoreinformation.

Ifyoucannotpreventqueriesfromspilling,itisimportanttoensurethatthenumberofspillfilescreatedismnimizedandthatproblemssuchasCPUordataskewarefoundandcorrected.Skewcancreateexcessivenumbersofspillfilesononeormoresegments.

TominimizediskusageandI/Owhenspillfilesarecreated,makesurethe gp_workfile_compress_algorithm configurationparameterissetto‘zlib’andnot'none’.

LimitingSpillFileswithServerConfigurationParametersGreenplumDatabasebydefaultlimitsthenumberofspillfilesallowedperqueryforeachsegmentto100,000.Youcanraiseorlowerthislimit,andyoucanalsolimitthenumberofspillfilesforallqueriesonasegment,andlimitthediskspaceconsumedbyspillfilesperqueryandpersegment.UsethefollowingGreenplumDatabaseserverconfigurationparameterstomanagespillfiles.

gp_workfile_limit_files_per_query

Setsthemaximumnumberofspillfilesallowedperquerypersegment.Defaultis100,000.

gp_workfile_limit_per_query

Setsthemaximumdisksizeanindividualqueryisallowedtouseforspillfilesateachsegment.Thedefaultvalueis0,whichmeansnolimitisenforced.

gp_workfile_limit_per_segment

Setsthemaximumtotaldisksizethatallrunningqueriesareallowedtouseforcreatingspillfilesateachsegment.Thedefaultvalueis0,whichmeansalimitisnotenforced.

gp_workfile_compress_algorithm

Specifiesthecompressionalgorithmtouseforspillfileswhenahashaggregationorhashjoinoperationspillstodiskduringqueryprocessing.Thedefaultis 'none' .Setto 'zlib' toenablecompression.UsingcompressionreducesthenumberofI/OoperationsattheexpenseofincreasedCPU.

©CopyrightPivotalSoftwareInc,2013-2019 110 6.0.0

Page 111: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

SeealsoManagingSpillFilesGeneratedbyQueries .

©CopyrightPivotalSoftwareInc,2013-2019 111 6.0.0

Page 112: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AlertHelpTopicsSegmentfailure

Averagememory(segmenthosts)exceeds[%]for[min]

Memory(master)exceeds[%]for[N]minutes

Totaldiskspaceexceeds[%]full

Queryisblockedfor[N]minutes

Numberofconnectionsexceeds[N]

AverageCPU(master)exceeds[%]for[N]min

Outofmemoryerrors

Queryruntimeexceeds[N]minutes

AverageCPU(segmenthosts)exceeds[%]for[N]minutes

Spillfilesforaqueryexceeds[GB]

©CopyrightPivotalSoftwareInc,2013-2019 112 6.0.0

Page 113: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Segmentfailure

Whatisthisalert?CommandCenterchecksthestatusoftheGreenplumDatabasesegmentsevery30secondsandraisesanalertifanysegmentsaredownorrunningintheirnon-preferredroles.Thisalertwillberaisedhourlyuntilanadministratorhasrecoveredthefailedsegments.

Withsegmentmirroringenabled,GreenplumDatabasecantolerateaprimaryormirrorsegmentfailureaslongasthereisaworkinginstanceforeverysegmentinthecluster.Ifboththeprimaryandmirrorinstancesfailforanysinglesegment,GreenplumDatabasecannotrunqueries.Forthisreason,itisimportanttorecoverthefailedsegmentinstancetoprotectfromlossofservice.

Segmentinstanceshavea“preferredrole,”eitherprimaryormirror.Whenallsegmentinstancesareintheirpreferredroles,eachsegmenthosthasthesamenumberofprimaryandmirrorsegments.Ifaprimaryinstancefails,itsmirrorinstanceassumestheprimaryroleandthedistributionofprimarysegmentsisnolongerbalanced.Thiscanslowdownqueryprocessingbecauseahostwithmoreprimarysegmentsthanotherscantakelongertocompletequeries.

WhattodoRestorethefailedsegmentsandreturnthesegmentstotheirpreferredrolessothattheclusterisinbalance.

SeeRecoveringFromSegmentFailures forstepstorecoverGreenplumDatabasesegments.

©CopyrightPivotalSoftwareInc,2013-2019 113 6.0.0

Page 114: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Averagememory(segmenthosts)exceeds[%]for[min]

Whatisthisalert?ThisalertwarnsofhighmemoryconsumptionontheGreenplumDatabasesegmenthostsforanextendedperiod.

Every15seconds,theGreenplumDatabasemetricscollectorextensionsamplesthememoryinuseoneachsegmenthost.Memoryusedforkernelcacheandbuffersisexcluded.Theaverageforallsegmentsiscalculated.Iftheaveragepercentageremainsabovethethresholdthatissetforthealertforthenumberofminutesspecified,analertisissued.

Ifmemoryconsumptionisincreasingovertime,queriescouldstarttofailewithoutofmemoryerrors.

Whattodo?ChecktheQueryMonitortoseeifthereisunusuallyheavyqueryactivity.

Lookforactivequeriesthatperformhashjoinsorsortsonalargenumberoftuples.Ifpossible,optimizethequeriestoeliminaterowsearliersothatthesememory-intensiveoperationsprocessafewernumberoftuples.

Adjustresourcequeuesorresourcegroupstolimitthenumberofconcurrenttransactions.

Usethe ps commandtoidentifynon-databaseprocessesconsumingexcessivememory.Killunnecessaryprocessesormovethemtoanotherserver.

©CopyrightPivotalSoftwareInc,2013-2019 114 6.0.0

Page 115: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Memory(master)exceeds[%]for[min]

Whatisthisalert?Whenthemasterhostmemoryusageishigherthanthespecifiedpercentageformorethanthespecifiednumberofminutes,CommandCenterraisesanalert.

CommandCentersamplesthememoryinuseonthemasterhosteveryfifteenseconds.Memoryusedforkernelbuffersandcacheisexcludedfromthecalculation.Analertisraisedifthesamplescollectedduringthenumberofminutesspecifiedareallhigherthanthespecifiedpercentage.

WhattodoUsethe ps commandtoidentifynon-databaseprocessesconsumingexcessivememoryandstopthemorrelocatethemtootherservers.

IfCommandCenterisrunningonthemasterhost,restartitonthestandbymasterhost.

©CopyrightPivotalSoftwareInc,2013-2019 115 6.0.0

Page 116: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Totaldiskspaceexceeds[%]

Whatisthisalert?Thisalertisraisedwhenthepercentageofsegmenthostdiskspaceinuseexceedsthepercentagespecifiedinthealertrule.Themasterdiskspaceisnotincludedinthecalculation.Thealertisraisedonceadayuntilthepercentagedropsbelowthepercentageinthealertrule.

WhattodoThisalertwarnsyousothatyoucanadddiskstorageorfreeupstorageinordertopreventacatastrophicdiskfullerrorthatcouldinterruptGreenplumDatabaseservice.

HerearesomesuggestionsforfreeingspaceonGreenplumDatabasehosts.

Archiveandremovebackupfiles

Archiveanddropolderpartitions

RotateOSanddatabaselogfiles

Dropunneededexternaltablesandtheirdatafiles

Vaccuumdatabasetablesandcatalogtables

©CopyrightPivotalSoftwareInc,2013-2019 116 6.0.0

Page 117: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Queryisblockedfor[min]

Whatisthisalert?Ifaquerythathasstartedtoexecuteisblockedbyanotherqueryforthespecifiednumberofminutes,CommandCenterraisesanalert.

Queriesthatarequeued,buthavenotyetstarted,donottriggerthisalert.

AlertdetailsThealertcontainstheQueryID,databasenameanduser,andrun-timedetails.

Qid":{“Tmid”:1541113373,“Ssid”:6968,“Ccnt”:3},“Database”:“postgres”,“User”:“gpmon”,“SubmitTime”:“2018-11-02T16:10:04+08:00”,“StartTime”:“2018-11-02T16:10:04+08:00”,“QueryText”:“”}

NeedalerttypespecificJSONexampletowritethisout

Whattodo1. UsetheQueryMonitortolocatetheblockedqueryandthequerythatblocksit.

2. Determinewhethertheblockingqueryisexecutingproperly:

-Isthequeryalsoblocked?-Isthequeryblockingalargenumberofotherqueries?-Isthequerycreatingexcessivespillfiles?-Isthequeryrunninginthecorrectresourcegrouporresourcequeue?-Isthequeryrunninglongerthanusual?-DoesthequeryhaveexcessivedataorCPUskew?

1. Determinewhetheryoushouldallowthequerytocomplete,orcancelthequerysothattheblockedqueriescanresume.

©CopyrightPivotalSoftwareInc,2013-2019 117 6.0.0

Page 118: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Numberofconnectionsexceeds[n]

Whatisthisalert?ThisalertisraisedwhenthenumberofconcurrentconnectionsattheGreenplumDatabasemasterinstanceexceedsaspecifiednumber.Thenumberspecifiedshouldbesetlowerthanthe max_connections serverconfigurationparametersothatwhenyoureceivethealertyoucanactbeforeGreenplumDatabasebeginstorejectclientconnectionrequests.Forexample,if max_connections forthemasterissetto100,youcouldsetanalertto80.

Whattodo

LookforidleorstaleconnectionsandterminatethemUserscanconnecttoGreenplumDatabaseusingaclientsuchas psql ,executequeriesandremainconnected,butinactive,leavingtheconnectioninanidlestate.GreenplumDatabaseeventuallyreleasesresourcesusedbyidleconnections,butoncethemaximumnumberofallowedconnectionshasbeenreached,newconnectionrequestsaredenied.

Usethe pg_stat_activity systemviewtofindidleconnections.

SELECTdatname,procpid,sess_id,usename,current_queryfrompg_stat_activity;

Usethe pg_cancel_backend(<PID>) functiontocancelidleconnections.

DetermininghowlongaconnectionhasbeenidleisnotpossiblewithjusttheinformationintheGreenplumDatabase5.xsystemtables.Youcan,however,seethisinformationbycreatingthe session_level_memory_consumption viewinthedatabase.FollowtheinstructionsatViewingSessionMemoryUsageInformation tocreatethisviewineachdatabase.

Afteryouinstallthe session_level_memory_consumption view,aquerylikethefollowingshowstheidleconnectionswiththelengthoftimetheyhavebeenidle.

SELECTa.datname,application_name,a.usename,a.sess_id,procpid,now()-idle_startAStime_idleFROMpg_stat_activitya,session_state.session_level_memory_consumptionbWHEREa.sess_id=b.sess_idANDb.idle_start<now();ORDERBYtime_idleDESC;

©CopyrightPivotalSoftwareInc,2013-2019 118 6.0.0

Page 119: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

CPU(master)exceeds[%]for[min]

Whatisthisalert?ThemetricscollectorextensionchecksCPUutilizationonthemasterhostevery15seconds.IfthepercentageofCPUinuseishigherthanthepercentagespecifiedinthealertruleforthenumberofminutesspecifiedintherule,CommandCenterraisesanalert.

TheGreenplumDatabasemasterusesthegreatestamountofCPUatthestartofaquery,whileplanningthequery,andattheendofthequery,whilegatheringresultsfromthesegments.Foralargeresultsetitisnormaltoseeaspikeinthequery’sCPUusageonthemasterduringthegatheroperation.Withmanyqueriesrunningconcurrently,theCPUspikesshouldevenout.

WhattodoBeginbyviewingtheCommandCenterQueryMonitorandQueryDetailsviewstoseeifthereareoneormoreverylargequeriesnearingcompletion,orifthehighusagecanbeexplainedbyunusualworkloadsorheavyqueryactivity.

IfthequerymonitoroffersnoexplanationforhighCPUusage,youshouldinvestigatemasterhostprocessesusingLinuxutilitiessuchasps and top toidentifyprocessesconsumingtheCPU.IftheprocessIDofanerrantprocessisa postgres process,youcanquerythe pg_stat_activity systemtabletofindthequeryand,ifneeded,usethe pg_terminate_backend() functiontoterminatethequery.

SeealsoInvestigatingaPerformanceProblem

©CopyrightPivotalSoftwareInc,2013-2019 119 6.0.0

Page 120: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Outofmemoryerror

Whatisthisalert?Ifaqueryrequestsadditionalmemoryandisdenied,thequeryfailswithanoutofmemoryerrorandanalertisraised.

WhattodoGreenplumDatabasehastwowaystomanagememoryresources:resourcequeuesandresourcegroups.Resourcequeuesdealprimarilywithfixedquantitiesofmemory,whereresourcegroupsdealwithportions—percentages—ofavailablememory.

Ifyouuseresourcegroupstomanagememory,youcanusetheAdmin>WorkloadMgmtviewtoadjustthemsothatmorememoryisavailabletoqueriesthatarefailingduetooutofmemoryerrors.Ifyouuseresourcequeues,youusethe CREATERESOURCEQUEUE and ALTERRESOURCEQUEUE SQLcommandstoconfigurethem.

Therearemanyfactorstoconsiderwhenallocatingmemoryforqueries,includingconfiguringtheoperatingsystem,allocatingashareofmemorytoGreenplumDatabase,andconfiguringasetofresourcequeuesorresourcegroupstosharethememoryavailabletoGreenplumDatabase.

ForcompleteinformationabouthowGreenplumDatabasemanagesmemoryandhowtoconfigureit,see:

UsingResourceGroups

UsingResourceQueues

©CopyrightPivotalSoftwareInc,2013-2019 120 6.0.0

Page 121: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Queryruntimeexceeds[min]

Whatisthisalert?Analertisraisedifthetotalruntimeforaqueryisgreaterthanthespecifiednumberofminutes.Thealertisraisedonceperquery.

Runtimeiscalculatedfromthetimethequerybeginstoexecute.Thetimethequerywasqueuedisexcluded.

AlertdetailsqueryID

databasename

username

timethequerywassubmitted

timethequerystarted

WhattodoUsetheQueryMonitortochecktheexecutionstatusofthequery.

Ifthequeryisblocked,investigatethequeriesthatholdthelocks.

©CopyrightPivotalSoftwareInc,2013-2019 121 6.0.0

Page 122: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

AverageCPU(segmenthosts)exceeds[%]for[min]

Whatisthisalert?CommandCentersamplesCPUusageonallsegmenthostsevery15secondsandcalculatestheaverageCPUusageforthecluster.AnalertisraisediftheaverageCPUusageisgreaterthanthespecifiedpercentageforlongerthanthespecifiednumberofminutes.

WhattodoUsetheCommandCenterQueryMonitortoidentifycurrentlyrunningindividualquerieswithhighCPUusage.

UsetheCommandCenterHistoryviewtoseeCPUloadduringtheperiodpriortothealertandidentifycompletedqueriesusingtoomuchCPU.

CheckCPUusageusingoperatingsystemutilitiessuchas ps and top toidentifyanyoperatingsystemprocessesthatareconsumingexcessiveCPU,forexamplebackup,restore,orETLprocesses.

©CopyrightPivotalSoftwareInc,2013-2019 122 6.0.0

Page 123: Pivotal Greenplum Command Center · Pivotal Greenplum Command Center is a management tool for the Pivotal Greenplum Database Big Data Platform. This topic introduces key concepts

Spillfilesforaqueryexceeds[GB]

Whatisthisalert?CommandCenterraisesanalertifthecombinedsizeofspillfilesforanyqueryexceedsthespecifiednumberofgigabytes.Thisalertisraisedjustonceperquery.

GreenplumDatabasecreatesspillfilestotemporarilystoredataondiskwhenthedataexceedstheamountofmemoryallocatedtotheoperation.BecausememoryI/OismuchfasterthandiskI/O,aquerythatcreatesspillfilestakeslongertocompletethanitwouldiftherewassufficientmemoryavailabletoavoidcreatingspillfiles.

WhattodoUsetheCommandCenterQueryMonitortoviewtheplanforthequeryidentifiedinthealert.

Ifpossible,revisethequerysothatmorerowsareeliminatedearlierintheplan,eliminatingorreducingthesizeofspillfiles.

Considerreconfiguringtheresourcequeueorresourcegroupthatmanagesthequerytomakemorememoryavailabletothequery.Ifyouuseresourcegroupstomanageresources,youcanusetheCommandCenterAdmin>WorkloadMgmtviewtomodifyresourceallocations.

FormoreinformationManagingSpillFilesGeneratedbyQueries

UsingResourceQueues forinformationaboutconfiguringGreenplumDatabaseresourcequeues

UsingResourceGroups forinformationaboutconfiguringresourcegroups

©CopyrightPivotalSoftwareInc,2013-2019 123 6.0.0