pivotal greenplum command center - pivotal gpcc docs · 165236914 - the gpcc command-line utility...

132
Pivotal Greenplum ® Command Center Version 4.7.0 User Guide Rev: 02 © 2019 Pivotal Software, Inc.

Upload: others

Post on 19-Jul-2020

36 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

PivotalGreenplum®CommandCenter

Version4.7.0

UserGuide

Rev:02

©2019PivotalSoftware,Inc.

Page 2: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

2451316171924252627282931333436384344464849515254565860656669727576787980828790949597101104107109

TableofContents

TableofContentsPivotalGreenplumCommandCenter4.7.0DocumentationPivotalGreenplum®CommandCenter4.7.0ReleaseNotesAboutPivotalGreenplumCommandCenterInstallingGreenplumCommandCenterCreatingthegpperfmonDatabaseInstallingPivotalGreenplumCommandCenterUpgradingGreenplumCommandCenterUninstallingGreenplumCommandCenterAbouttheCommandCenterInstallationSettingtheGreenplumCommandCenterEnvironmentConnectingtotheGreenplumCommandCenterConsoleAdministeringtheCommandCenterWebServerAdministeringCommandCenterAgentsAdministeringthegpperfmonDatabaseSettingsgpccgpmetricsSchemaReferenceConfigurationFilesReferenceCommandCenterAgentParametersCommandCenterConsoleParametersgpmetricsConfigurationFileReferenceSetupConfigurationFileGreenplumDatabaseServerConfigurationParametersSecuringGreenplumCommandCenterManagingGreenplumCommandCenterAuthenticationManagingGreenplumCommandCenterPermissionsSecuringthegpmonDatabaseUserEnablingAuthenticationwithKerberosMonitoringtheGreenplumDatabaseSystemDashboardGreenplumDatabaseClusterStateSegmentStatusClusterMetricsHostMetricsStorageStatusMonitoringandManagingGreenplumDatabaseQueriesQueryMonitorQueryDetailsHistoryAlertsManagingGreenplumDatabaseWorkloadsAboutGreenplumCommandCenterWorkloadManagementWorkloadManagementImportingResourceQueuestoResourceGroupsAccessingtheWorkloadConfigurationProgrammaticallyTroubleshootingEnablingResourceGroupsQueryMonitorHelpTopics

©CopyrightPivotalSoftwareInc,2013-2019 2 4.7.0

Page 3: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

110111112114116119121122123124125126127128129130131132

CPUCPUSkewLocksMemoryQueryPlanExecutionSpillFilesAlertHelpTopicsSegmentfailureAveragememory(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 4.7.0

Page 4: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

PivotalGreenplumCommandCenter4.7.0DocumentationPDF

GreenplumCommandCenter4.7.0ReleaseNotes

AboutGreenplumCommandCenter

InstallingGreenplumCommandCenter

InstallingGreenplumCommandCenter

AbouttheCommandCenterInstallation

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 4.7.0

Page 5: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

PivotalGreenplum®CommandCenter4.7.0ReleaseNotes

AboutThisReleaseThisdocumentcontainsreleaseinformationaboutPivotalGreenplumCommandCenter4.7.0.GreenplumCommandCenter4.7.0addsnewfeaturestoGreenplumCommandCenterandresolvessomeissues.

SeeEnhancementsandChangesinGreenplumCommandCenter4.7.0forinformationaboutnewfeaturesandchangesinthisCommandCenterrelease.

SupportedPlatformsGreenplumCommandCenter4.7.0iscompatiblewiththefollowingplatforms.

PivotalGreenplumDatabase5.19.0andhigher

RedHatEnterpriseLinux6.x and7.x

CentOS6.x and7.x

SUSEEnterpriseLinux11SP4

IfyouuseresourcegroupsandworkloadmanagementonRedHatorCentOS6.x,upgradeyourkernelto2.6.32-696orhighertobenefitfromimprovementsintheLinuxcgroupsservice.

GreenplumCommandCenterworkloadmanagementfeaturesarenotsupportedonSUSEEnterpriseLinux11.

EnhancementsandChangesinGreenplumCommandCenter4.7.0GreenplumCommandCenter4.7.0containsthefollowingnewchangesandfeatures.

CommandCenterInstallationNewFeaturesandChangesThe gpccinstall installationutilitynowwritesdetailsoftheinstallationtotheinstallationlogfile, gpccinstall.<timestamp>.log .Previously,thelogcontainedasuccessmessageoranyerrorsthatpreventedasuccessfulmessage.ThelognowcontainsthevaluesfortheparametersusedduringtheCommandCenterinstallation.

The gpccinstall utilitymustberunbythegpadminuserandtheinstallationdirectorymustbewritablebythegpadminuser.TheoptiontoinstallCommandCenterasrootandchangeownershipoftheinstalledfilestogpadminisnotsupportedbecausetherootusercannotconnecttoGreenplumDatabase.

Thenew gpccinstall-auto optionperformsanon-interactiveinstallation,usingdefaultvaluesforalloftheinstallationparameters.

AddedtheKoreanlanguageoptionfortheCommandCenterUserInterface.

ItisnowrecommendedtorunCommandCenteronthemasterhost,insteadofthestandbymasterhost.Savingplannodehistory,anewfeatureinthisComandCenterrelease,cangeneratealargenumberofmessagesbetweentheagentrunningonthemasterhostandtheCommandCenterbackend.RunningCommandCenteronthemasterhostkeepsthistrafficoffoftheLAN.

gpmetricsSchemaChangesWhenreal-timemetricscollectionisenabled,CommandCentersavesexecutionplannodedetailstothe gpmetrics.gpcc_plannode_history tableinthegpperfmondatabase.Detailsareonlysavedforqueriesthatexecuteforatleast10seconds.ThedatainthistableenableyoutoviewvisualqueryexecutionplandetailswhenyouselectaqueryintheHistoryview.

QueryMonitorandHistoryChangesA Planner fieldisaddedtotheQueryMonitorDetailsviewtoidentifytheplannerusedtoplanthequery,eitherGPORCAorLegacy.

ThedetailforaqueryintheHistoryviewincludesavisualqueryexecutionviewthatshowstheactualrowsreturnedforeachplannode.History

ThevisualplanforaqueryintheQueryMonitorshowstheEstimatedProgressforthequery,acalculatedpercentageusingthequeryplan’scost

1

1

2

1

2

©CopyrightPivotalSoftwareInc,2013-2019 5 4.7.0

Page 6: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

estimateforeachplannodeandtheactualrowsvs.estimatedrowsforeachnode.

AlertsWhensendingalertemails,CommandCentercanauthenticatewiththeSMTPserverusingNONE,PLAIN,LOGIN,orCRAM-MD5authentication.

TheUsernameandPasswordfieldsintheManageemailconfigurationsectionoftheAlertspagearenowoptional.ThesefieldsareonlyneedediftheSMTPserverrequiresthemforauthentication.

LoggingChangesEveryhour,CommandCenterlogsthenumberofqueriesthatwerenotsavedtothegpmetricshistoryintheprevioushourbecausetheycompletedinlesstimethanthanthethreshholdtimespecifiedontheAdmin>Settingspage.Themessageisloggedinthe logs/webserver.log fileintheCommandCenterinstallationdirectory.

FixedIssues165236914-The gpcc command-lineutilitydidnotworkwiththe -W option.Thishasbeenfixed.The gpcc commandwillusethegpmonpasswordenteredbytheuserwhenthe -W optionissupplied.Ifthe -W optionisnotsupplied, gpcc willusethe PGPASSWORD environmentvariable,ifset,orthe .pgpass fileinthegpadminuser’shomedirectory.

165111508-LDAPauthenticationfailsbecauseCommandCenterimproperlyencodestheusernameintheGreenplumconnectionstring.Thisisresolved.CommandCentercorrectlyescapestheusernameintheconnectionstring.

164620455-TheCommandCenteragentmemoryusageandCPUusagegrewveryhighwhenexecutingaquerywithaninnerquery.Theinnerquerygeneratedmanysmallqueries,sendingalargenumberofpacketstothemetricscollector.Thisisfixed.Innerqueriesaremarkedsothatmetricsarenotcollectedforthem.

164818798-WhenWorkloadManagerterminatesanidleconnection,aFATALerrorandstacktracewerelogged.NowWorkloadManagerlogsaWARNINGmessagewithnostacktracewhenanidleconnectionisterminated.

164263538,164718926-CommandCenterdoesnotshowqueryinformationforaCOPYcommand,suchas COPY<table>FROMSTDIN; .TheCommandCenterQueryMonitornowdisplaysavailableinformationforsome COPY commands.A COPY commandrunbyanon-superuserrolecanbecontrolledbyaresourcequeueiftheresourcequeue’s ACTIVE_STATEMENTS parameterspecifiesamaximumlimitforthenumberofqueriesthatcanbeexecutedbyrolesassignedtothequeue.(GreenplumDatabasedoesnotassigncostormemoryvaluesto COPY commands,soa COPY commandwithno ACTIVE_STATEMENTS parameterisnotmanagedbyaresourcequeue.)InCommandCenter, COPY commandsmanagedbyresourcequeueswillnowappearintheQueryMonitorwithavailableactivityinformation.CommandCentercachesroles’resourcequeuenamesand,forthesecommands,theresourcequeuenameisdisplayedfromthecache.Ifarolehasbeenrecentlyassignedadifferentresourcequeue,thecachemaybeoutofdate.SeeKnownIssuesformoreinformation.

164346696-CommandCenterdoesnotdisplaymorethanonefilespaceperhost.ThishasbeenfixedinCommandCenter.

165589279-TheCommandCenterDashboarddisplayedUTCtimewhentheEurope/MoscowtimezonewassetintheOSandGreenplumDatabase.TherootcauseofthisissueisthatGreenplumDatabase5doesnothandlethe MSK timezoneproperly.ThisisfixedinCommandCenterandissue7543hasbeenopenedforGreenplumDatabase.

EnhancementsandChangesinGreenplumCommandCenter4.6.0GreenplumCommandCenter4.6.0containsthefollowingnewfeatures:

DisplayLanguageSelectionTheGreenplumCommandCenteruserinterfacehasbeenupdatedwithlocalizationsupport.Atinstalliontime,youcanchoosethelanguagetouseintheCommandCenteruserinterface.CommandCentercurrentlysupportsEnglish(default)andChineselanguages.

gpmetricsHistorySchema(Beta)TheCommandCenterhistoryviewscurrentlydrawdatafromtheGreenplumDatabasegpperfmondatabase,whichhasadatacollectionprocessthatisseparatefromtheCommandCenterreal-timemetricscollectionsystem.

Inthisrelease,youcanenablesavingdatafromthereal-timemetricscollectionsystemtohistorytablesinthegpmetricsschema.Whenyouenablethis

©CopyrightPivotalSoftwareInc,2013-2019 6 4.7.0

Page 7: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

feature,CommandCenterusesthegpmetricshistorytablestodisplayhistorydataintheuserinterface.Thisisanewfeature,currentlyconsideredexperimental.Inafuturerelease,thegpmetricstableswillbetheonlysourceforhistorydataandCommandCenterwillnolongerdependuponthegpperfmondatabase.

Toenablegpmetricshistory,visittheAdmin>SettingsviewinCommandCenter.Inadditiontoenablinghistorycollection,youcansettheminimumrun-timeforqueriestobesavedinhistory.

SeethegpmetricsSchemaReferenceforinformationaboutthetablesinthegpmetricsschema.

EnhancementsandChangesinGreenplumCommandCenter4.5.0GreenplumCommandCenter4.5.0containsthefollowingnewfeatures:

AlertRulesOnthenewAdmin>Alertspage,CommandCenteruserswithsuperuserpermissioncanconfigurealertrules.Whenanalertruleismatched,arecordisloggedinthe gpmetrics.gpcc_alert_log tableand,optionally,anemailissenttoalistofaddressesyouspecify.Youcanalsowriteacustomshellscripttosendalertstoothermessagingsystems.

Alertrulescandetectthefollowingevents:

Segmentfailure

Outofmemoryerrors

Averagememoryusagepercentageofsegmenthostsexceedsaspecifiedpercentageforaspecifiednumberofminutes

Memoryusageonthemasterhostexceedsaspecifiedpercentageforaspecifiednumberofminutes

Totaldiskspaceusedonallhostsexceedsaspecifiedpercentage

NumberofGreenplumDatabaseconnectionsexceedsaspecifiedpercentage

AverageCPUusageofsegmenthostsexceedsaspecifiedpercentageforaspecifiednumberofminutes

Spillfilesforanactivequeryexceedaspecifiednumberofgigabytes

Runtimeforaqueryexceedsaspecifiednumberofminutes

Aqueryisblockedformorethanaspecifiednumberofminutes

QueryTextDownloadforLongQueriesOntheQueryDetailspage,ifthequerytextislongerthan100Kcharacters,CommandCenteronlyshowsthefirst100Kcharactersand,whenyouclickCOPY,copiesonlythefirst100Kcharacterstotheclipboard.Whenthequerytextislongerthan100Kcharacters,CommandCenteraddsabutton,Retrievefullquerytext,whichyoucanclicktodownloadatextfilecontainingtheentiretextofthequery.Thefileisavailabletodownloadfor24hours,oruntilthequeryissavedtohistory,whenhistorycollectionisenabled.

FixedIssues161436520-Panelsdisplayinghelptextcannowbescrolledverticallywhenthetextdoesnotfitinthewindow.

158278655-ThedisplayedmetricsforaquerycouldbeinaccurateifCommandCenterreceivedthequery“done”statusbeforethefinalmetricsarrived.Nowthefinalmetricsareupdatedevenwhentheyarriveafterthe“done”status.

161074984-Repeatedassertionerrorsloggedinthe agent.log filecausedlogfilestogrowquicklyandconsumetoomuchdiskspace.Thisisfixed.Eachtypeofassertionerrorwillbeloggednomorethanonceevery10minutes.

162114428-WhenauservisitsCommandCenterwithabrowser,theCommandCenterwebserver(gpccwsprocess)establishesawebsocketconnectionandrunstwogoroutinestoservicethewebsocket.Whenthewebsocketcloses,oneofthegoroutinesdoesnotexit.Aftermanyconnectionsthegpccwsprocesscanoccupygigabytesofmemory.Thismemoryleakisfixed.

EnhancementsandChangesinGreenplumCommandCenter4.4.2TheGreenplumDatabasemetricscollectorextensionisnowenabledonlywhenCommandCenteragentsarerunning.Previously,ifanagentprocessterminated,themetricscollectorcontinuedtocollectandsenddata.

©CopyrightPivotalSoftwareInc,2013-2019 7 4.7.0

Page 8: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

GreenplumCommandCenter4.4.2containsthefollowingresolvedissues:

160195564-WhenCommandCenterisrestartedafterauserhassubmittedaquery,andtheusersubmitsanotherqueryinthesamesession,thedatabasenameandusernamearemissingfromthesecondqueryintheCommandCenterinterface.Thisisfixed.

161077294-TheAuthenticationviewnowpreventstheuserfromsavinganundefinedentrytothe pg_hba.conf file.

161274227-TheCommandCenterinstaller, gpccinstall ,nolongerprintserrorstothe pg_log logfileaboutmissing iterators and emc_connect_history

tables.

161273865-TheQueryMonitornolongershowsruntimesflashingto0secondswhenaqueryiscancelledthroughtheuserinterface.

EnhancementsandChangesinGreenplumCommandCenter4.4.1TheAdmin>AuthorizationviewallowsenteringhostnamesintheAddressfield.

Onthevisualqueryplan,adatamotionshowedafinishedstatuswhenthesenddataoperationcompleted.Thisischangedsothatthenodecompletesonlyafterthecorrespondingdatareceiveoperationhasalsocompleted.

Enabledcross-siterequestforgerypreventionduringlogin.

ResolvedIssuesinGreenplumCommandCenter4.4.1160679694-IfCommandCenterisrestartedwhileontheQueryMonitorviewandthebrowseristhenrefreshed,anextrawebsocketconnectioniscreated.Thisisfixed.

MPP-29539-CommandCenteragent(ccagent)loggingisdisabledforaknownissuewithPL/pgSQLqueries.

EnhancementsandChangesinGreenplumCommandCenter4.4.0GreenplumCommandCenter4.4.0containsthefollowingfeaturesandenhancements.

WorkloadManagementCommandCenterhasanewuserinterfacetoassistadministratorsinenablingresourcegroupsinGreenplumDatabase,importingexistingresourcequeuestoresourcegroups,andenablingworkloadmanagementwithCommandCenter.Theoptiontoimportresourcequeuestoresourcegroupsispresentedifnoresourcegroupshavebeencreated(otherthan default_group and admin_group )andGreenplumDatabasehasresourcequeuestoconvert(otherthan pg_default ).Oncetheadministratorhasimportedresourcequeues,orchosentoskipimportingresourcequeues,theoptiontoimportqueuesisnolongerpresented.

TheresourcegrouplistontheWorkloadManagementviewhasanewcolumntoshowtheminimum(fixed)amountofmemorythatwillbeallocatedtoaqueryforeachresourcegroup.Thisvalueisrecalculatedwhenyouenternewvalueswhileeditingresourcegroups.

Administratorscannowdefineresourcegroupassignmentrulesandidlesessionkillruleswithaninteractiveinterface.ItisnolongernecessarytoedittheJSONdocumentforworkloadmanagementrules.TheJSONtextfieldisremoved.

TheWorkloadManagementviewchangedtoalighttheme.

PermissionsCommandCenteruserswiththeSelfOnlypermissionlevelcan:

seeallqueriesonthequerymonitor,includingqueriesownedbyotheruserscanceltheirownqueriesaccessthequerydetailsviewfortheirownquerieshoveronaquerytoseequerytextfortheirownquerieshoveronlocking/blockingqueriesandaccessdetailsoflocking/blockingqueriesthatdonotbelongtootherusers

UserswithSelfOnlypermissionlevelcannotseequerytextoraccessthedetailsviewsofothers’queries.

TheGreenplumDatabaseroles gpcc_basic , gpcc_operator ,and gpcc_operator_basic arecreatedduringCommandCenterinstallationiftheydonotalreadyexist.

©CopyrightPivotalSoftwareInc,2013-2019 8 4.7.0

Page 9: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

QueryMonitorFixedabugwherethedatabasenameandrolenameweremissingfromquerydetailswhenqueriesareexecutedinasessionafterrestartingCommandCenter.

EnhancementsandChangesinGreenplumCommandCenter4.3.0GreenplumCommandCenter4.3.0containsthefollowingenhancements.

ResourceGroupManagementTheAdmin>WorkloadMgmtviewhasanewuserinterfaceyoucanusetoaddandremoveresourcegroupsandtochangetheConcurrency,CPU%,andMemory%attributesofresourcegroups.

ResourceGroupRoleAssignmentsTheAdmin>WorkloadMgmtviewhasanewuserinterfaceyoucanusetoviewandchangeGreenplumDatabaseroles’defaultresourcegroups.

DetailsAddedtoVisualQueryPlanStepsThemetricscollectorextensioninGreenplumDatabaserelease5.9isupdatedtosubmitadditionalinformationabouteachstepinthequeryplantotheCommandCenterbackend.CommandCenterdisplaysthisinformationinthevisualqueryplanwhenyouexpandastepinthequeryplan.Thenewinformationdisplayeddependsontheoperationthestepperformsandincludesdetailssuchashashkey,mergekey,joincondition,orfiltercondition.Previously,youcouldonlyseethisinformationbygeneratingthetextualqueryplan.

EnhancementsandChangesinGreenplumCommandCenter4.2.0GreenplumCommandCenter4.2.0containsthefollowingenhancements.

VisualQueryPlanTheCommandCenterQueryDetailsviewnowincludesavisualqueryplan.

IdleSessionKillRulesIdlesessionkillrulescanincludeoptional exemptedRoles and message parameters.

Thevalueofthe exemptedRoles parameterisalistofGreenplumDatabaserolesthatareexemptedfromtherule.ThelistcanincludePosixregularexpressionstomatchGreenplumDatabaserolenames.

Thevalueofthe message parameterisastringtoincludeinthemessagethatisdisplayedwhenasessioniskilled.

CommandCenterCanRunontheMasterHostorStandbyMasterHostTheGreenplumCommandCenterwebserverandbackendmaynowbeexecutedonthemasterhostoronthestandbymasterhost.RunningGPCConthestandbymasterhostisrecommendedtoavoidaddingloadtothemasterserver,butitisnolongerarequirement.AftertheGPCCsoftwareisinstalled,logintothehostwhereyouwanttorunGPCC,sourcethe gpcc_path.sh fileintheGPCCinstallationdirectory,andrunthe gpcc

startcommand.

EnhancementsandChangesinGreenplumCommandCenter4.1.0

©CopyrightPivotalSoftwareInc,2013-2019 9 4.7.0

Page 10: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

GreenplumCommandCenter4.1.0containsthefollowingenhancements.

CommandCenteradministratorscansetpermissionlevelsforCommandCenterusers.Permissionsareenforcedasdescribedinthedocumentation.

OntheQueryDetailview,clickingCopyinthequerytextorqueryplanpanelcopiesthetextinthepaneltotheclipboard.

Ahelpiconandin-apphelphavebeenaddedontheQueryMonitorandQueryDetailviews.

Thefollowingworkloadmanagementfeatures,improvements,andbugfixeshavebeenaddedintheworkloadmanagementextensionincludedwithGreenplumDatabase5.8.0.

OntheAdmin>WorkloadMgmtview,youcanaddidlesessionkillrulesforeachresourcegroup.Whenyouaddtheserules,theGreenplumDatabaseworkloadmanagementextensionkillsasessionafterithasbeenidleforthenumberofsecondsyouspecify.SeeWorkloadManagementforsyntaxandexamples.

OptimizationshavebeenimplementedtoreducetheimpactonGreenplumDatabasewhentheworkloadmanagementextensionisdisabled.

Theworkloadmanagementextensiontakesadvantageofresourcegroupname-to-idcachingaddedinGreenplumDatabase.

Fixedabugintheworkloadmanagementextensionthatcausederrorstoprinttothe psql prompt,evenwhentheextensionwasdisabled.

GreenplumCommandCenter4.1.0containsthefollowingbugfixes.

IntheHistoryDetailview,wheneitheroftheDiskRorDiskWmetricsis0,botharereportedtobe0.Thisisfixed.

WhenusingtheKerberosgpmon-onlyauthenticationmode,generatinganexplainplanfailed.Thisisfixed.

TheCommandCenteragentfailedwiththemessage“Error:can’tfindgpcc.query_metrics_port,metrics_collectorisnotcorrectlyinstalled.”ThisoccurswhenrunningCommandCenteronaGreenplumDatabasesystemthatwasupgradedfromanearlierGreenplumDatabase5.xrelease.Themetrics_collector and gp_wlm extensionsareinstalledwiththeupgrade,buttheupgradeprocessdoesnotperformtherequiredconfigurationchangesinthe postgresql.conf configurationfile.TheCommandCenterinstallationinstructionsnowincludestepstomanuallyconfigureandrestartanupgradedGreenplumDatabasesystem.

WhenCommandCenterstarts,anerrormessageiswrittenintheGreenplumDatabaselogfile:“functiongpcc_schema.read_pghba(unknown)doesnotexist.”Thisisfixed.

AchangetotimezonehandlinginGreenplumDatabase5.7cancauseGreenplumCommandCenter4.0.0todisplayanincorrecttimeifthemasterhostoperatingsystemtimeandGreenplumDatabaseusedifferenttimezones.NowCommandCentertimesaredisplayedusingthetimezoneoftheGreenplumDatabasemasterhostoperatingsystem.Thecurrenttime,lastsynctime,andtimestampsinalertlogs,clustermetrics,andqueryhistoryarealldisplayedusingthemasterhost’ssystemtimezone.

OntheAdmin>Authorizationview,whentheauthorizationmethodis gss andtheoptionsfieldcontainstext,changingthemethodto trust doesnotcleartheoptionsfieldanditisnotpossibletosavechangestothe pg_hba.conf file.

TheCommandCenterwebserver, gpccws ,spawnssshprocessesbutdoesnotreaptheminatimelymanner,leadingtomanyzombieprocesses.Thisisfixed.

OntheAdmin>Authenticationview,ifthenumberofuserslistedintheusercolumnislongerthancanbedisplayed,CommandCentertruncatesthelistandaddsellipsis( ... )totheend.Onlyadministratorscanviewthecompletevalue,byeditingthefield.Nowanyuserwithaccesstotheviewcanseethefulllistofusersbyhoveringoverthefield.

EnhancementsandChangesinGreenplumCommandCenter4.0.0

CommandCenterInstallationChangesGreenplumCommandCenter4.xsoftware,unlikepreviousreleases,isinstalledoneveryhostintheGreenplumDatabasecluster.TheCommandCenterwebserverandbackendrunonthestandbymaster,ifyourGreenplumDatabaseclusterhasastandbymaster.Ifthereisnostandbymaster,CommandCenterrunsonthemasterhostinstead.

TomodifytheCommandCenterinstallation—forexampletoenableordisableSSLorinstallCommandCenteronneworreplacedhosts—justre-executetheinstallerandrestartCommandCenter.ItisnotnecessarytouninstallCommandCenterbeforereinstalling.

ThereisoneCommandCenterinstallationperGreenplumDatabasecluster.ItisnolongernecessarytocreateCommandCenterinstancesafterinstallingthesoftware.

The gpcmdr command-lineutilityisreplacedwiththenew gpcc utility.Usethe gpcc utilitytostartandstopCommandCenterandmetricscollectionagents,checkCommandCenterstatus,andenableordisableKerberosauthentication.

©CopyrightPivotalSoftwareInc,2013-2019 10 4.7.0

Page 11: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Inpreviousreleases,thegpmonrolerequiredonlylocalconnectionstodatabasesontheGreenplummasterhost.InGreenplumCommandCenter4.x,thegpmonusermustbeabletoconnecttodatabasesfromthehostrunningtheCommandCenterwebserverandbackend,whichrequiresaddingahostentrytothe pg_hba.conf authenticationconfigurationfile.

Real-timeQueryMetricsGreenplumCommandCenter4.0introducesreal-timequerymetricsforPivotalGreenplumDatabase5.7andabove.ThisnewfeaturecombinesthefollowingnewfeaturesinGreenplumDatabaseandGreenplumCommandCenter:

GreenplumDatabasesavesqueryexecutionmetricsinsharedmemorywhilequeriesexecute.

AnewGreenplumDatabasemetricscollectionextension,includedwithPivotalGreenplumDatabase,emitsthesavedmetricsasUDPdatagrams.

AnewGreenplumCommandCentermetricscollectionagentrunningoneachGreenplumDatabasehostreceivesthedatagramsandpostsmetricstotheGreenplumCommandCenterbackend.TheCommandCenterbackendstartsandmanagesthemetricscollectionagents.

TheCommandCenterQuerymonitorviewupdatesinrealtimesoyoucanseequeriesthatarewaitingtoexecuteandthecurrentstatusandresourceusageforqueriesthatarerunning.

Metricscollectionnowincludeslockandspillfileinformation.OntheQueryMonitor,youcanseewhichqueriesareblockedandwhichqueriesholdthelocksblockingthem.TheQueryMonitorshowsthetotalsizeofspillfilescreatedonallsegmentsforeachquery.

InstallingthegpperfmondatabaseremainsaprerequisiteforCommandCenter.ThegpperfmondatabaseisthesourceforqueryhistorydisplayedintheCommandCenteruserinterface.Thenewreal-timemetricsarenotpersistedandarenotdirectlyrelatedtothemetricscollectedandpersistedinthegpperfmondatabase.

WorkloadManagementWorkloadmanagementisnowanintegratedCommandCenterfeatureratherthanaseparateproduct.WorkloadmanagementisavailableinCommandCenteronlyafterresourcegroupshavebeenenabledinGreenplumDatabasebychangingthe gp_resource_manager serverconfigurationparameterfrom'queue' to 'group' andenablingLinuxcontrolgroups(cgroups).

InCommandCenter4.0,workloadmanagementallowsyoutoassigntransactionstoGreenplumDatabaseresourcegroupsatexecutiontimebyevaluatingthecurrentdatabaseroleandquerytagsagainstworkloadassignmentfiltersyoudefineinCommandCenter.Querytagsareuser-definedname=value parametersthatyoudefineinthe gpcc.query_tags databasesessionparameter.Youcandefinemultiplequerytagsseparatedbysemicolons.SetquerytagsinaGreenplumDatabasesessioneitherasaparameterinthedatabaseconnectionURLorbyexecutingSETgpcc.query_tagsTO'<tag1>=<val1>;<tag2>=<val2>;...'

inthedatabasesession.

Whenatransactionisabouttoexecute,thecurrentdatabaseroleandquerytagsarecomparedtotheworkloadassignmentfiltersthatyouhavecreatedinCommandCenter.Ifamatchisfound,thetransactionisassignedtoaresourcegroupaccordingtotheworkloadmanagementfilter.Otherwise,thetransactionisassignedtothedatabaseuser’sresourcegroup,whichisthedefaultbehaviorwhenCommandCenterworkloadmanagementisnotenabled.

Workloadmanagementusesthe gp_wlm databaseextensionincludedwithPivotalGreenplumDatabase.

UnimplementedFeaturesSomefeaturesavailableinpreviousGreenplumCommandCenterreleaseshavebeenremovedorarenotyetimplementedinCommandCenter4.x.

TheabilityforaCommandCenteradmintopostamessagetotheQueryMonitorviewisnotyetimplemented.

Themulti-clusterviewhasbeenremoved.

KnownIssuesThefollowingareknownissuesinthecurrentGreenplumCommandCenterrelease.

ALargeMemoryLeakOccursOverTimeWhenCertainAlertsareEnabled[MPP-29942]Adeadlockcanoccurwhenreadingincomingmetricsifanyofthefollowingalertsareenabled:

©CopyrightPivotalSoftwareInc,2013-2019 11 4.7.0

Page 12: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Averagememory(segmenthosts)exceeds%formin

Memory(master)exceeds%formin

AverageCPU(segmenthosts)exceeds%formin

CPU(master)exceeds%formin

Thedeadlockcausesincomingmetricstobeblockedandaccumulatedinmemory.

Toworkaroundthisissue,disablealloftheabovealertsandrestartCommandCenter.

ThisissueexistsinGreenplumCommandCenter4.6.1and4.7.0.

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

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

©CopyrightPivotalSoftwareInc,2013-2019 12 4.7.0

Page 13: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

AboutPivotalGreenplumCommandCenterPivotalGreenplumCommandCenterisamanagementtoolforthePivotalGreenplumDatabaseBigDataPlatform.ThistopicintroduceskeyconceptsaboutGreenplumCommandCenteranditscomponents.

GreenplumCommandCenterFeaturesGreenplumCommandCentermonitorssystemperformancemetrics,analyzesclusterhealth,andenablesdatabaseadministratorstoperformmanagementtasksinaGreenplumDatabaseenvironment.

GreenplumCommandCenterprovidesabrowser-nativeHTML5graphicalconsoleforviewingGreenplumDatabasesystemmetricsandperformingcertaindatabaseadministrativetasks.TheCommandCenterapplicationprovidesthefollowingfunctionality:

Interactiveoverviewofrealtimesystemmetrics.Drilldowntoseedetailsforindividualclusterhostsandsegments.

Detailedrealtimestatisticsfortheclusterandbyserver.

QueryMonitorviewlistsqueriesexecuting,waitingtoexecute,andblockedbylocksheldbyotherqueries.

QueryDetailviewshowsquerymetrics,querytext,andtheexecutionplanforthequery.

WorkloadManagementviewallowsadministratorsto:

CreateandmanageworkloadstomanageconcurrencyandallocateCPUandmemoryresources.ChangedefaultresourcegroupsforGreenplumDatabaseroles.Createassignmentrulestoassigntransactionstoresourcegroups.Createidlesessiontimeoutrulestosettheamountoftimebeforeanidlesessioniskilled.

Fourpermissionlevelsallowuserstovieworcanceltheirownorothers’queries,andtoviewormanageadministrativeinformation.

ClusterMetricsviewshowssynchronizedchartsofhistoricalsystemmetrics.

Historyviewlistscompletedqueriesandsystemmetricsplottedoveraselectedtimeperiod.

PermissionsviewtoseeormanageCommandCenterpermissionlevels.

Authenticationviewtoseeoreditthe pg_hba.conf host-basedauthenticationconfigurationfile.

SegmentStatusviewwithsummariesanddetailsbysegment.

StorageStatusviewwithsummariesanddetailsbysegmentdatadirectory.

GreenplumCommandCenterArchitectureThefollowingfigureillustratestheGreenplumCommandCenterarchitecture.

©CopyrightPivotalSoftwareInc,2013-2019 13 4.7.0

Page 14: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

©CopyrightPivotalSoftwareInc,2013-2019 14 4.7.0

Page 15: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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.

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.TheextensionisincludedwithPivotalGreenplumDatabase,butisnotenabledbydefault.Initially,GreenplumDatabaseusesresourcequeuestomanageresources.UsingCommandCenterworkloadsrequiresenablingresourcegroupsinGreenplumDatabase.ResourcegroupsarebasedontheLinuxcontrolgroups(cgroups)service,whichmustfirstbeenabledintheoperatingsystem.

©CopyrightPivotalSoftwareInc,2013-2019 15 4.7.0

Page 16: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

InstallingGreenplumCommandCenterPerformthesetaskstoinstallGreenplumCommandCenteronyourGreeplumDatabasesystem:

CreatingthegpperfmonDatabase

InstallingGreenplumCommandCenter

SettingtheCommandCenterEnvironment

Additionaltopics:

UpgradingGreenplumCommandCenter

UninstallingGreenplumCommandCenter

©CopyrightPivotalSoftwareInc,2013-2019 16 4.7.0

Page 17: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

gpmonroleAuthenticationThe gpperfmon_install utilityaddsentriesforthegpmonroletothe pg_hba.conf file,whichallowsthegpmonroletomakealocalconnectiontoanydatabaseintheGreenplumclusteronthemasterhost.

©CopyrightPivotalSoftwareInc,2013-2019 17 4.7.0

Page 18: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 ~gpadmin/.pgpass filefromyourprimarymasterhosttothesamedirectoryonyourstandbymasterhost.Setthepermissionsonthe.pgpass fileto600(forexample: chmod 0600 ~/.pgpass ).

©CopyrightPivotalSoftwareInc,2013-2019 18 4.7.0

Page 19: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

InstallingPivotalGreenplumCommandCenterThePivotalGreenplumCommandCenterinstallationutilityinstallstheCommandCenterfilesonallhostsintheGreenplumDatabaseclusterandcreatesthe gp_metrics schemainthegpperfmondatabase.

PrerequisitesBeforeinstallingGreenplumCommandCenter,ensurethefollowingrequirementsaremet:

GreenplumDatabasemustbeinstalledandrunning.SeethePivotalGreenplumCommandCenterreleasenotesforcompatibleGreenplumDatabaseversions.

TheGreenplumDatabase MASTER_DATA_DIRECTORY environmentvariablemustbeset.

Thegpperfmondatabaseandgpmonrolemusthavebeencreated.SeeCreatingthegpperfmonDatabase.

The pg_hba.conf authenticationconfigurationfilemusthaveanentrytoallowthegpmonroletoconnectfromeveryhostintheGreenplumDatabasecluster.See[gpmonRoleAuthentication](gpmonRoleAuthentication(setup-collection-agents.html#gpmon-auth)fordetails.

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

Port28080(default)mustbeopentoTCPconnectionsfromWebclientstotheHTTPserveronthemasterandstandbymasterhosts.GreenplumCommandCenterwebbrowserclientsconnecttothisporttoaccesstheCommandCenterConsole.BrowserconnectionsuseHTTP/HTTPSandWS/WSSprotocols.AdifferentportnumbercanbespecifiedwhenCommandCenterisinstalled.

Port8899mustbeopenonallhostsintheGreenplumDatabaseclusterforTCPconnections.ThisisanRPCport,usedbythemetricscollectionagentsonthesegmenthoststosendmetricstothebackend.

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.

InstallGreenplumCommandCenterSoftwareRuntheGreenplumCommandCenterinstallerontheGreenplumDatabasemasterhost.Thesoftwarewillbecopiedtoallotherhostsinthecluster.

RuntheGreenplumCommandCenterinstallerontheGreenplumDatabasemasterhost.TheinstallerinstallstheCommandCentersoftwareoneveryhostinyourGreenplumDatabasecluster.ItretrievesthelistofhostsinyourGreenplumDatabaseclusterfromthe gp_segment_configurationsystemtable.

AfteryouhaveruntheinstalleryoucanstartGreenplumCommandCenteronthemasterhost(recommended)oronthestandbymasterhost.

Important!IfyouupgradedtoPivotalGreenplumDatabaserelease5.7orlaterfromanearlierGreenplumDatabase5.xrelease,youmustfollowstepsatSetUptheMetricsCollectionandWorkloadManagementExtensionsbeforeyoustartGreenplumCommandCenter.

©CopyrightPivotalSoftwareInc,2013-2019 19 4.7.0

Page 20: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

1. DownloadGreenplumCommandCenter4.xfromPivotalNetwork andcopyittothegpadminuser’shomedirectoryonthemasterhost.

2. Extracttheinstallerfromthezipfile.

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

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

TherearethreewaystoruntheGreenplumCommandCenterinstaller:

Interactive–theinstallerpromptsyouforinstallationparameters.

Scripted–youruntheinstallerwithafilecontaininginstallationparameters.

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 optioninstructstheinstallertopromptforthegpmonuser’spassword.Theinstallerattemptstoretrievethegpmonpasswordfromthe PGPASSWORD environmentvariable,ifset,orfromthe ~gpadmin/.pgpass file,ifpresent.Ifneitheroftheseoptionsisavailable,includethe -W optiontoinstructtheinstallertopromptforthepassword.The --ssh_path optionallowsyoutospecifythefullpathtoacustomsshprogram.Ifyoudonotsupplythisoption,theinstallerusesthessh commandonthepath.

Example:

$./gpccinstall-<version>--ssh_path/usr/local/bin/ssh-W

3. Readthroughthelicenseagreementandenter y toaccept.

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

5. WhatwouldyouliketonamethisinstallationofGreenplumCommandCenter?(Default=gpcc)EnteranametodisplayonCommandCenterwebpagestoidentifythisGreenplumCommandCenterinstallation.

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

7. WouldyouliketoenableSSL?(Default=N)Ifyouenter y ,theinstallerpromptsyoutoenterthepathtotheservercertificateforthewebserver.Pleaseenterthefullpathofcertificatefile,includingfilename:EnterthefullpathtothecertificatefileinstalledonthehostwhereyouwillrunGreenplumCommandCenter.

8. WouldyouliketoenableKerberos?Enter y ifyouwanttoenableclientauthenticationwithKerberos.KerberosmustalreadybeenabledforGreenplumDatabase.(Ifyouenter n ,youcansetupKerberosauthenticationlaterusingthe gpcckrbenable command.)TheinstallerpromptsforinformationaboutyourKerberosinstallation.ChooseKerberosmode(1.normal/2.strict/3.gpmon_only)GreenplumCommandCentersupportsthreedifferentKerberosauthenticationschemes.

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

©CopyrightPivotalSoftwareInc,2013-2019 20 4.7.0

Page 21: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

2-strictmode–CommandCenterhasaKerberoskeytabfilecontainingtheCommandCenterserviceprincipalandaprincipalforeveryCommandCenteruser.Iftheprincipalintheclient’sconnectionrequestisinthekeytabfile,thewebservergrantstheclientaccessandthewebserverconnectstoGreenplumDatabaseusingtheclient’sprincipalname.Iftheprincipalisnotinthekeytabfile,theconnectionrequestfails.3-gpmon_onlymode–CommandCenterusesthegpmondatabaseroleforallGreenplumDatabaseconnections.NoclientprincipalsareneededintheCommandCenter’skeytabfile.

ProvidethepathtothekeytabfileEnterthepathtothekeytabfilecontainingtheKerberosprincipalfortheCommandCenterwebserverand,optionally,CommandCenteruserprincipals.WhatisthenameoftheGPDBKerberosservice?TheKerberosservicenameforGreenplumDatabaseis postgres .WithGreenplumDatabaseversionsearlierthan6.0,adifferentKerberosservicenamecanbespecifiedbysettingthe krb_srvname serverconfigurationparameter.Youcanfindtheservicenameforyourpre-6.0GreenplumDatabaseclusterusingthe gpconfig utility:

$gpconfig-skrb_srvname

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

9. WouldyouliketoenableSSL?Enter y ifyouwanttoenableSSL/TLS(HTTPS)encryptionforclientconnectionstotheCommandCenterwebserver.TheinstallationutilitypromptsforthelocationoftheSSLcertificate.ProvidethefilepathfortheSSLcertificateEnterthepathtothecertificateinstalledontheCommandCenterhost.Thedefaultis /etc/ssl/certs/cert.pem .Thecertificatemustbereadablebythegpadminuser.

10. Pleasechooseadisplaylanguage(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

OnwhichportwouldyouliketoinstalltheGreenplumCommandCenterwebserver? 28080 web_port

WouldyouliketoenableSSL? false enable_ssl

PleaseprovidethefilepathfortheSSLcertificate: /etc/ssl/certs/cert.pem ssl_cert_file

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

Pleasechooseadisplaylanguage(1.English2.Chinese/3.Korean) 1 language

©CopyrightPivotalSoftwareInc,2013-2019 21 4.7.0

Page 22: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

Ifthe enable_ssl parameteristrue,the ssl_cert_file parameterisrequired.

Thefollowinginstallationconfigurationfileexamplesetsallparameterstotheirdefaultvalues.

path=/usr/local#Setthedisplay_nameparamtothestringtodisplayintheGPCCUI.#ThedefaultisthehostnameoftheGreenplummasterhost#display_name=localhost

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-InteractiveInstallationwithDefaultsRunning gpccinstall withthe -auto optioninstallsGreenplumCommandCenterwithnoprompts,usingthedefaultinstallationparametersshowninInstallWithaConfigurationFile.

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

SetUpCommandCenterandWorkloadManagementExtensionsYoumustfollowthestepsinthissectiononlyifyouhaveupgradedyourPivotalGreenplumDatabasesystemfroma5.xreleaseearlierthan5.7.0.

TheGreenplumDatabasemetricscollectionandworkloadmanagementextensionsareinstalledwhenyouupgradetoPivotalGreenplumDatabase5.7.0orlater.However,theupgradeprocedurepreservesyourprevious postgresql.conf configurationfile,soyoumustmanuallysettheserverconfigurationparametersthatenabletheextensions.YoumustrestartGreenplumDatabaseifyouchangeanyconfigurationparameters.

TosetuptheCommandCenterandworkloadmanagementextensions,logintothemasterhostasgpadminandfollowthesesteps.

1. Addthemetricscollectorandworkloadmanagementsharedlibrariestothe shared_preload_libraries configurationparameter.Checkthecurrentvalueofthe shared_preload_libraries configurationparameter.

$gpconfig-sshared_preload_librariesValuesonallsegmentsareconsistentGUC:shared_preload_librariesMastervalue:Segmentvalue:

AddtheCommandCenterandworkloadmanagementlibrariestotheparameter.(Iftherewereexistinglibrariesintheparameter,appendthenewlibraries,separatedwithacomma.)

$gpconfig-cshared_preload_libraries-v'\$libdir/metrics_collector,\$libdir/gp_wlm'

2. Makesurethe gp_enable_query_metrics configurationparameterison.

©CopyrightPivotalSoftwareInc,2013-2019 22 4.7.0

Page 23: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

gpconfig-sgp_enable_query_metricsgpconfig-cgp_enable_query_metrics-von

3. Ifyouchangedanyconfigurationparameters,restartGreenplumDatabase.

gpstop-r

PreparetheStandbyMasterHostAftertheCommandCentersoftwareisinstalled,youstarttheCommandCenterwebserverandbackendonthemasterhostorthestandbymasterhost.RunningCommandCenteronthemasterhostisrecommended,butpreparingthestandbyhostensuresthestandbycanrunCommandCenterifthemasterfails.

1. Copythe .pgpass filefromthemasterhosttothestandbymasterhost.Runthesecommandsfromthemaster:

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

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

3. IfGreenplumCommandCenteristosupportKerberosauthentication,GreenplumDatabasemusthaveKerberosauthenticationsetupandtherequiredprincipalsandkeytabsmustbeinstalledontheCommandCenterhost.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 23 4.7.0

Page 24: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 24 4.7.0

Page 25: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 25 4.7.0

Page 26: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

AbouttheCommandCenterInstallationTheinstallationprocedurecreatesasoftwareinstallationdirectoryforGreenplumCommandCenter.ThisdirectoryiscopiedtoallhostsintheGreenplumCluster.VersionsofGreenplumDatabasethatarecompatiblewithGreenplumCommandCenterincludepre-packagedfilesthatsupporttheCommandCenterreal-timemetricsandworkloadmanagementfeatures.

SoftwareInstallationDirectoryThefollowingfilesandfirst-levelsubdirectoriesarecopiedintotheinstallationdirectoryyouspecifywhenyouinstallGreenplumCommandCenter.Thislocationcanbereferencedwiththe $GPCC_HOME environmentvariablewhenyouhavesettheCommandCenterenvironment.

gpcc_path.sh –filecontainingenvironmentvariablesforGreenplumCommandCenter

bin/ –programfilesforGreenplumCommandCenter

gpcc-agent -real-timequerymetricscollectionagentgpccws -theGreenplumCommandCenterwebserverstatic/ -staticfilesfortheCommandCenterapplication

conf/

app.conf -configurationfilefortheCommandCenterwebserver

logs/ -webserveraccessanderrorlogfiles

open_source_licenses_GPCC.txt –licensesforopensourcecomponentsusedbyGreenplumCommandCenter

GreenplumDatabaseArtifactsTheCommandCenterreal-timemetricsandworkloadmanagementfeaturesdependonthe gp_wlm and metrics_collection GreenplumDatabaseextensions.TheseextensionsareincludedwithcompatibleversionsofGreenplumDatabase.

©CopyrightPivotalSoftwareInc,2013-2019 26 4.7.0

Page 27: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 27 4.7.0

Page 28: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 28 4.7.0

Page 29: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

AdministeringtheCommandCenterWebServerThegpccwswebserverbinaryandwebapplicationfilesareinstalledinthe bin directoryofyourGreenplumCommandCenterinstallation.

StartingandStoppingtheWebServerStartingtheCommandCenterWebServerrunsthegpccwswebserver,startsthemetricscollectionagentsonthesegmentservers,andstartsalistenerontheCommandCenterrpcport.

Youcanrunthe gpcc commandasthegpadminuseronthemasterhost(recommended)oronthestandbyhost.StartingCommandCenteronthestandbyhostisnotrecommendedbecauseitcancauseheavynetworktrafficbetweentheCommandCenteragentonthemasterhostandthebackendonthestandbyhost.

Toensurethe gpcc commandisonyourpath,sourcethe gpcc_path.sh fileintheCommandCenterinstallationdirectoryoraddittothestartupscriptforyourcommandshell.SeeSettingtheGreenplumCommandCenterEnvironmentforinstructions.

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.

SeetheWebServerParameterssectionofConfigurationFileReferenceforadescriptionoftheparametersinthisfile.

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

©CopyrightPivotalSoftwareInc,2013-2019 29 4.7.0

Page 30: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 30 4.7.0

Page 31: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

startcommandstartstheCommandCenteragenton

eachsegmenthost.StoppingCommandCenterwith gpccstop endstheseprocesses.TheCommandCenterbackendmonitorstheseagentsandrestartsthemwhennecessary.

InstallingthegpperfmondatabaseconfiguresGreenplumDatabasetorunagentsonthemasterhostandeachsegmenthost.Theagentsarestartedautomaticallywhenthedatabasesystemstartsup.TheGreenplumDatabasepostmasterprocessmonitorstheagentsandrestartsthemwhennecessary.

gpmmon

The gpmmon agentrunsontheGreenplumDatabasemasterhost.Itcollectsinitialqueryinformationfromthemaster.Every15seconds,bydefault,itpromptsthe gpsmon agentstosendtheiraccumulateddata.The gpmmon processsavesthemetricsdataandlogstoCSVtextfilesthatfeedtheexternaltablesinthegpperfmondatabase.

gpsmon

The gpsmon agentrunsoneachGreenplumDatabasesegmenthost.ItlistensonaUDPportformetricsemittedbyGreenplumDatabase,gathersadditionalmetricsfromtheoperatingsystem,andforwardsdatatothe gpmmon agentwhenrequested.

Thistopicdescribesbasicagentadministrationtasks,includingaddinghostsandviewingagentlogfiles.

ConfiguringgpmonRoleLoggingOptionsThemetricscollectionagentrunsqueriesonGreenplumDatabaseonbehalfofCommandCentertoperformactivitiessuchasretrievinginformationtodisplayintheCommandCenterUI,savingstateinthegpperfmonandpostgresdatabases,insertingalerteventrecords,andharvestingqueryhistoryforthegpmetricshistorytables.Theagentrunsthesequeriesusingthegpmondatabaserole.

Ifyoudonotwantallofthisqueryactivitiytobeloggedinthe 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.StopCommandCenterandrestartittostartagentsonthenewhosts.

Thegpperfmon gpsmon agentsonnewhostsaredetectedautomaticallybythemasteragent, gpmmon .Wheneverthe gp_enable_gpperfmon serverconfigurationparameterisenabledonthemaster,the gpmmon agentautomaticallydetects,starts,andbeginsharvestingdatafromnewsegmentagents.

ViewingandMaintainingAgentLogFilesLogmessagesfortheCommandCentermetricscollectoragentsaresavedinthe logs directoryoftheCommandCenterinstallationdirectory.

Logmessagesforthegpperfmonmasteragentarewrittentothefollowingfilebydefault:

$MASTER_DATA_DIRECTORY/gpperfmon/logs/gpmmon.log

Tochangethegpperfmonlogfilelocation,editthe log_location parameterin gpperfmon.conf .

Onthesegmenthosts,gpperfmonagentlogmessagesarewrittentoa gpsmon.log fileinthesegmentinstance’sdatadirectory.Forahostwithmultiple

©CopyrightPivotalSoftwareInc,2013-2019 31 4.7.0

Page 32: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

segments,theagentlogfileislocatedinthedatadirectoryofthefirstsegment,aslistedinthe gp_configuration tablebydbid.Ifthesegmentagentisunabletologintothisdirectory,itwilllogmessagestothehomedirectoryoftheuserrunningCommandCenter(typicallygpadmin).

ConfiguringgpperfmonLogFileRolloverAthigherlogginglevels,thesizeofthegpperfmonlogfilesmaygrowdramatically.Topreventthelogfilesfromgrowingtoexcessivesize,youcanaddanoptionallogrolloverparameterto gpperfmon.conf .Thevalueofthisparameterismeasuredinbytes.Forexample:

max_log_size=10485760

Withthissetting,thelogfileswillgrowto10MBbeforethesystemrollsoverthelogfile.Thetimestampisaddedtothelogfilenamewhenitisrolledover.Administratorsmustperiodicallycleanoutoldlogfilesthatarenolongerneeded.

©CopyrightPivotalSoftwareInc,2013-2019 32 4.7.0

Page 33: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 33 4.7.0

Page 34: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

SettingsTheAdmin>SettingsviewenablesCommandCenteradministratorstoconfiguresettingsforCommandCenterfeatures.

HistorysettingsClickEnablequerieshistorydatacollectiontosavequeryhistory,hostmetrics,anddiskusagemetricstotablesinthegpperfmondatabasegmetricsschema.

Enteranumberofsecondstosettheminimumruntimeforaquerytobesavedinhistory.Thedefaultistosaveallqueries.SetthisthresholdtopreventCommandCenterfromfillinghistorywithtrivialqueries.

CommandCenterbydefaultuseshistorydatacollectedbythe gpsmon and gpmmon agentsthatareinstalledandenabledwhenyoucreatethegpperfmondatabase.Theseagentssavehistorydatatothe“legacy”historytables,inthegpperfmondatabasepublicschema.HistoryandmetricscollectedbytheCommandCenter ccagent agentcanbesavedtoadifferentsetofhistorytables,inthegpperfmondatabasegpmetricsschema.

Whenyouenablequerieshistorydatacollection:

CommandCentersavesqueryandmetricshistoryinthegpmetricsschematablesinthegpperfmondatabaseforcompletedqueriesthatexecuteforatleastthenumberofsecondsyouspecify.Plannodehistoryisonlysavedforqueriesthatrunatleast10seconds,orthenumberofsecondsyouspecifyifgreaterthan10.SeegpmetricsSchemaReferenceforinformationaboutthehistorytables.

TheCommandCenterHistoryviewdisplayssavedhistoryandmetricsfromthegpmetricstablesinsteadoffromthelegacygpperfmontables.

Thegpperfmon gpmmon and gpsmon agentscontinuetopopulatethelegacygpperfmontables.

Ifyoudisablehistorydatacollection,theCommandCenterHistoryviewagaindisplaysdatafromthelegacyhistorytables.

©CopyrightPivotalSoftwareInc,2013-2019 34 4.7.0

Page 35: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

©CopyrightPivotalSoftwareInc,2013-2019 35 4.7.0

Page 36: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 36 4.7.0

Page 37: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

DescriptionOncestarted,theCommandCenterbackendmonitorsthemetricsagentswithaheartbeat.Ifafailedagentisdetected,thebackendspawnsanewagentprocess.

ExamplesStartCommandCenterandthemetricsagents,promptingforthegpmonpassword.

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

©CopyrightPivotalSoftwareInc,2013-2019 37 4.7.0

Page 38: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 38 4.7.0

Page 39: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 39 4.7.0

Page 40: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 40 4.7.0

Page 41: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 41 4.7.0

Page 42: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 42 4.7.0

Page 43: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 43 4.7.0

Page 44: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

CommandCenterAgentParametersThe $MASTER_DATA_DIRECTORY/gpperfmon/conf/gpperfmon.conf fileontheGreenplumDatabasemasterhoststoresconfigurationparametersfortheCommandCenteragents.Forconfigurationchangestotheseoptionstotakeeffect,youmustsave gpperfmon.conf andthenrestartGreenplumDatabaseserver( gpstop-

r).

ToenabletheCommandCenteragentswithinGreenplumDatabaseserver,youmustalsosettheGreenplumDatabaseServerConfigurationParameters.Seethe gpperfmon_install referenceintheGreenplumDatabaseUtilityGuidefordetails.

log_locationSpecifiesadirectorylocationforCommandCenterlogfiles.Defaultis $MASTER_DATA_DIRECTORY/gpperfmon/logs .

min_query_timeSpecifiestheminimumqueryruntimeinsecondsforstatisticscollection.CommandCenterlogsallqueriesthatrunlongerthanthisvalueinthequeries_historytable.Forquerieswithshorterruntimes,nohistoricaldataiscollected.Defaultsto20seconds.

Ifyouknowthatyouwanttocollectdataforallqueries,youcansetthisparametertoalowvalue.Settingtheminimumqueryruntimetozero,however,collectsdataevenforthenumerousqueriesrunbyCommandCenteritself,creatingalargeamountofdatathatmaynotbeuseful.

min_detailed_query_timeSpecifiestheminimumiteratorruntimeinsecondsforstatisticscollection.CommandCenterlogsalliteratorsthatrunlongerthanthisvalueintheiterators_historytable.Foriteratorswithshorterruntimes,nodataiscollected.Minimumvalueis10seconds.

Thisparameter’svaluemustalwaysbeequalto,orgreaterthan,thevalueof min_query_time .Setting min_detailed_query_time higherthanmin_query_time allowsyoutologdetailedqueryplaniteratordataonlyforespeciallycomplex,long-runningqueries,whilestillloggingbasicquerydataforshorterqueries.

Giventhecomplexityandsizeofiteratordata,youmaywanttoadjustthisparameteraccordingtothesizeofdatacollected.Iftheiterators_* tablesaregrowingtoexcessivesizewithoutprovidingusefulinformation,youcanraisethevalueofthisparametertologiteratordetailforfewerqueries.

max_log_sizeThisparameterisnotincludedingpperfmon.conf,butitmaybeaddedtothisfileforusewithGreenplumCommandCenter.

Topreventthelogfilesfromgrowingtoexcessivesize,youcanaddthe max_log_size parameterto gpperfmon.conf .Thevalueofthisparameterismeasuredinbytes.Forexample:

max_log_size=10485760

Withthissetting,thelogfileswillgrowto10MBbeforethesystemrollsovertoanewlogfile.

partition_ageThenumberofmonthsthatGreenplumCommandCenterstatisticsdatawillberetained.Thedefaultitis0,whichmeanswewon’tdropanydata.

quantumSpecifiesthetimeinsecondsbetweenupdatesfromCommandCenteragentsonallsegments.Validvaluesare10,15,20,30,and60.Defaultsto15seconds.

Ifyoupreferalessgranularviewofperformance,orwanttocollectandanalyzeminimalamountsofdataforsystemmetrics,chooseahigherquantum.Tocollectdatamorefrequently,choosealowervalue.

ignore_qexec_packetWhensettotrue,GreenplumCommandCenteragentsdonotcollectperformancedatainthegpperfmondatabase queries_* tables: rows_out ,cpu_elapsed , cpu_currpct , skew_cpu ,and skew_rows .Thedefaultsetting,true,reducestheamountofmemoryconsumedbythegpmmonprocess.Setthisparametertofalseifyourequirethisadditionalperformancedata.

smdw_aliasesThisparameterallowsyoutospecifyadditionalhostnamesforthestandbymaster.Forexample,ifthestandbymasterhastwoNICs,youcanenter:

smdw_aliases=smdw-1,smdw-2

ThisoptionalfaulttoleranceparameterisusefuliftheGreenplumCommandCenterlosesconnectivitywiththestandbymaster.Insteadofcontinuouslyretryingtoconnecttohostsmdw,itwilltrytoconnecttotheNIC-basedaliasesof smdw-1 and/or smdw-2 .ThisensuresthattheCommandCenterConsolecancontinuouslypollandmonitorthestandbymaster.

©CopyrightPivotalSoftwareInc,2013-2019 44 4.7.0

Page 45: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

©CopyrightPivotalSoftwareInc,2013-2019 45 4.7.0

Page 46: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 .Thedefaultis dev .In dev modeCommandCentershowsuserfriendlyerrorpages.Userfriendlyerrorpagesarenotrenderedin prod mode.

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 .

path = /usr/local

PathtothedirectorywhereGreenplumCommandCenterisinstalled.

display_name = <display_name>

Thedisplaynameforconsole.

enable-kerberos = [true | false]

TrueifKerberosauthenticationisenabledforCommandCenter.Thedefaultis false .

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

Thefullpathtotheserver’sSSLcertificate,ifSSLisenabled.

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

Theserver’sprivatekeyfileifSSLisenabled.

EnableHTTPS = [true | false]

EnablelisteningonthesecureSSLport.Thedefaultis true .

EnableHTTP = [true | false]

EnablelisteningontheHTTPport.Defaultis false .

httpport = <port>

Thewebserverport.Thedefaultis28080.

rpcport = <port>

TheportonwhichtheCommandCenterbackendreceivesdatafrommetricscollectoragents.Thedefaultis8899.

master_host = <hostname>

©CopyrightPivotalSoftwareInc,2013-2019 46 4.7.0

Page 47: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

TheGreenplumDatabasehostname.Thedefaultis localhost .

master_port = <port>

TheGreenplumDatabasemasterport.Thedefaultis 5432 .

©CopyrightPivotalSoftwareInc,2013-2019 47 4.7.0

Page 48: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 48 4.7.0

Page 49: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 49 4.7.0

Page 50: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

©CopyrightPivotalSoftwareInc,2013-2019 50 4.7.0

Page 51: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

GreenplumDatabaseServerConfigurationParameters

GreenplumDatabasegpperfmonDatabaseThefollowingGreenplumDatabaseconfigurationparametersmustbeuncommentedandsetintheserverconfigurationfile( postgresql.conf )toenabletheCommandCenterdatacollectionagents:

gp_enable_gpperfmon and gpperfmon_port mustbesetinboththemasterandsegment postgresql.conf files.

gp_enable_gpperfmon and gp_enable_gpperfmon onlyneedtobesetinthemaster postgresql.conf file.

Afterchangingthesesettings,theGreenplumDatabaseinstancemustberestartedforthechangestotakeeffect.

gp_enable_gpperfmonTurnsontheCommandCenterdatacollectionagentforasegment.Mustbesetinall postgresql.conf files(masterandallsegments).

gpperfmon_portThedefaultportfortheCommandCenteragentsis8888,butyoucansetthisparametertoadifferentportifrequired(masterandallsegments).

gp_gpperfmon_send_intervalSetsthefrequencyinsecondsthattheGreenplumDatabaseserverprocessessendqueryexecutionupdatestotheCommandCenteragentprocesses.

gp_external_enable_execThisparameterisenabledbydefaultandmustremainenabled.ItallowstheuseofexternaltablesthatexecuteOScommandsorscriptsonthesegmenthosts.TheCommandCenteragentsusethistypeofexternaltablestocollectcurrentsystemmetricsfromthesegments.

gpperfmon_log_alert_levelControlswhichmessagelevelsarewrittentothegpperfmonlog.Eachlevelincludesallthelevelsthatfollowit.Thelaterthelevel,thefewermessagesaresenttothelog.Thedefaultvalueiswarning.

shared_preload_librariesAcomma-separatedlistofsharedlibrariesthataretobepreloadedwhenGreenplumDatabasestarts.TheworkloadmanagementandquerymetricsextensionlibrariesmustbeincludedinthisconfigurationparametertouseGreenplumCommandCenter.

gp_enable_query_metricsWhenon,enablesquerymetricscollection.Thedefaultisoff.Aftersettingthisconfigurationparameter,GreenplumDatabasemustberestartedforthechangetotakeeffect.

gp_instrument_shmem_sizeTheamountofsharedmemory,inkilobytes,allocatedforquerymetrics.Thedefaultis5120andthemaximumis131072.Atstartup,ifgp_enable_query_metrics issettoon,GreenplumDatabaseallocatesspaceinsharedmemorytosavequerymetrics.Thismemoryisorganizedasaheaderandalistofslots.Thenumberofslotsneededdependsonthenumberofconcurrentqueriesandthenumberofexecutionplannodesperquery.Thedefaultvalue,5120,isbasedonaGreenplumDatabasesystemthatexecutesamaximumofabout250concurrentquerieswith120nodesperquery.Ifthe gp_enable_query_metrics configurationparameterisoff,oriftheslotsareexhausted,themetricsaremaintainedinlocalmemoryinsteadofinsharedmemory.

©CopyrightPivotalSoftwareInc,2013-2019 51 4.7.0

Page 52: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

SecuringGreenplumCommandCenterGreenplumCommandCenterConsolecanbesecuredbyencryptingnetworktrafficbetweenthewebserverandusers’browsers,authenticatingCommandCenterusers,andmanagingusers’permissionstoaccessCommandCenterfeatures.

SSL/TLSEncryptionGreenplumCommandCentersupportsSSL/TLSencryptiontosecureconnectionsbetweenbrowsersandtheCommandCenterwebserver.WhenSSLisenabled,CommandCenterusestheWebSocketsAPI,enablinglong-lived,full-duplexconnections,inadditiontoencryption.

ToenableSSL,youshouldhaveasignedcertificatefortheCommandCenterwebserverinplacewhenyouinstallCommandCenter.PlaceyourcertificateontheserverwhereCommandCenterisinstalled,forexampleinthe /etc/ssl/certs directoryoftheGreenplummasterhost.YouimportthecertificatewhenyouinstallCommandCenter.Thelocationsofthecertificateandprivatekeyfilesaresavedinthe $GPCC_HOME/conf/app.conf configurationfilefortheCommandCenter.SeeCommandCenterConsoleParametersfordetails.

Youcanrequestacertificatefromyourorganization’sinternalcertificateauthorityoracommercialcertificateauthority,oryoucanuseaself-signedcertificateyoucreateyourselfwithacryptographysuitesuchasOpenSSL.Ifyoucreateaself-signedcertificate,notethatclientswillhavetooverrideasecuritywarningwhentheyfirstconnecttotheCommandCenterwebserver.

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,KerberosauthenticationmustbeenabledfortheGreenplumDatabasesystemandCommandCentermustalsobeconfigured.UsersauthenticatewiththeKerberosKDContheirworkstations(using kinit ,forexample)beforeconnectingtotheCommandCenterwebserver.TherolenameinCommandCenteristheuser’sKerberosprincipalname.

FordetailsaboutsettingupKerberosauthentication,seeEnablingKerberosAuthenticationwithGreenplumCommandCenter.

SeethePostgreSQLAuthenticationmethods documentationforadditionaldetailsoftheauthenticationoptions.

Authorization

Note:ThefunctionalitydescribedinthissectionhasnotbeenfullyimplementedinGreenplumCommandCenter4.0.0.OnlyAdminandSelfOnly

©CopyrightPivotalSoftwareInc,2013-2019 52 4.7.0

Page 53: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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.

permissionlevelsareavailable.

©CopyrightPivotalSoftwareInc,2013-2019 53 4.7.0

Page 54: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 54 4.7.0

Page 55: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 55 4.7.0

Page 56: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 56 4.7.0

Page 57: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

fromtheChangeSelectedto…list.

EnablingorDisablingGuestAccesstoQueryMonitorWhenenabled,theGuestAccesstoQueryMonitorfeatureallowsanyonewithaccesstotheGreenplumCommandCenterwebservertoclickViewQueryMonitorontheCommandCentersign-inscreenandseetheQueryMonitorpagewithoutloggingin.TheseanonymoususerscannotcancelqueriesandcannotaccessanyotherCommandCenterfeatures.

Whenthisfeatureisoff,theViewQueryMonitorlinkdoesnotappearonthesign-inscreenandanonymoususerscannotseetheQueryMonitorpage.

CommandCenteruserswithAdminpermissioncantogglethefeatureonanoffwithamouseclick.UserswithOperatororOperatorBasicpermissionseeamessagereportingifthefeatureisonoroff.

©CopyrightPivotalSoftwareInc,2013-2019 57 4.7.0

Page 58: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 58 4.7.0

Page 59: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 59 4.7.0

Page 60: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 60 4.7.0

Page 61: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 ~gpadmin/.pgpass fileonthehostrunningCommandCenter.IfyourunCommandCenteronahostotherthantheGreenplumDatabasemasterhost,youmustcopythe ~gpadmin/.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 61 4.7.0

Page 62: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 62 4.7.0

Page 63: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 63 4.7.0

Page 64: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

©CopyrightPivotalSoftwareInc,2013-2019 64 4.7.0

Page 65: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

MonitoringtheGreenplumDatabaseSystemDashboard

ClusterState

SegmentStatus

ClusterMetrics

HostMetrics

StorageStatus

©CopyrightPivotalSoftwareInc,2013-2019 65 4.7.0

Page 66: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

Clickingonapanelprovidesmoredetailedinformationaboutthemetric.TheAlertspanelshowsthemostrecentmessagesfromtheGreenplumDatabaselogfile.SomeinformationisavailableonlytoCommandCenteruserswithAdminorOperatorpermissionlevel.

SystemInformationThefollowingsysteminformationisdisplayedatthetopofthepage.

UptimeTheelapsedtimesincetheGreenplumDatabasesystemwaslaststarted.

GPDBVersionTheversionoftheGreenplumDatabasesoftwarethemonitoredclusterisrunning.

GPCCVersionTheversionoftheGreenplumCommandCentersoftware.

ConnectionsThenumberofactiveGreenplumDatabasesessions(clientconnections).

ServerThedisplaynameforthisGreenplumCommandCenter.

LastSyncDateandtimethedatawaslastsynchronized.TheCommandCenteruserinterfaceupdatesviewswithlivedataevery15seconds.

SegmentHealthTheSegmentHealthsectionoftheDashboardprovidesaquickoverviewofthestatusofthedatabasesystemandsegmentsthisCommandCentermonitors.

DatabaseState

©CopyrightPivotalSoftwareInc,2013-2019 66 4.7.0

Page 67: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

DatabaseStateisthecurrentstateoftheGreenplumDatabasesystem.Thestatecanbeoneofthefollowing:

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 67 4.7.0

Page 68: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

©CopyrightPivotalSoftwareInc,2013-2019 68 4.7.0

Page 69: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

SystemInformationThefollowingsysteminformationisdisplayedatthetopofthepage.

UptimeTheelapsedtimesincetheGreenplumDatabasesystemwaslaststarted.

GPDBVersionTheversionoftheGreenplumDatabasesoftwarethemonitoredclusterisrunning.

GPCCVersionTheversionoftheGreenplumCommandCentersoftware.

ConnectionsThenumberofactiveGreenplumDatabasesessions(clientconnections).

ServerThedisplaynameforthisGreenplumCommandCenter.

LastSyncDateandtimethedatawaslastsynchronized.TheCommandCenteruserinterfaceupdatesviewswithlivedataevery15seconds.

SegmentHealthTheSegmentHealthsectionoftheDashboardprovidesaquickoverviewofthestatusofthedatabasesystemandsegmentsthisCommandCentermonitors.

DatabaseStateDatabaseStateisthecurrentstateoftheGreenplumDatabasesystem.Thestatecanbeoneofthefollowing:

©CopyrightPivotalSoftwareInc,2013-2019 69 4.7.0

Page 70: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 70 4.7.0

Page 71: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

©CopyrightPivotalSoftwareInc,2013-2019 71 4.7.0

Page 72: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 72 4.7.0

Page 73: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 73 4.7.0

Page 74: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

ReplicationModeThereplicationstatusforthesegment.SeeSegmentHealthforpossiblevalues.

LastEvent|[Total]Thedateandtimeoflastsegmenthealth-relatedactivity.Clicktodisplayalistofrecentevents.

©CopyrightPivotalSoftwareInc,2013-2019 74 4.7.0

Page 75: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 75 4.7.0

Page 76: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 76 4.7.0

Page 77: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

DiskandNetworkskewratingsarecalculatedaseachserver’sstandarddeviationfromthemeancalculatedfromallsegmenthosts.

LowValueiswithin1standarddeviationfromthemean.(Note:ifthevarianceofthesetislessthan3,skewisconsideredlowregardlessofdeviationfrommean.)

ModerateValueisbetween1and2standarddeviationsfromthemean.

VeryHighValueisgreaterthan3standarddeviationsfromthemean.

©CopyrightPivotalSoftwareInc,2013-2019 77 4.7.0

Page 78: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

StorageStatusTheStorageStatuspageshowscurrenthistoricaldiskusageforGreenplummasterandsegmenthosts.

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

TheGPSegmentsbarchartshowscombineddiskspaceforallsegments.

TheGPMastersbarchartshowscombineddiskspaceformasterandstandbymaster.

Hoverovereitherofthechartstoseethespaceused,free,andtotalingigabytesandasapercentageofthetotal.

GPSegmentsUsageHistoryTheGPSegmentsUsageHistorypanelpresentsachartofpercentageofdiskspaceinuseforthetimeperiodsetbythecontrolinthepanelheader.

Hoveroverthecharttoseethepercentagediskinuseonanygivenpoint.

StorageStatusTableTheStorageStatustableprovidescurrentdiskspaceusagemetricsforeachhostandbydatadirectorywithinhosts.

©CopyrightPivotalSoftwareInc,2013-2019 78 4.7.0

Page 79: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

MonitoringandManagingGreenplumDatabaseQueriesQueryMonitor

QueryDetails

QueryHistory

©CopyrightPivotalSoftwareInc,2013-2019 79 4.7.0

Page 80: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 80 4.7.0

Page 81: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 81 4.7.0

Page 82: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

QueryDetailsTheQueryDetailsviewdisplaysquerymetrics,thetextofthequery,andthequeryplanandprogressforasinglequeryselectedfromtheQueryMonitorview.

QueryExecutionMetricsTheQueryID,executionstatus,andruntimeofthequeryaredisplayedatthetop.

Thefollowingmetricsaredisplayedforthequery.

UserTheGreenplumDatabaserolethatsubmittedthequery.

DatabaseThenameofthedatabasethatwasqueried.

WorkloadThenameoftheresourcegrouporresourcequeuethatismanagingthequery.

PlannerThenameofthequeryplannerusedforthisquery,GPORCAorLegacy.

SubmittedThetimethequerywassubmittedtothequeryplanner.

QueuedTimeTheamountoftimethequeryhasbeen(orwas)inqueueawaitingexecution.

RunTime

©CopyrightPivotalSoftwareInc,2013-2019 82 4.7.0

Page 83: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Theamountoftimesincequeryexecutionbegan.

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.

Alistofqueriesthatholdlocksthatblockthisqueryandthelocktype.

©CopyrightPivotalSoftwareInc,2013-2019 83 4.7.0

Page 84: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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.

Theexpandedplanboxcontainsthefollowingmetrics.

Thetypeofoperator.Whentheoperatorisatablescan,thenameofthescannedtableisincluded.SeeQueryPlanExecutionfordescriptionsoftheoperators.

Informationrelatedtothecurrentoperation,suchasthehashkey,mergekey,joincondition,orfiltercondition.

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

©CopyrightPivotalSoftwareInc,2013-2019 84 4.7.0

Page 85: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

ActualRows-Thecurrentnumberofrowsproducedbythisstep.Notethatfornestedjoinoperators,theActualRowsisestimatedsincetheactualrowcountsarenotavailablewhilethejoinisexecuting.

EstimatedRows-Theestimatednumberofrowstheoperatorwillproduce.

TextualPlanSelecttheTextualPlantabandclickRUNEXPLAINtogeneratethetextrepresentationoftheexplainplan.

ThetextualplanistheoutputoftheGreenplumDatabase EXPLAIN commandforthequery.Thequeryplanstepsarelabeledwitharrows( -> )andthestructureofthequeryplantreeisindicatedwithindentation.

The Optimizerstatus: lineatthebottomofthetextualplanreportswhethertheexplainplanwasgeneratedusingtheGPORCAoptimizer(PQO)orthelegacyqueryoptimizer.

Forhelpreadingthetextualexplainplanseethe EXPLAIN commandintheGreenplumDatabaseReferenceGuideandQueryProfiling inthe

TheRUNEXPLAINbuttonisdimmedifCommandCenterisunabletogeneratetheexplainplan.CommandCenterisunabletogeneratetheexplainplanifthesizeofthequerytextisgreaterthan100Kcharactersorifthequerytextcontainsmultiplestatements.

©CopyrightPivotalSoftwareInc,2013-2019 85 4.7.0

Page 86: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

GreenplumDatabaseAdministratorGuide.SeeQueryExecutionfordescriptionsofthequeryoperators.

©CopyrightPivotalSoftwareInc,2013-2019 86 4.7.0

Page 87: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

HistoryTheHistorypageallowsyoutodisplaysystemmetricsandqueriesexecutedduringaspecifiedtimeperiod.Queriesmayalsobefilteredbydatabaseand/oruser.

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

Note:Bydefault,thehistorydatadisplayedonthisviewarecollectedandsavedinthegpperfmondatabasebythe gpmmon and gpsmon agents.Thatdataisnotderivedfromthereal-timemetricsdisplayedontheQueryMonitorandQueryDetailview.Variationsshouldbeexpectedduetothedifferentdatacollectionmethods.

OntheAdmin>Settingspageyoucanenablesavingthereal-timemetricstohistoryinthegpmetricsschemaofthegpperfmondatabase.Whenyouenablecollectingthishistory,theCommandCenterHistory,QueryMonitor,andQueryDetailviewsallusedataderivedfromthesamedatacollectionmethod.Whenyouselectaquerythatranforatleast10secondsintheHistoryview,youcanseethevisualqueryplan.

©CopyrightPivotalSoftwareInc,2013-2019 87 4.7.0

Page 88: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Torestrictqueriesthatdisplayinthequerytableatthebottomofthepage,enteraGreenplumdatabasenameintheDatabasefield,ausernameintheUserfield,orboth.Filteringbydatabaseanduseronlyaffectsthequeriesdisplayedinthetable.Themetricsdisplayedinchartsincludeallactivityduringtheselectedtimeperiod.

ClickSearchtodisplayresultsthatmatchyourcriteria.

Youcanclickanddragonacharttozoominonatimerange.ClickSearchtoupdatethequerylistandchartstotheselectedrange.

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

Inthequerylist,selectorhoveroveraquerytohighlightitsqueuedandruntimeinthecharts.

Chartsofthefollowingmetricsareavailable.Showorhidethematanytimewiththechecklistattheupperrightoftheview.

QueriesThenumberofqueriesrunningandthenumberofqueriesqueuedtorun.

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

UserTheGreenplumDatabaseuserwhosubmittedthequery.

DatabaseThenameofthedatabasethatwasqueried.

SubmitTimeThetimethequerywassubmittedtothequeryplanner.

QueuedTimeTheamountoftimeaqueryspentinthequeuebeforeitwasexecuted.

RunTimeTheamountoftimethequeryrequiredtoproducearesult.

EndTimeThetimethequerycompletedorwascancelled.

©CopyrightPivotalSoftwareInc,2013-2019 88 4.7.0

Page 89: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

RowSkewAmeasureofrowskewinthesystem.Rowskewoccurswhenonesegmentproducesadisproportionatenumberofrowsforaquery.ThisvalueisthecoefficientofvariationfortheRowsOutmetricofalliteratorsacrossallsegmentsforthisquery,multipliedby100.Forexample,avalueof.95isshownas95.

QueueThenameoftheresourcequeueforthequery.

PriorityEachqueryinheritsthepriorityassignedtoitsresourcequeue.

FormoreinformationaboutResourceQueuesandQueryPlans,refertotheGreenplumDatabaseAdministratorGuide.

©CopyrightPivotalSoftwareInc,2013-2019 89 4.7.0

Page 90: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 90 4.7.0

Page 91: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 91 4.7.0

Page 92: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 92 4.7.0

Page 93: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 93 4.7.0

Page 94: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

ManagingGreenplumDatabaseWorkloadsAboutWorkloads

ManagingGreenplumDatabaseResourceGroups

ImportingResourceQueuestoResourceGroups

AccessingtheWorkloadManagementConfigurationProgrammatically

TroubleshootingEnablingResourceGroups

©CopyrightPivotalSoftwareInc,2013-2019 94 4.7.0

Page 95: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

SeeUsingResourceGroups intheGreenplumDatabaseAdministratorGuideforafulldescriptionofresourcemanagementfeaturesavailablewithresourcegroupsandinstructionstoenableresourcegroupsinGreenplumDatabase.

OntheCommandCenterAdmin>WorkloadMgmtview,youcanperformthefollowingtasks:

CreatenewresourcegroupsinGreenplumDatabase

Deleteexistingresourcegroups

Changethenumberofconcurrenttransactionseachresourcegroupallows

ChangethepercentagesofavailablesystemCPUandmemoryeachresourcegroupmanages

ChangeGreenplumDatabaseroles’defaultresourcegroups

Writequeryassignmentrulestooverrideauser’sdefaultresourcegroupwhenatransactionexecutes

Writeidlesessiontimeoutrulesforeachresourcegrouptosettheamountoftimeasessioncanbeidlebeforeitiskilled

FormoreinformationaboutLinuxcgroupsandGreenplumDatabaseresourcegroupsseeUsingResourceGroups intheGreenplumDatabaseAdministratorGuide.

QueryassignmentrulesisaGreenplumCommandCenterresourcegroupenhancementthatyoucanusetomoreflexiblyassigntransactionstoresourcegroups.Withidlesessiontimeoutrulesyoucansettheamountoftimeasessionmanagedbyaresourcegroupisidlebeforeitisterminated.ThefollowingsectionsprovidemoreinformationabouttheseCommandCenterfeatures.

AboutQueryAssignmentRulesGreenplumDatabasedeferstotheworkloadmanagementdatabaseextensiontoassigntransactionstoresourcegroups.CommandCenteruserswithAdminpermissionlevelcancreateassignmentrulesinCommandCentertoassigntransactionstoresourcegroups.

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

AssignmentrulescanredirectatransactiontoaresourcegroupbasedonquerytagsoracombinationofquerytagsandtheGreenplumDatabaseroleexecutingthetransaction.

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

tags>'.Multiplequerytagscanbesetbyseparatingthemwithasemicolon.Querytagsaresetbeforeatransactionbegins

andcannotbechangedinsideofatransaction.

SeeWorkloadManagementfordetailsaboutcreatingassignmentrulesandforexamplesthatusequerytags.

AboutTimeoutRules

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

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

©CopyrightPivotalSoftwareInc,2013-2019 95 4.7.0

Page 96: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

CommandCenteradministratorscancreatesessiontimeoutrulesforresourcegroupsthatspecifythemaximumtimethatasessioncanremainidlebeforeitisterminated.WhenthesessionprocessontheGreenplumDatabasemasterbecomesidleandthespecifiedtimehaselapsed,thesessionterminatesitself.Sessionsthatbecomeidlewhileinsideofatransactionarenotsubjecttotimeoutrules.

Sessiontimeoutrulesareperresourcegroup,allowingyoutodeterminehowlongtowaitfordifferentclassesoftransactions.YoucanincludealistofGreenplumDatabaserolestoexemptfromtheruleandacustommessagetoaddtothesessionterminationerroroutput.

Creatingtimeoutrulesforthe admin_group resourcegroupisnotrecommended.AvoidcreatingrulesthatkillsessionsstartedbyGreenplumDatabaseclientapplicationsthataredesignedtohavealong-lastingorpersistentsession.Forexample,the gpmmon processcreatesasessionasthe gpmon roletoupdatethegpperfmondatabase.Anidlesessiontimeoutrulethatkillsidle gpmon sessionstooquicklycouldcauseGreenplumDatabasetologmanysessionterminationmessagesandunnecessarilycreatenewsessions.SeeWorkloadManagementfordetailsaboutcreatingtimeoutrules.

©CopyrightPivotalSoftwareInc,2013-2019 96 4.7.0

Page 97: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 97 4.7.0

Page 98: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

AssigningRolestoResourceGroupsEveryGreenplumDatabaseroleisassignedtoasingleresourcegroupinthe pg_roles systemtable.Transactionsexecutedbyarolearemanagedbyitsassignedresourcegroup,unlessyoucreateanassignmentruletooverridethedefault.

Youcanviewthecurrentresourcegroupassignmentsforallrolesandchangearole’sresourcegroupbyaddingittoadifferentresourcegroup.

Tomovearoletoadifferentresourcegroup:

1. Enterallorpartoftherolenameintheaddrolefieldbeneaththenewresourcegroup.

2. ChoosetherolefromthelistthatisdisplayedandpressEnter.

ThechangeisimmediatelyappliedtotheGreenplumDatabase pg_roles systemtable.

DefiningWorkloadManagementRulesWorkloadmanagementrulesincludequeryassignmentrulesandtimeoutrules.

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

Timeoutrulessettheamountoftimeasessioncanbeidlebeforeitisterminated.Youcreateatimeoutruleforeachresourcegroup.SeeAboutTimeoutRulesformoreinformationabouttimeoutrules.

SeeAccessingtheWorkloadConfigurationProgrammaticallyforinformationaboutretrievingandsettingrulesprogrammaticallywithdatabasefunctions.

1. ClickEDITtoopentheWorkloadManagementRuleseditor.

2. Todeletearule,selecttheruleandclicktheminussignthatappearsattheright.

3. Toaddanassignmentrule,clickADDASSIGNMENTRULEandfillinthefields.

©CopyrightPivotalSoftwareInc,2013-2019 98 4.7.0

Page 99: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

QueryTags

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

Role(Optional)Ifyouenterarolenameinthisfield,therulematchesonlyifboththequerytagsandrolematchthetagsandcurrentroleinthedatabasesession.

ResourceGroupChoosearesourcegroupfromthelist.

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

4. Toaddatimeoutrule,clickADDTIMEOUTRULEandfillinthefields.ResourceGroup

Choosearesourcegroupfromthelist.Timebeforeidleconnectionskilled

Theamountoftimebeforeanidlesessionisterminated.Enteranintegervalueforthenumberofsecondsorminutesandchooseminutesorsecondsfromthelist.Avalueof600seconds,forexample,terminatesthesessionafterithasbeenidlefor10minutes.SeeAboutTimeoutRulesforwarningsaboutsettingtimeoutsforthe admin_group resourcegroupandresourcegroupswithrolesthatrequirepersistentsessions.

ExemptedrolesTheruleisnotappliedtorolesaddedtothisfield.Openthelisttochooserolestoexemptfromtherule.Onlyrolesfortheselectedresourcegroupareincludedinthelist.Toremovearolefromthefield,clickthexnexttotherolename.

MessageEnterthemessagetologwhenasessioniskilledbythisrule.

5. 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.

©CopyrightPivotalSoftwareInc,2013-2019 99 4.7.0

Page 100: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

$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 100 4.7.0

Page 101: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 101 4.7.0

Page 102: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 102 4.7.0

Page 103: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

YouarenowabletousetheCommandCenterWorkloadManagementinterfacetoadd,remove,andconfigureresourcegroups;changeroleassignments;anddefineworkloadmanagementrules.

SeeWorkloadManagementforhelpusingtheCommandCenterWorkloadManagementview.

©CopyrightPivotalSoftwareInc,2013-2019 103 4.7.0

Page 104: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

AccessingtheWorkloadConfigurationProgrammaticallyTheGreenplumDatabaseworkloadmanagementextension gp_wlm createsatableinthepostgresdatabasetostoretheworkloadmanagementrules,anduser-definedfunctionstogetorsettheworkloadmanagementrules.

The gpcc.workload_config tablestorestheworkloadmanagementrulesasaJSONvalue.Youcanusethe gpcc.get_workload_config() andgpcc.set_workload_config() functionstoreadandwritethisJSONvalue.

ThistopicisareferencefortheworkloadmanagementconfigurationJSONdocumentandthegetandsetfunctions.

WorkloadManagementRulesJSONFormatThissectiondescribestheJSONobjectthatstorestheresourcegroupassignmentandidlesessiontimeoutrules.Theobjecthasthreemembers:

a version key/valuepair

an assignmentRules arraycontainingoneelementforeachassignmentrule

an idleSessionKillRules listcontainingonekey/valuepairforeachresourcegroup

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 gpcc.workload_config tableshouldonlybeaccessedbyusingthe gpcc.get_workload_config() and gpcc.set_workload_config() functionsortheCommandCenteruserinterface.Donotdropthetablewhiletheworkloadmanagementextensionisenabled.

The gpcc.set_workload_config() functionrequiresvalidJSONsyntax,butdoesnotvalidatetheworkloadmanagementrules.YoumustensurethattheJSONvaluecontainsa version variable,andcorrectlyspecifiedassignmentandidlesessiontimeoutrules.

©CopyrightPivotalSoftwareInc,2013-2019 104 4.7.0

Page 105: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

=#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" .

gpcc.get_workload_config()RetrievesthecurrentworkloadassignmentrulesasaJSONvalue.

Example

postgres=#SELECTgpcc.get_workload_config();get_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}],"idleSessionKillRules":{"admin_group":{"timeoutSeconds":600},"default_group":{"timeoutSeconds":3600}}}

(1row)

gpcc.set_workload_config()Setstheworkloadassignmentrules.TheargumentisavalidJSONvaluecontainingtheassignmentrulesan.SeeJSONParametersfordescriptionsoftheparameters.

©CopyrightPivotalSoftwareInc,2013-2019 105 4.7.0

Page 106: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Ifyoucall gpcc.set_workload_config() withinatransaction,youmustcommitthetransactionbeforetheworkloadmanagmentextensionappliesthenewrules.

Example

postgres=#SELECTgpcc.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}],"idleSessionKillRules":{"admin_group":{"timeoutSeconds":600},"default_group":{"timeoutSeconds":3600}}}');set_workload_config---------------------t(1row)

The gpcc.set_workload_config() functionacceptsanyvalidJSONvalue.Youmustensurethatthevaluecontainsa version elementandproperlyspecifiedassignmentandidlesessiontimeoutrules.

©CopyrightPivotalSoftwareInc,2013-2019 106 4.7.0

Page 107: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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" .

$gpconfig-cgp_resource_manager-v"group"

Verifybyshowingthevalueoftheparameter:

$gpconfig-sgp_resource_managerValuesonallsegmentsareconsistentGUC:gp_resource_managerMastervalue:groupSegmentvalue:group

AfterinstallingaPivotalGreenplumDatabasedistribution,the shared_preload_libraries configurationparametercontainsthemetricscollectorandworkloadmanagerextensionsharedlibraries.Makesuretheselibrariesarestillpresent:

$gpconfig-sshared_preload_librariesValuesonallsegmentsareconsistentGUC:shared_preload_librariesMastervalue:$libdir/metrics_collector,$libdir/gp_wlmSegmentvalue:$libdir/metrics_collector,$libdir/gp_wlm

Checkthatthesharedlibrariesexistat $GPHOME/lib/postgresql/metrics_collector.so and $GPHOME/lib/postgresql/gp_wlm.so .Ifthelibrariesdonotexist,makesureyouhaveinstalledthePivotalGreenplumDatabasedistribution.TheseextensionsarenotavailableintheGreenplumDatabaseOpenSourceversion.Ifthesharedlibraryfilesexistinthe $GPHOME/lib/postgresql directory,butnotinthe shared_preload_libraries parameter,addthemwiththe gpconfig

command:

$gpconfig-cshared_preload_libraries-v'\$libdir/metrics_collector,\$libdir/gp_wlm'

Notethataddingthelibrariestothe 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 107 4.7.0

Page 108: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Admin>WorkloadMgmtview.

$psqlpostgres\dxpostgres=#\dxListofinstalledextensionsName|Version|Schema|Description--------+---------+--------+--------------------------------------gp_wlm|0.1|gpcc|GreenplumWorkloadManagerExtension

Makesurethe gpcc.workload_config tableandfunctionsarepresentinthepostgresdatabase:

$psqlpostgrespostgres=#\dgpcc.*Table"gpcc.workload_config"Column|Type|Modifiers----------+---------+-----------dist_col|integer|config|json|Distributedby:(dist_col)postgres=#\dfgpcc.*ListoffunctionsSchema|Name|Resultdatatype|Argumentdatatypes|Type--------+---------------------+------------------+----------------------+-------gpcc|get_workload_config|json||normalgpcc|set_workload_config|boolean|wlm_json_configjson|normal(2rows)

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

$psqlpostgrespostgres=#DROPEXTENSIONgp_wlm;DROPEXTENSIONpostgres=#CREATEEXTENSIONgp_wlm;CREATEEXTENSION

©CopyrightPivotalSoftwareInc,2013-2019 108 4.7.0

Page 109: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

QueryMonitorHelpTopicsCPU

CPUSkew

Locks

QueryOptimization

Memory

SpillFiles

©CopyrightPivotalSoftwareInc,2013-2019 109 4.7.0

Page 110: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 110 4.7.0

Page 111: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 111 4.7.0

Page 112: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 112 4.7.0

Page 113: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

©CopyrightPivotalSoftwareInc,2013-2019 113 4.7.0

Page 114: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 114 4.7.0

Page 115: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 115 4.7.0

Page 116: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 116 4.7.0

Page 117: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 117 4.7.0

Page 118: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Aggregatesrowsusingahash.

MotionOperatorsBroadcastmotion

Everysegmentsendsitsownlocaldatatoallothersegmentinstancessothateverysegmentinstancehasacompletelocalcopyofthetable.

RedistributionmotionSendsdatafromonetabletoanothersegmentsothatmatchingrowsarelocatedtogether,enablingalocaljoin.

GathermotionAllsegmentssendrowstothemasterwheretheyaregatheredintoasingleresultset.

DMLOperatorsAssert

Performsconstraintschecking.

SplitUsedforupdateoperations.

©CopyrightPivotalSoftwareInc,2013-2019 118 4.7.0

Page 119: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 119 4.7.0

Page 120: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

SeealsoManagingSpillFilesGeneratedbyQueries .

©CopyrightPivotalSoftwareInc,2013-2019 120 4.7.0

Page 121: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 121 4.7.0

Page 122: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 122 4.7.0

Page 123: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 123 4.7.0

Page 124: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

Whatisthisalert?Whenthemasterhostmemoryusageishigherthanthespecifiedpercentageformorethanthespecifiednumberofminutes,CommandCenterraisesanalert.

CommandCentersamplesthememoryinuseonthemasterhosteveryfifteenseconds.Memoryusedforkernelbuffersandcacheisexcludedfromthecalculation.Analertisraisedifthesamplescollectedduringthenumberofminutesspecifiedareallhigherthanthespecifiedpercentage.

WhattodoUsethe ps commandtoidentifynon-databaseprocessesconsumingexcessivememoryandstopthemorrelocatethemtootherservers.

IfCommandCenterisrunningonthemasterhost,restartitonthestandbymasterhost.

©CopyrightPivotalSoftwareInc,2013-2019 124 4.7.0

Page 125: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Totaldiskspaceexceeds[%]

Whatisthisalert?Thisalertisraisedwhenthepercentageofsegmenthostdiskspaceinuseexceedsthepercentagespecifiedinthealertrule.Themasterdiskspaceisnotincludedinthecalculation.Thealertisraisedonceadayuntilthepercentagedropsbelowthepercentageinthealertrule.

WhattodoThisalertwarnsyousothatyoucanadddiskstorageorfreeupstorageinordertopreventacatastrophicdiskfullerrorthatcouldinterruptGreenplumDatabaseservice.

HerearesomesuggestionsforfreeingspaceonGreenplumDatabasehosts.

Archiveandremovebackupfiles

Archiveanddropolderpartitions

RotateOSanddatabaselogfiles

Dropunneededexternaltablesandtheirdatafiles

Vaccuumdatabasetablesandcatalogtables

©CopyrightPivotalSoftwareInc,2013-2019 125 4.7.0

Page 126: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 126 4.7.0

Page 127: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 127 4.7.0

Page 128: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 128 4.7.0

Page 129: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 129 4.7.0

Page 130: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

Queryruntimeexceeds[min]

Whatisthisalert?Analertisraisedifthetotalruntimeforaqueryisgreaterthanthespecifiednumberofminutes.Thealertisraisedonceperquery.

Runtimeiscalculatedfromthetimethequerybeginstoexecute.Thetimethequerywasqueuedisexcluded.

AlertdetailsqueryID

databasename

username

timethequerywassubmitted

timethequerystarted

WhattodoUsetheQueryMonitortochecktheexecutionstatusofthequery.

Ifthequeryisblocked,investigatethequeriesthatholdthelocks.

©CopyrightPivotalSoftwareInc,2013-2019 130 4.7.0

Page 131: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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

Whatisthisalert?CommandCentersamplesCPUusageonallsegmenthostsevery15secondsandcalculatestheaverageCPUusageforthecluster.AnalertisraisediftheaverageCPUusageisgreaterthanthespecifiedpercentageforlongerthanthespecifiednumberofminutes.

WhattodoUsetheCommandCenterQueryMonitortoidentifycurrentlyrunningindividualquerieswithhighCPUusage.

UsetheCommandCenterHistoryviewtoseeCPUloadduringtheperiodpriortothealertandidentifycompletedqueriesusingtoomuchCPU.

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

©CopyrightPivotalSoftwareInc,2013-2019 131 4.7.0

Page 132: Pivotal Greenplum Command Center - Pivotal GPCC Docs · 165236914 - The gpcc command-line utility did not work with the -W option. This has been fixed. The gpcc command will use the

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 132 4.7.0