Upload
others
View
29
Download
0
Embed Size (px)
Citation preview
PivotalGreenplum®
CommandCenter
Version4.0
UserGuide
Rev:01
©2018PivotalSoftware,Inc.
23469
10121617181920222324252729313338404143454749515455575859616467686972
TableofContents
TableofContentsPivotalGreenplumCommandCenter4.0DocumentationPivotalGreenplum®CommandCenter4.0.0ReleaseNotesAboutPivotalGreenplumCommandCenterInstallingtheGreenplumCommandCenterSoftwareCreatingthegpperfmonDatabaseInstallingPivotalGreenplumCommandCenterSettingtheGreenplumCommandCenterEnvironmentUninstallingGreenplumCommandCenterAdministeringGreenplumCommandCenterAbouttheCommandCenterInstallationAdministeringtheCommandCenterWebServerAdministeringCommandCenterAgentsAdministeringthegpperfmonDatabaseConfiguringGreenplumCommandCenterSecuringGreenplumCommandCenterManagingGreenplumCommandCenterAuthenticationManagingGreenplumCommandCenterPermissionsSecuringthegpmonDatabaseUserEnablingAuthenticationwithKerberosgpccConfigurationFileReferenceCommandCenterAgentParametersCommandCenterConsoleParametersSetupConfigurationFileGreenplumDatabaseServerConfigurationParametersGreenplumDatabaseClusterStateMonitoringSegmentStatusClusterMetricsHostMetricsStorageStatusMonitoringandManagingGreenplumDatabaseQueriesQueryMonitorQueryDetailsHistoryManagingGreenplumDatabaseWorkloadsAboutGreenplumCommandCenterWorkloadsEnablingWorkloadManagementinGreenplumCommandCenterManagingWorkloadQueryAssignmentFilters
©CopyrightPivotalSoftwareInc,2013-2018 2 4.0.0
PivotalGreenplumCommandCenter4.0DocumentationGreenplumCommandCenter4.0ReleaseNotes
AboutGreenplumCommandCenter
InstallationandAdministration
InstallingGreenplumCommandCenter
AdministeringGreenplumCommandCenter
ManagingtheGreenplumDatabaseSystemwithGPCC
GreenplumDatabaseClusterState
SegmentStatus
ClusterMetrics
HostMetrics
StorageStatus
MonitoringandManagingGreenplumDatabaseQueries
MonitoringGreenplumDatabaseQueries
QueryTextandPlan
QueryHistory
ManagingGreenplumDatabaseWorkloads
AboutWorkloads
EnablingWorkloadManagement
SettingUpWorkloadAssignmentFilters
©CopyrightPivotalSoftwareInc,2013-2018 3 4.0.0
PivotalGreenplum®CommandCenter4.0.0ReleaseNotes
AboutThisReleasePivotalGreenplumCommandCenterrelease4.0isamajornewreleaseoftheGreenplumDatabasemanagementconsole.
SeeEnhancementsandChangesinGreenplumCommandCenter4.0forinformationaboutnewfeaturesandchangesinthisCommandCenterrelease.
SupportedPlatformsGreenplumCommandCenter4.0iscompatiblewiththefollowingplatforms.
GreenplumDatabase5.7.0andhigher
RedHatEnterpriseLinux6.xand7.x
CentOS6.xand7.x
IfyouuseresourcegroupsandworkloadmanagementonRedHatorCentOS6.x,upgradeyourkernelto2.6.32-696orhighertobenefitfromimprovementsintheLinuxcgroupsservice.
EnhancementsandChangesinGreenplumCommandCenter4.0
CommandCenterInstallationChangesGreenplumCommandCenter4.0software,unlikepreviousreleases,isinstalledoneveryhostintheGreenplumDatabasecluster.CommandCentercanalsorunonanyhostinthecluster.ItisrecommendedtostartCommandCenteronthestandbymasterhosttoavoidincreasingloadonthemasterhost.
TomodifytheCommandCenterinstallation—forexampletoenableordisableSSLorinstallCommandCenteronneworreplacedhosts—justre-executetheinstallerandrestartCommandCenter.ItisnotnecessarytouninstallCommandCenterbeforereinstalling.
ThereisoneCommandCenterinstallationperGreenplumDatabasecluster.ItisnolongernecessarytocreateCommandCenterinstancesafterinstallingthesoftware.
The gpcmdr command-lineutilityisreplacedwiththenew gpcc utility.Usethe gpcc utilitytostartandstopCommandCenterandmetricscollectionagents,checkCommandCenterstatus,andenableordisableKerberosauthentication.
Inpreviousreleases,thegpmonrolerequiredonlylocalconnectionstodatabasesontheGreenplummasterhost.InGreenplumCommandCenter4.0,thegpmonusermustbeabletoconnecttodatabasesfromthehostrunningtheCommandCenterwebserverandbackend,whichrequiresaddingahostentrytothe pg_hba.conf authenticationconfigurationfile.
Real-timeQueryMetricsGreenplumCommandCenter4.0introducesreal-timequerymetricsforPivotalGreenplumDatabase5.7andabove.ThisnewfeaturecombinesthefollowingnewfeaturesinGreenplumDatabaseandGreenplumCommandCenter:
GreenplumDatabasesavesqueryexecutionmetricsinsharedmemorywhilequeriesexecute.
AnewGreenplumDatabasemetricscollectionextension,includedwithPivotalGreenplumDatabase,emitsthesavedmetricsasUDPdatagrams.
AnewGreenplumCommandCentermetricscollectionagentrunningoneachGreenplumDatabasehostreceivesthedatagramsandpostsmetricstotheGreenplumCommandCenterbackend.TheCommandCenterbackendstartsandmanagesthemetricscollectionagents.
TheCommandCenterQuerymonitorviewupdatesinrealtimesoyoucanseequeriesthatarewaitingtoexecuteandthecurrentstatusandresourceusageforqueriesthatarerunning.
Metricscollectionnowincludeslockandspillfileinformation.OntheQueryMonitor,youcanseewhichqueriesareblockedandwhichqueriesholdthelocksblockingthem.TheQueryMonitorshowsthetotalsizeofspillfilescreatedonallsegmentsforeachquery.
©CopyrightPivotalSoftwareInc,2013-2018 4 4.0.0
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.
UnimplementedFeaturesSomefeaturesavailableinpreviousGreenplumCommandCenterreleasesarenotyetimplementedinCommandCenter4.0.
TheBasic,OperatorBasic,andOperatorpermissionlevelsarenotyetimplemented.Youcanonlychangearole’spermissionlevelbetweenSelfOnlyandAdmin.
TheabilityforaCommandCenteradmintopostamessagetotheQueryMonitorviewisnotyetimplemented.
Themulti-clusterviewhasbeenremoved.
©CopyrightPivotalSoftwareInc,2013-2018 5 4.0.0
AboutPivotalGreenplumCommandCenterPivotalGreenplumCommandCenterisamanagementtoolforthePivotalGreenplumDatabaseBigDataPlatform.ThistopicintroduceskeyconceptsaboutGreenplumCommandCenteranditscomponents.
GreenplumCommandCenterFeaturesGreenplumCommandCentermonitorssystemperformancemetrics,analyzesclusterhealth,andenablesdatabaseadministratorstoperformmanagementtasksinaGreenplumDatabaseenvironment.
GreenplumCommandCenterprovidesabrowser-nativeHTML5graphicalconsoleforviewingGreenplumDatabasesystemmetricsandperformingcertaindatabaseadministrativetasks.TheCommandCenterapplicationprovidesthefollowingfunctionality:
Interactiveoverviewofrealtimesystemmetrics.Drilldowntoseedetailsforindividualclusterhostsandsegments.
Detailedrealtimestatisticsfortheclusterandbyserver.
QueryMonitorviewlistsqueriesexecuting,waitingtoexecute,andblockedbylocksheldbyotherqueries.
QueryDetailviewshowsquerymetrics,querytext,andtheexecutionplanforthequery.
WorkloadviewallowsadministratorstocreateandmanageworkloadstomanageconcurrencyandallocateCPUandmemoryresources.Createassignmentcriteriatoassigntransactionstoworkloads.
Fourpermissionlevelsallowuserstovieworcanceltheirownorothers’queries,andtoviewormanageadministrativeinformation.
ClusterMetricsviewshowssynchronizedchartsofhistoricalsystemmetrics.
Historyviewlistscompletedqueriesandsystemmetricsplottedoveraselectedtimeperiod.
PermissionsviewtoseeormanageCommandCenterpermissionlevels.
Authenticationviewtoseeoreditthe pg_hba.conf host-basedauthenticationconfigurationfile.
SegmentStatusviewwithsummariesanddetailsbysegment.
StorageStatusviewwithsummariesanddetailsbysegmentdatadirectory.
GreenplumCommandCenterArchitectureThefollowingfigureillustratestheGreenplumCommandCenterarchitecture.
©CopyrightPivotalSoftwareInc,2013-2018 6 4.0.0
GreenplumCommandCenterWebServerandWebApplicationTheGreenplumCommandCenterwebserverandbackendapplicationcanrunonthemaster,standbymaster,oranysegmenthostintheGreenplumDatabasecluster—thestandbymasterhostisrecommended.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—processesrunningoneachhostlisteningforUDPpackets—tocollectmetrics.ThegpperfmonagentsforwardcollecteddatatoanagentontheGreenplumDatabasemaster.Thereal-timequerymetricsagentssubmitcollecteddatadirectlytotheCommandCenterrpcport.TheagentsalsocollectdatafromthehostoperatingsystemsothatqueryperformancecanbecorrelatedwithCPUandmemoryutilizationanddiskspacecanbemonitoredinCommandCenter.
GreenplumDatabasePerformanceMonitoringDatabaseThegpperfmonperformancemonitoringdatabasestorescurrentandhistoricalquerystatusandsysteminformationcollectedfromagentsrunningonthemasterandsegmenthosts.GreenplumCommandCenterusesgpperfmonforhistoricaldataonly;itusesthereal-timequerymetricstomonitoractiveandqueuedqueries.GreenplumDatabasesendsUDPpacketsatvariouspointsduringqueryexecution.The gpsmon processoneachsegmenthostcollectsthedata.Periodically,every15secondsbydefault,a gpmmon agentonthemasterhostsignalsthe gpsmon processtoforwardthecollecteddata.Theagentonthemasterhostreceivesthedataandaddsittothegpperfmondatabase.
TheCommandCenterdatabaseconsistsofthreesetsoftables:
nowtablesstoredataoncurrentsystemmetricssuchasactivequeries
historytablesstoredataonhistoricalmetrics
tailtablesarefordataintransition.Tailtablesareforinternaluseonlyandshouldnotbequeriedbyusers.
Thenowandtaildataarestoredastextfilesonthemasterhostfilesystem,andtheCommandCenterdatabaseaccessesthemviaexternaltables.Thehistorytablesareregulardatabasetablesstoredwithinthegpperfmondatabase.
YoucanrunSQLqueriesonthedatastoredinthegpperfmondatabase.GreenplumCommandCenterrunsqueriesonthedatabaseforinformationpresentedintheCommandCenterConsole.TheGreenplumDatabaseReferenceGuidecontainsreferencesforthetablesinthegpperfmondatabase.
GreenplumDatabaseprovidesamanagementutility, gpperfmon_install ,tocreatethegpperfmondatabaseandenablethegpperfmonagentsonthemasterandsegmenthosts.CreatingthegpperfmondatabaseisaprerequisiteforinstallingGreenplumCommandCenter.SeetheGreenplumDatabaseUtilityGuidefordetailsofrunningthe gpperfmon_install managementutility.
Real-TimeQueryMetricsCollectionThedatacollectedbyreal-timequerymetricscollectionismoredetailedandmorecurrentthanstatisticsrecordedinthegpperfmondatabase.CommandCenteruserscanobservequeriesastheyexecuteand,withsufficientpermissions,cancelproblemqueriestoallowotherqueriestocomplete.
TheGreenplumDatabasequerymetricsextensionandthemetricscollectionagentworktogethertocollectreal-timemetricsandupdatetheCommandCenterapplication.
GreenplumDatabasecallsthequerymetricsextensionwhenaqueryisfirstsubmitted,whenaquery’sstatuschanges,andwhenanodeinthequeryexecutionplaninitializes,starts,orfinishes.ThequerymetricsextensionsendsmetricsinUDPpacketstothemetricscollectionagentrunningoneachsegmenthost.Theextensionalsocollectsinformationaboutthelocksqueriesholdsothatyoucanseewhichqueriesholdlocksthatblockotherqueries.
©CopyrightPivotalSoftwareInc,2013-2018 7 4.0.0
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.
SeeEnablingWorkloadManagementinGreenplumCommandCenterforthestepstofollowtoenableLinuxcgroups,GreenplumDatabaseresourcegroups,andCommandCenterworkloads.
©CopyrightPivotalSoftwareInc,2013-2018 8 4.0.0
InstallingtheGreenplumCommandCenterSoftwareThissectioncontainsthefollowingtopics:
InstallingPivotalGreenplumCommandCenter
SettingtheGreenplumCommandCenterEnvironment
CreatingthegpperfmonDatabase
UninstallingGreenplumCommandCenter
©CopyrightPivotalSoftwareInc,2013-2018 9 4.0.0
CreatingthegpperfmonDatabaseThistopicdescribeshowtocreatetheCommandCentergpperfmondatabaseandenablethegpperfmondatacollectionagents.ThistaskmustbecompletedonetimefortheGreenplumDatabasesystem,beforeyouinstallGreenplumCommandCenter.
Whenthedatacollectionagentsareenabled,theirprocessesarestartedandstopped(using gpstart and gpstop )ontheGreenplumsegmenthostsalongwiththeGreenplumDatabaseserverprocesses.
GreenplumDatabaseincludesa gpperfmon_install utilitythatperformsthefollowingtasks:
CreatestheCommandCenterdatabase(gpperfmon).
CreatestheCommandCentersuperuserrole( gpmon ).
ConfiguresGreenplumDatabaseservertoacceptconnectionsfromthe gpmon role(editsthe pg_hba.conf and .pgpass files).
SetstheCommandCenterserverconfigurationparametersintheGreenplumDatabaseserver postgresql.conf files.
The gpperfmon_install utilityandtheagentsarepartoftheGreenplumDatabasesoftware.ThetasksinthistopiccanbeperformedbeforeoraftertheCommandCentersoftwareisinstalled.
EnablingtheCollectionAgents1. LogintotheGreenplummasterhostasthe gpadmin user.
$su-gpadmin
2. SourcethepathfilefromtheGreenplumDatabaseinstallationdirectory:
#source/usr/local/greenplum-db/greenplum_path.sh
3. Runthe gpperfmon_install utilitywiththe --enable option.YoumustsupplytheconnectionportoftheGreenplumDatabasemasterserverprocess,andsetthepasswordforthe gpmon superuserthatwillbecreated.Forexample:
$gpperfmon_install--enable--passwordchangeme--port5432
Note:The gpperfmon_install utilitycreatesentriesforthe gpmon userinthe $MASTER_DATABASE/pg_hba.conf file.SeegpmonUserAuthenticationfornotesaboutrestrictingthegpmonuser’saccesstodatabases.Thepasswordyouspecifyissavedina .pgpass fileinthe gpadmin user’shomedirectory.SeeChangingthegpmonPasswordforstepstochangethegpmon password.
4. Whentheutilitycompletes,restartGreenplumDatabaseserver.Thedatacollectionagentsdonotstartuntilthedatabaseisrestarted.
$gpstop-r
5. Usingthe ps command,verifythatthedatacollectionprocessisrunningontheGreenplummaster.Forexample:
$ps-ef|grepgpmmon
6. Runthefollowingcommandtoverifythatthe gpmon usercanauthenticateandthatthedatacollectionprocessesarewritingtotheCommandCenterdatabase.Ifallofthesegmentdatacollectionagentsarerunning,youshouldseeonerowpersegmenthost.
$psql-Ugpmongpperfmon-c'SELECT*FROMsystem_now;'
Thedatacollectionagentsarenowrunning,andyourGreenplumsystemnowhasagpperfmondatabaseinstalled.ThisisthedatabasewherehistoricalCommandCenterdataisstored.Youcanconnecttoitasfollows:
$psqlgpperfmon
©CopyrightPivotalSoftwareInc,2013-2018 10 4.0.0
ConfiguringaStandbyMasterHost(ifenabled)1. Copythe $MASTER_DATA_DIRECTORY/pg_hba.conf filefromyourprimarymasterhosttoyourstandbymasterhost.Thisensuresthattherequired
connectionoptionsarealsosetonthestandbymaster.
2. Copyyour ~/.pgpass filefromyourprimarymasterhosttoyourstandbymasterhost.Thisfileusuallyresidesinthe gpadmin user’shomedirectory.Notethatthepermissionson .pgpass mustbesetto600(forexample: chmod 0600 ~/.pgpass ).
gpmonUserAuthenticationThe gpperfmon_install utilityaddsentriesforthe gpmon usertothe pg_hba.conf file,whichallowsthe gpmon usertomakealocalconnectiontoanydatabaseintheGreenplumcluster.
localgpperfmongpmonmd5hostallgpmon127.0.0.1/28md5hostallgpmon::1/128md5
ForGreenplumCommandCenter,the gpmon usermustalsohavehostaccessfromthehostwheretheCommandCenterwebserverandbackendrun.ThisrequiresthatyouaddanentryfortheCommandCenterhost.Editthe $MASTER_DATA_DIRECTORY/pg_hba.conf fileandaddalinelikethefollowing.
hostallgpmon<cc-host-ip>/32md5
Sincethe gpmon roleisaGreenplumDatabasesuperuser,youmaywishtorestricttherolefromaccessingotherdatabases.Edittheselines:
ListgpperfmonandthedatabasesyouwanttomonitorwithCommandCenterinthesecondfield:
localgpperfmon,userdb1,userdb2gpmonmd5hostgpperfmon,userdb1,userdb2gpmon127.0.0.1/28md5hostgpperfmon,userdb1,userdb2gpmon::1/128md5hostgpperfmon,userdb1,userdb2gpmon<cc-host-ip>/32md5
SeeChangingthegpmonPasswordforstepstochangethe gpmon user’spassword.
©CopyrightPivotalSoftwareInc,2013-2018 11 4.0.0
InstallingPivotalGreenplumCommandCenterThePivotalGreenplumCommandCenterinstallationutility,installstheCommandCenterfilesonallhostsintheGreenplumDatabasecluster.
PrerequisitesTheGreenplumCommandCenterinstallerinstallstheCommandCentersoftwareoneveryhostintheGreenplumDatabasecluster.Youcanruntheinstalleronthemasterhost.ThelistofhoststoinstallisretrievedfromtheGreenplumDatabase gp_segment_configuration systemtable.
BeforeinstallingGreenplumCommandCenter,ensurefollowingrequirementsaremet:
GreenplumDatabasemustbeinstalledandrunning.SeethePivotalGreenplumCommandCenterreleasenotesforcompatibleGreenplumDatabaseversions.
TheGreenplumDatabase MASTER_DATA_DIRECTORY environmentvariablemustbeset.
Thegpperfmondatabaseandgpmonrolemustbecreatedandthegpperfmonagentsmustberunning.SeeCreatingthegpperfmonDatabase.
ThedirectorywhereGreenplumCommandCenterwillbeinstalled, /usr/local/ bydefault,mustbewritablebythegpadminuseronallGreenplumDatabasehosts.Alternatively,youcaninstallCommandCenterasrootand,whendone,changeownershipofallfilesintheinstallationdirectorytothegpadminuser.
PreparetheCommandCenterHostAftertheCommandCentersoftwareisinstalled,youcanstarttheCommandCenterwebserverandbackendonanyhostintheGreenplumDatabasecluster.Toavoidincreasingloadonthemasterhost,thestandbymasterisrecommended.SomepreparationisrequiredtoallowCommandCentertorunonahostotherthanthemaster.
1. Editthe $MASTER_DATA_DIRECTORY/pg_hba.conf fileandaddthefollowingentrytoallowthegpmonusertoauthenticatefromtheCommandCenterhost.
hostallgpmon<IP_of_host>/32md5
Run gpstop-u tohaveGreenplumDatabasereloadthefile.
2. Copythe .pgpass filefromthemasterhosttotheCommandCenterhost.Runthesecommandsfromthemaster:
$sshgpadmin@<cc_host>$scpgpadmin@<master_host>:~/.pgpass~$chmod600~/.pgpass
3. IftheGreenplumCommandCenterwebserveristosupportTLS/SSL,aservercertificatemustbeobtainedandinstalledontheCommandCenterhostinalocationreadablebythegpadminuser.Thedefaultpathis /etc/ssl/certs/cert.pem .
4. IfGreenplumCommandCenteristosupportKerberosauthentication,GreenplumDatabasemusthaveKerberosauthenticationsetupandthe
Important!IfyouupgradedtoPivotalGreenplumDatabaserelease5.7orlaterfromanearlierGreenplumDatabase5.xrelease,youmustfollowstepsatSetUptheMetricsCollectionandWorkloadManagementExtensionsbeforeyoustartGreenplumCommandCenter.
NOTEIfyouareplanningtorunCommandCenteronahostotherthanthemasterorstandbyhost,therearetwoalternativemethodsyoucanusetosupplythegpmonuser’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-2018 12 4.0.0
requiredprincipalsandkeytabsmustbeinstalledontheCommandCenterhost.SeeEnablingAuthenticationwithKerberosforKerberossetupinstructions.YoucaninstallCommandCenterwithoutKerberosauthenticationinitiallyandthenenableKerberoslaterbyrunningthe gpcckrbenable
command.
InstallationStepsYoucaninstallGreenplumCommandCenterfromanyhostintheGreenplumDatabasecluster.Thesoftwarewillbecopiedtoallotherhostsinthecluster.Thefollowingstepsassumeyouareperformingtheinstallationonthemasterhost.
1. DownloadGreenplumCommandCenter4.xfromPivotalNetwork .
2. Extracttheinstallerfromthezipfile.
$gunzipgreenplum-cc-web-<version>-LINUX-x86_64.zip
Extractingtheinstallercreatesa greenplum-cc-web-<version> directorycontainingthe gpccinstall-<version> installationutility.
3. Sourcethe greenplum_path.sh scriptintheGreenplumDatabaseinstallationdirectorytoensurethe GPHOME environmentvariableisset.
$source/usr/local/greenplum-db/greenplum_path.sh
4. RuntheGreenplumCommandCenterinstaller.
$cdgreenplum-cc-web-<version>$./gpccinstall-<version>
Theinstallerhasthreeoptions.The -c <config-file> optionspecifiesthepathtoaninstallationconfigurationfiletouseforanon-interactiveinstallation.SeeInstallwithaConfigurationFile.The -W optioninstructstheinstallertopromptforthegpmonuser’spassword.Thegpmonpasswordisnormallyreadfromthe .pgpass fileinthegpadminuser’shomedirectory.Ifthe .pgpass fileisnotavailableonthehost,includethe -W optionandtheinstallerwillpromptforapassword.The --ssh_path optionallowsyoutospecifythefullpathtoacustomsshprogram.Ifyoudonotsupplythisoption,theinstallerusesthesshcommandonthepath.
$./gpccinstall-<version>--ssh_path/usr/local/bin/ssh
5. Readthroughthelicenseagreementandenter y toaccept.
6. WherewouldyouliketoinstallGreenplumCommandCenter?Thedefaultinstallationdirectoryis /usr/local .PressEntertoacceptthedefaultorenterthedesiredpath.ThedirectorymustexistonallhostsintheGreenplumDatabaseclusterandmustbewritablebygpadmin.
7. WhatwouldyouliketonamethisinstallationofGreenplumCommandCenter?EnteranametodisplayonCommandCenterwebpagestoidentifythisGreenplumDatabasesystem.
8. OnwhichportwouldyouliketoinstalltheGreenplumCommandCenterwebserver?ThedefaultCommandCenterlistenportis28080.PressEntertoacceptthedefaultorenteranotherportnumber.
9. WouldyouliketoenableSSL?Enter y ifyouwanttoenableSSL/TLS(HTTPS)encryptionforclientconnectionstotheCommandCenterwebserver.TheinstallationutilitypromptsforthelocationoftheSSLcertificate.ProvidethefilepathfortheSSLcertificateEnterthepathtothecertificateinstalledontheCommandCenterhost.Thedefaultis /etc/ssl/certs/cert.pem .Thecertificatemustbereadablebythegpadminuser.
10. WouldyouliketoenableKerberos?Enter y ifyouwanttoenableclientauthenticationwithKerberos.KerberosmustalreadybeenabledforGreenplumDatabase.(Ifyouenter n ,youcansetupKerberosauthenticationlaterusingthe gpcckrbenable command.)TheinstallerpromptsforinformationaboutyourKerberosinstallation.ChooseKerberosmode(1.normal/2.strict/3.gpmon_only)GreenplumCommandCentersupportsthreedifferentKerberosauthenticationschemes.
1-normalmode(default)–TheCommandCenterKerberoskeytabfilecontainstheCommandCenterprincipalandmaycontainprincipals
©CopyrightPivotalSoftwareInc,2013-2018 13 4.0.0
forCommandCenterusers.Iftheprincipalintheclient’sconnectionrequestisintheCommandCenter’skeytabfile,CommandCenterusestheclient’sprincipalfordatabaseconnections.Otherwise,CommandCenterusesthe gpmon userfordatabaseconnections.2-strictmode–CommandCenterhasaKerberoskeytabfilecontainingtheCommandCenterserviceprincipalandaprincipalforeveryCommandCenteruser.Iftheprincipalintheclient’sconnectionrequestisinthekeytabfile,thewebservergrantstheclientaccessandthewebserverconnectstoGreenplumDatabaseusingtheclient’sprincipalname.Iftheprincipalisnotinthekeytabfile,theconnectionrequestfails.3-gpmon_onlymode–CommandCenterusesthe gpmon databaseroleforallGreenplumDatabaseconnections.NoclientprincipalsareneededintheCommandCenter’skeytabfile.
ProvidethepathtothekeytabfileEnterthepathtothekeytabfilecontainingtheKerberosprincipalfortheCommandCenterwebserverand,optionally,CommandCenteruserprincipals.WhatisthenameoftheGPDBKerberosservice?ThedefaultservicenameforGreenplumDatabaseis postgres .YoucancheckthevalueoftheservicenameforyourGreenplumDatabaseclusterwiththe gpconfig utility:
$gpconfig-skrb_srvname
WhatistheURLoftheCommandCenterwebserver?TheKerberoskeytabfilemustcontainaprincipalfortheCommandCenterwebserver.Theprincipalnameisoftheformat HTTP/<gpcc-host>@<realm> ,where <gpcc-host> isthehostnameclientsuseinURLswhenconnectingtotheCommandCenterwebserver.
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
Ifthe enable_ssl parameteristrue,the ssl_cert_file parameterisrequired.
Ifthe enable_kerberos parameteristrue,the keytab parameterisrequiredandthe webserver_url , krb_mode ,and krb_service_name mustbesettovaluesfromyourKerberosinstallation.
Thefollowinginstallationconfigurationfileexamplesetsallparameterstotheirdefaultvalues.
©CopyrightPivotalSoftwareInc,2013-2018 14 4.0.0
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
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.
$gpconf-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.
gpconfig-sgp_enable_query_metricsgpconfig-cgp_enable_query_metrics-von
3. Ifyouchangedanyconfigurationparameters,restartGreenplumDatabase.
gpstop-r
NextStepsSettingtheGreenplumCommandCenterEnvironment
StartingandStoppingGreenplumCommandCenter
ConnectingtoGreenplumCommandCenter
©CopyrightPivotalSoftwareInc,2013-2018 15 4.0.0
SettingtheGreenplumCommandCenterEnvironmentToenablethe gpadmin usertoexecuteCommandCenterutilitiessuchas gpcc ,followthesestepstosetuptheGreenplumCommandCenterenvironmentontheGreenplumCommandCenterhost.
1. Addthe GPPERFMONHOME environmentvariabletoyourstartupshellprofile(suchas ~/.bashrc ).SetthevariabletotheGreenplumCommandCenterinstallationdirectory.
exportGPPERFMONHOME=/usr/local/greenplum-cc-websource$GPPERFMONHOME/gpcc_path.sh
Ensurethatthe $GPPERFMONHOME/gpcc_path.sh filehasentriesforthe greenplum_path.sh fileandthe MASTER_DATA_DIRECTORY environmentvariable.SeetheGreenplumDatabaseInstallationGuidefordetails.
2. Saveandsourcethe .bashrc file:
$source~/.bashrc
©CopyrightPivotalSoftwareInc,2013-2018 16 4.0.0
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 serverconfigurationvariableoff:
$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-2018 17 4.0.0
AdministeringGreenplumCommandCenterSystemadministrationinformationfortheGreenplumCommandCenter.
AbouttheCommandCenterInstallation
AdministeringtheWebServer
AdministeringCommandCenterAgents
AdministeringtheCommandCenterDatabase
ConfiguringGreenplumCommandCenter
©CopyrightPivotalSoftwareInc,2013-2018 18 4.0.0
AbouttheCommandCenterInstallationTheinstallationprocedurecreatesasoftwareinstallationdirectoryforGreenplumCommandCenter.ThisdirectoryiscopiedtoallhostsintheGreenplumCluster.VersionsofGreenplumDatabasethatarecompatiblewithGreenplumCommandCenterincludepre-packagedfilesthatsupporttheCommandCenterreal-timemetricsandworkloadmanagementfeatures.
SoftwareInstallationDirectoryThefollowingfilesandfirst-levelsubdirectoriesarecopiedintotheinstallationdirectoryyouspecifywhenyouinstallGreenplumCommandCenter.Thislocationcanbereferencedwiththe $GPPERFMONHOME 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 wl_mgt and metrics_collection GreenplumDatabaseextensions.TheseextensionsareincludedwithcompatibleversionsofGreenplumDatabase.
©CopyrightPivotalSoftwareInc,2013-2018 19 4.0.0
AdministeringtheCommandCenterWebServerThegpccwswebserverbinaryandwebapplicationfilesareinstalledinthe bin directoryofyourGreenplumCommandCenterinstallation.
StartingandStoppingtheWebServerStartingtheCommandCenterWebServerrunsthegpccwswebserver,startsthemetricscollectionagentsonthesegmentservers,andstartsalistenerontheCommandCenterrpcport.
Runthe gpcc commandasthegpadminuseronthehostwhereyoustartedtheCommandCentersoftware,thestandbymasterbydefault.
Toensurethe gpcc commandisonyourpath,sourcethe gpcc_path.sh fileintheCommandCenterinstallationdirectoryoraddittothestartupscriptforyourcommandshell.SeeSettingtheGreenplumCommandCenterEnvironmentforinstructions.
TostartGreenplumCommandCenter
$gpccstartStartingthegpccagentsandwebserver…2018/03/2217:35:06Agentsuccessfullystartedon7/8hosts2018/03/2217:35:06ViewGreenplumCommandCenterathttp://smdw:28080
TostopGreenplumCommandCenter
$gpccstop2018/03/2217:36:23Gpccwebserverandmetricscollectionagentshavebeenstopped.Usegpccstarttostartthemagain
TochecktheGreenplumCommandCenterstatus
$gpccstatusStartingthegpccagentsandwebserver…2018/03/2217:36:55Agentsuccessfullystartedon7/8hosts2018/03/2217:36:55ViewGreenplumCommandCenterathttp://smdw:28080
Seethe gpcc referencepageforfullsyntaxforthe gpcc command.
ConfiguringtheCommandCenterWebServerThewebserverconfigurationfileisstoredin $GPPERFMONHOME/conf/app.conf .TheparametersinthisconfigurationfilearesetwhenyouinstallGreenplumCommandCenter.TheinstallercopiestheCommandCenterinstallationdirectory,includingthisconfigurationfile,toeveryGreenplumDatabasehost.
SeetheWebServerParameterssectionofConfigurationFileReferenceforadescriptionoftheparametersinthisfile.
Youcanseeasummaryofthecurrentconfigurationusingthe gpcc--settings
command.
$gpcc--settingsInstallpath:/usr/localDisplayName:gpccGPCCport:28080Kerberos:disabledSSL:disabled
Ifyoumodifythefileononehostyoushouldcopyittoeveryotherhost.Besuretorestartthewebserverafteryouchangetheconfiguration.Ratherthanmodifyingtheconfigurationdirectly,youcanjuststopCommandCenterandre-runthe gpccinstall-<version> installationcommand.Thisensurestheconfigurationisconsistentonallhosts.
NOTEThe gpcc commandusesthegpmonroletoconnecttoGreenplumDatabase.Itlooksforthegpmonpasswordinthe PGPASSWORD environmentvariableorinthe .pgpass fileinthegpadminuser’shomedirectory.Youcaninsteadappendthe -W flagtothe gpcc commandsbelowtohavegpcc promptyoutoenterthepassword.
©CopyrightPivotalSoftwareInc,2013-2018 20 4.0.0
Youcanusethe gpcckrbenable commandtoaddKerberosauthenticationtotheCommandCenterconfiguration.SeeEnablingAuthenticationwithKerberosfordetailsaboutsettingupKerberosontheCommandCenterhost.The gpcckrbenable commandpromptsfortheKerberosprincipalnamesandartifactsandupdatestheconfiguration.
The gpcckrbdisable commandremovesKerberosparametersfromtheCommandCenterconfiguration.
ViewingandMaintainingWebServerLogFilesWebserveraccessanderrorlogmessagesarewrittento $GPPERFMONHOME/logs/gpccws.log .
IfyouexperienceerrorsviewingtheGreenplumCommandCenterConsole,refertothisfileformoreinformation.
Topreventthewebserverlogfromgrowingtoexcessivesize,youcansetuplogfilerotationusing logrotate or cronolog .
©CopyrightPivotalSoftwareInc,2013-2018 21 4.0.0
AdministeringCommandCenterAgentsTheCommandCentermetricscollectionagent, cc_agent ,runsonsegmenthostsandlistensonaUDPportforreal-timemetricsemittedbythemetricscollectiondatabaseextension.StartingGreenplumCommandCenterwiththe gpcc
startcommandstartstheCommandCenteragentoneachsegment
host.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.
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.Forahostwithmultiplesegments,theagentlogfileislocatedinthedatadirectoryofthefirstsegment,aslistedinthe gp_configuration tablebydbid.Ifthesegmentagentisunabletologintothisdirectory,itwilllogmessagestothehomedirectoryoftheuserrunningCommandCenter(typically gpadmin ).
ConfiguringgpperfmonLogFileRolloverAthigherlogginglevels,thesizeofthegpperfmonlogfilesmaygrowdramatically.Topreventthelogfilesfromgrowingtoexcessivesize,youcanaddanoptionallogrolloverparameterto gpperfmon.conf .Thevalueofthisparameterismeasuredinbytes.Forexample:
max_log_size=10485760
Withthissetting,thelogfileswillgrowto10MBbeforethesystemrollsoverthelogfile.Thetimestampisaddedtothelogfilenamewhenitisrolledover.Administratorsmustperiodicallycleanoutoldlogfilesthatarenolongerneeded.
©CopyrightPivotalSoftwareInc,2013-2018 22 4.0.0
AdministeringthegpperfmonDatabaseDatacollectedbygpmmonandgpsmonagentsisstoredinadedicateddatabasecalledgpperfmon.Thisdatabaserequiresthetypicaldatabasemaintenancetasks,suchascleanupofoldhistoricaldataandperiodic ANALYZE .
SeethegpperfmonDatabaseReference sectionforareferenceofthetablesandviewsinthegpperfmondatabase.
ConnectingtothegpperfmonDatabaseDatabaseadministratorscanconnectdirectlytothegpperfmondatabaseusinganyGreenplumDatabase-compatibleclientprogram(suchas psql ).Forexample:
$psql-dgpperfmon-hmaster_host-p5432-Ugpadmin
BackingUpandRestoringthegpperfmonDatabaseThehistorytablesofthegpperfmondatabasecanbebackedupandrestoredusingtheGreenplumDatabasebackupandrestoreutilities.SeetheGreenplumDatabaseUtilityGuideformoreinformation.
Becausethegpperfmondatabasehasasmallnumberoftables,youmayprefertodeviseabackupplanusingthetable-levelbackupfeaturesofgp_dump .Forexample,youcancreatescriptstorun gp_dump tobackupthemonthlypartitionsofthehistoricaldatatablesonamonthlyschedule.Alternately,youcanbackupyourgpperfmondatabaseatthedatabaselevel.
MaintainingtheHistoricalDataTablesAllofthe *_history tablesstoredinthegpperfmondatabasearepartitionedintomonthlypartitions.AJanuary2010partitioniscreatedatinstallationtimeasatemplatepartition.Itcanbedeletedoncesomecurrentpartitionsarecreated.TheCommandCenteragentsautomaticallycreatenewpartitionsintwomonthincrementsasneeded.Administratorsmustperiodicallydroppartitionsforthemonthsthatarenolongerneededinordertomaintainthesizeofthedatabase.
SeetheGreenplumDatabaseAdministratorGuideformoreinformationondroppingpartitionsofapartitionedtable.
©CopyrightPivotalSoftwareInc,2013-2018 23 4.0.0
ConfiguringGreenplumCommandCenterConfigurationparametersforGreenplumCommandCenterarestoredintheAgentandConsoleconfigurationfiles.
gpperfmonAgentConfigurationgpperfmonAgentconfigurationparametersarestoredinthefollowingfilesontheGreenplumDatabasemasterhost.
$MASTER_DATA_DIRECTORY/gpperfmon/conf/gpperfmon.conf
$MASTER_DATA_DIRECTORY/postgresql.conf
The gpperfmon.conf fileisheavilycommented.The post
ChangestothesefilesrequirearestartoftheGreenplumDatabaseinstance( gpstop-r
).
ConsoleConfigurationYoushouldnotneedtomanuallyeditanyofthefiles.RunningtheCommandCenterinstallermakesthenecessarymodificationstothisconfigurationfile.
ChangingtheCommandCenterconfigurationfile( $GPPERFMONHOME/conf/app.conf )requiresrestartingCommandCenter.
$gpccstop$gpccstart
SeetheConfigurationFileReferencesectionforadescriptionoftheconfigurationparametersinthis.
Note:Ifyoumodifythe app.conf file,youmustcopythemodifiedfiletoallGreenplumDatabasehostsandrestartCommandCentertopreventCommandCentererrors.
©CopyrightPivotalSoftwareInc,2013-2018 24 4.0.0
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 $GPPERFMONHOME/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>Authentication page.
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-2018 25 4.0.0
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-2018 26 4.0.0
ManagingGreenplumCommandCenterAuthenticationGreenplumCommandCenterusersareGreenplumDatabaseusers,authenticatedusingthestandardGreenplumDatabasehost-basedauthenticationsystem.Whenauthenticationisproperlyconfigured,ausercanusethesamecredentialstologintoadatabasewithadatabaseclientsuchas psql andintotheCommandCenterwebinterfacewithabrowser.
TocreateanewCommandCenteruser,firstyouhavetocreateaGreenplumDatabaseuser,thenedittheGreenplumhost-basedauthenticationconfigurationfile( pg_hba.conf )togivethatuseraccesstoCommandCenter.
AGreenplumDatabaseuserwhocanauthenticateviathe pg_hba.conf filecanlogintoGreenplumCommandCenterandvieworcanceltheirownqueriesandviewmetricsscreens.Auser’sCommandCenterpermissionleveldeterminesifadditionalCommandCenterfeaturesareaccessible.SeeAuthorizationforinformationaboutpermissions.
ThefollowingarestepstocreatenewCommandCenterusersinaninteractive psql session.Withtheexceptionofthe CREATEROLE commandtocreateanewdatabaseuser,allofthesestepscanbeperformedintheCommandCenterontheAdmin>PermissionsorAdmin>Authorizationscreens.
SeetheGreenplumDatabaseAdministratorGuideformoredetailedinformationaboutcreatingdatabaseusersandroles.
1. Loginas gpadmin onthemasterhost.
2. Start psql :
$psql
3. Enterthe CREATEROLE commandtocreateauser:
#CREATEROLEcc_userWITHLOGINENCRYPTEDPASSWORD'changeme';
TocreateanAdminuser-arolewithsuperuserprivilegesinthedatabaseandGreenplumCommandCenter:
#CREATEROLEcc_adminWITHLOGINENCRYPTEDPASSWORD'changeme'SUPERUSERCREATEDB;
4. ForusersotherthanAdmin,setthepermissionlevelbyaddingtheusertoaCommandCentergrouprole:TocreateaBasicuser:addtheusertothe gpcc_basic role:
#GRANTgpcc_basicTOcc_user;
TocreateanOperatorBasicuser-addtheusertothe gpcc_operator_basic role:
#GRANTgpcc_operator_basicTOcc_user;
TocreateanOperatoruser-addtheusertothe gpcc_operator role:
#GRANTgpcc_operatorTOcc_user;
5. Grantpermissionstoagroupbygrantingtheroletothegroup:
#CREATEROLEcc_users;#GRANTcc_userstocc_user;#GRANTgpcc_operatortocc_users;
6. Verifythatroleswerecreatedsuccessfullyusingthefollowingcommand:
#\du
Thenewusersyoucreatedarereturnedalongwiththeattributesyouspecified.
7. Editthe pg_hba.conf filetogivenewusersaccesstodatabasesandtheCommandCenter.Openthefileinaneditor:
NOTEGreenplumCommandCenterdoesnotacceptloginsfromthegpadminuser,orfromanyuserconfiguredwithtrustauthenticationinthepg_hba.conf file.Allowingtrustauthenticationforremoteloginsisdisallowedbecauseitisinsecure.
©CopyrightPivotalSoftwareInc,2013-2018 27 4.0.0
$vi$MASTER_DATA_DIRECTORY/pg_hba.conf
8. ScrolltothebottomofthefileandinsertthefollowinglinestogivethenewusersaccessfromanyIPaddressusingpasswordauthentication:
hostgpperfmoncc_user127.0.0.1/28md5hostgpperfmoncc_admin127.0.0.1/28md5
Listadditionaldatabasestheuserscanaccessaftergpperfmon,orreplacegpperfmonwith all toallowtheuserstoaccessanydatabase.Note:IfyousubsequentlyhaveissuesloggingintoCommandCenteritmaybeduetoyourspecificenvironment;checkthe$GPPERFMONHOME/logs/gpccws.log logfileforauthenticationerrors.Editthe pg_hba.conf filebasedontheerrormessageandyourspecificenvironment.
9. Savethefileandexittheeditor.
10. EnterthefollowingcommandtoreloadGreenplumDatabaseprocesses.
#gpstop-u
©CopyrightPivotalSoftwareInc,2013-2018 28 4.0.0
ManagingGreenplumCommandCenterPermissions
ThePermissionsLevelsforGPCCAccessscreenallowsuserswithOperatorBasic,Operator,orAdminpermissiontoviewCommandCenteruserpermissionsforGreenplumDatabaseusers.UserswithAdminpermissioncansetpermissionsforallusers.
UserswithOperatorBasic,Operator,andAdminpermissioncanalsoseeiftheGuestAccesstoQueryMonitorfeatureisenabledordisabled,andAdminuserscantogglethisfeatureonandoff.
ViewingUserPermissionsInitially,allGreenplumDatabaseloginusersareincludedinthelistofroleswiththeircurrentpermissionlevels.
Tofilterbyrolename,enterallorpartoftheuser’sdatabaserolenameintheRoleNamefield.Thefilterperformsasimplesubstringsearchanddisplaysuserswithmatchingrolenames.ClicktheRoleNamelabeltoreversethesearchorder.
Tofilterforuserswithaspecificpermissionlevel,choosethepermissionlevelfromthePermissionLevellist.
RoleNameandPermissionLevelfilterscanbeusedtogether.
Toresetthefilters,removealltextfromtheRoleNamefieldandchooseFilterby…fromthePermissionLevellist.
ChangingUserPermissionLevelsUserswithAdminpermissioncanchangepermissionlevels.
1. UsetheRoleNameandPermissionLevelfilterstodisplaytherolesyouwanttochange.
InthecurrentGreenplumCommandCenterrelease,onlyuserswithAdminpermissionlevel(GreenplumDatabasesuperusers)canlogintotheGreenplumCommandCenterConsole.TheBasic,OperatorBasic,andOperatorpermissionlevelsarenotyetimplemented.IfQueryMonitorGuestAccessisenabledontheAdmin>Permissionsview,anyusercanviewtheQueryMonitorview.
©CopyrightPivotalSoftwareInc,2013-2018 29 4.0.0
2. Checktheboxnexttoarolenametoselecttheuser,orchecktheboxintheheadingtoselectalldisplayedusers.
3. SelectthenewpermissionslevelforeachuserfromthelistinthePermissionLevelcolumn,orselectanewpermissionlevelforallselectedusersfromtheChangeSelectedto…list.
EnablingorDisablingGuestAccesstoQueryMonitorWhenenabled,theGuestAccesstoQueryMonitorfeatureallowsanyonewithaccesstotheGreenplumCommandCenterwebservertoclickViewQueryMonitorontheCommandCentersign-inscreenandseetheQueryMonitorpagewithoutloggingin.TheseanonymoususerscannotcancelqueriesandcannotaccessanyotherCommandCenterfeatures.
Whenthisfeatureisoff,theViewQueryMonitorlinkdoesnotappearonthesign-inscreenandanonymoususerscannotseetheQueryMonitorpage.
CommandCenteruserswithAdminpermissioncantogglethefeatureonanoffwithamouseclick.UserswithOperatororOperatorBasicpermissionseeamessagereportingifthefeatureisonoroff.
©CopyrightPivotalSoftwareInc,2013-2018 30 4.0.0
SecuringthegpmonDatabaseUserTheGreenplumDatabase gpmon userisasuperuserroleusedtomanagethegpperfmondatabase.The gpperfmon_install utility,whichmustberunbeforeyouinstallGreenplumCommandCenterConsole,createsthe gpmon role.
GreenplumDatabaseusesthe gpmon roletoupdatethegpperfmondatabasewithdatacollectedbyagentsrunningonthesegmenthosts.TheCommandCenterwebserverusesthe gpmon roletoconnecttothegpperfmondatabaseaswellasdatabasesmonitoredbytheCommandCenter.
When gpperfmon_install createsthe gpmon role,itpromptsforapassword,whichitthenaddstothe .pgpass fileinthe gpadmin user’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,youcanalsosetupKerberosauthenticationforthe gpmon roleontheGreenplummasterandstandbyhosts.KerberosauthenticationissupportedwithTCPconnectionsonly; local entriesuseLinuxsocketsandauthenticatewiththe .pgpass filepassword,evenifyouhaveenabledKerberosfor host entries.
ChangingthegpmonPasswordTochangethe gpmon password,followthesesteps:
1. LogintoGreenplumDatabaseasasuperuserandchangethe gpmon passwordwiththe ALTERROLE command:
#ALTERROLEgpmonWITHENCRYPTEDPASSWORD'new_password';
2. OntheGreenplummasterhost,updatethepasswordinthe .pgpass fileinthe gpadmin homedirectory( ~/.pgpass ).Replacetheexistingpasswordinthelineorlinesfor gpmon withthenewpassword.
*:5432:gpperfmon:gpmon:new_password
3. Ensurethatthe .pgpass fileisownedby gpadmin andRW-accessibleby gpadmin only.
$chowngpadmin:gpadmin~/.pgpass$chmod600~/.pgpass
4. RestartGreenplumCommandCenterwiththe gpcc utility.
$gpccstop$gpccstart
AuthenticatinggpmonwithKerberosIfyouauthenticateGreenplumDatabaseandCommandCenteruserswithKerberos,youcanalsoauthenticatethe gpmon userwithKerberos.
IfCommandCenterisinstalledontheGreenplumstandbymasterhost,besuretoalsoupdatethe .pgpass fileonthathost.
©CopyrightPivotalSoftwareInc,2013-2018 31 4.0.0
ToprepareforinstallingCommandCenterwithKerberosauthentication,followthesesteps:
1. CreatethegpperfmondatabaseusingtheGreenplumDatabase gpperfmon-install managementutility.SeeCreatingthegpperfmonDatabase.
2. OntheKDC,createakeytabfilecontainingtheKerberosprincipalforthe gpmon user,justasyouwouldforanyKerberos-authenticatedclient.InstallthefileontheGreenplummasterandstandbyhosts.
3. Updatetheentriesfor gpmon inthe $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 entryforthe gpmon user,itwillusethe .pgpass filetoauthenticatewiththedatabase.SeeThepg_hba.conffile inthePostgreSQLdocumentationforcomplete pg_hba.conf filedocumentation.
4. Logintothemasterhostas gpadmin andauthenticatethe gpmon user.
$kinitgpmon
5. InstallGreenplumCommandCentertosetuptheKerberos-enabledCommandCenter.
©CopyrightPivotalSoftwareInc,2013-2018 32 4.0.0
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,CommandCenterusesthe gpmon userfordatabaseconnections.
gpmon-onlyTheCommandCenterusesthe gpmon databaseroleforallGreenplumDatabaseconnections.NoclientprincipalsareneededintheCommandCenter’skeytabfile.
IfyouhavesetupKerberosauthenticationforGreenplumDatabase,mostoftheconfigurationrequiredtoenableCommandCenterKerberosauthenticationhasbeendone.TheCommandCenterKerberosconfigurationbuildsupontheGreenplumDatabaseKerberossetup.
KerberosauthenticationcanbeenabledbyrespondingtopromptswhenyouinstallCommandCenter,oryoucanusethe gpcc--krbenable
commandto
enableKerberosafterCommandCenterhasbeeninstalled.
BeforeYouBeginKerberosauthenticationmustbeenabledforGreenplumDatabase.SeeUsingKerberosAuthentication forinstructions.Makesurethefollowingprerequisitesaremetbeforeyoucontinue:
The krb5-workstation packageandassociatedlibraries( libkrb5* )mustbeinstalledontheGreenplummasterhostandeachclientworkstation.
ThedateandtimeontheGreenplummasterhostandallclientworkstationsmustbesynchronizedwiththeKDC.
The krb5.conf configurationfilemustbethesameontheKDChost,theGreenplummasterhost,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.
EachclientworkstationmusthaveakeytabfilecontainingtheirKerberosprincipal, <username>@<realm> .
AddCommandCenterPrincipalstotheKDCDatabaseBeforeyouconfigureCommandCenterforKerberosauthentication,youmustcreatetherequiredKerberosprincipals.AlloftheprincipalsusedwithCommandCenterarecreatedintheGreenplumDatabaseKerberosrealm.CommandCenteruserscanusethesameKerberosprincipaltologintoCommandCenterandGreenplumDatabase.
CommandCenterServicePrincipal
AserviceprincipalisneededfortheCommandCenterwebserver.Thisprincipalhastheformat HTTP/<host>@<realm> .Forexample,ifusersaccess
©CopyrightPivotalSoftwareInc,2013-2018 33 4.0.0
CommandCenterattheURL http://mdw.example.com:28080 ,the <host> partoftheservicekeyis mdw.example.com andthe <realm> partistheGreenplumDatabaseKerberosrealm,forexample GPDB-KRB.EXAMPLE.COM .
NotethatKerberosauthenticationonlyworksifCommandCenterusersenterthehostinthesameformatspecifiedintheKerberosserviceprincipal.IftheprincipalspecifiestheFQDN,forexample,usingthehost’sIPaddressinthebrowserURLwillnotwork;thewebserverwillfallbacktobasicauthentication,presentingaloginscreen.
GreenplumDatabasegpmonUser
CommandCenterusesthe gpmon Greenplumroletoaccessthegpperfmondatabase,whichcontainsdatapresentedintheCommandCenterUI.
Youcanchoosetoauthenticatethe gpmon userwithKerberosorwithbasicauthentication.TouseKerberos,youmustcreateaprincipalforthegpmon user.
IfyouchoosetousebasicauthenticationyoudonotneedaKerberosprincipalforthe gpmon user.The gpmon userwillauthenticatewithGreenplumDatabaseusingthepasswordsavedinthe ~gpadmin/.pgpass fileonthehostrunningCommandCenter.SeeChangingthegpmonPasswordforinstructionstomanagethe gpmon password.
CommandCenterUsers
AddKerberosprincipalsforanyCommandCenteruserswhodonotalreadyhaveprincipalsintheKDCforGreenplumDatabase.
AddingKerberosPrincipalsToaddtherequiredprincipals,performthefollowingstepsasrootontheKDCserver.
1. Start kadmin.local .
kadmin.local
2. AddaprincipalfortheCommandCenterwebservice.Besuretospecifythe <gpcc-host> inthesameformatthatusersshouldenterthehostintheirbrowsers.
kadmin.local:addprincHTTP/<gpcc-host>@<realm>
3. Ifyouwantthe gpmon databaseusertouseKerberosauthentication,adda gpmon principal.
kadmin.local:addprincgpmon@<realm>
4. AddprincipalsforanynewCommandCenterusers.
kadmin.local:addprinccc_user1@<realm>
RepeatforeachnewCommandCenteruser.
5. Enter quit toexit kadmin.local .
SetUpKeytabFilesAfteryouhavecreatedalloftheKerberosprincipalsneeded,youcreateanddistributekeytabfiles.KeytabfilescontainKerberosprincipalsandencryptedkeysbasedontheprincipals’Kerberospasswords.KeytabfilesareneededforGreenplumDatabase,CommandCenter,andeachCommandCenteranddatabaseuser.
IftheCommandCenterisinstalledontheGreenplummasterasinglekeytabfilecanbesharedbyGreenplumDatabaseandCommandCenter.
IfyouinstallCommandCenteronthestandbymaster,youwillneedtocreateaseparatekeytabfile.MakesurethiskeytabcanbeaccessedbytheoperatingsystemuserrunningGreenplumCommandCenter.
YoumustalsocreateakeytabfileforeachGreenplumDatabaseorCommandCenterusercontainingjusttheuser’sprincipal.Thiskeytabfileisinstalledontheuser’sworkstationtoenabletheusertoauthenticatetoKerberos.
©CopyrightPivotalSoftwareInc,2013-2018 34 4.0.0
CommandCenterRunningontheGreenplumMasterHostIftheGreenplumCommandCenterwebserverisrunningontheGreenplumDatabasemasterhost,CommandCentercansharetheGreenplumDatabasekeytabfile.Youneedtocreateakeytabfilethatcontainsthefollowingprincipals:
Servicekeyforthe postgres processontheGreenplumDatabasemasterhost,forexample postgres/[email protected] .
ServicekeycreatedforCommandCenterintheprevioussection,forexample HTTP/[email protected].
AprincipalforeveryKerberos-authenticatedGreenplumDatabaseorCommandCenteruser.
AllservicekeysandprincipalsshouldbeintheGreenplumDatabaserealm.
TocreateakeytabfileforGreenplumDatabaseandCommandCenter,performthefollowingstepsasrootontheKDCserver.
1. Start kadmin.local .
kadmin.local
2. CreateakeytabfileandaddtheGreeplumDatabaseservicekey,thecommandcenterservicekey,andalldatabaseandCommandCenterusers.
kadmin.local:ktadd-kgpdb-kerberos.keytabpostgres/[email protected]/[email protected]
Youcanenteroneormoreprincipalswitheach ktadd command.Youcanspecifyawildcardusingthe -glob option.Forexamplethiscommandaddsallprincipalsinthe GPDB.EXAMPLE.COM realm,includingserviceprincipalsandadminusers.
kadmin.local:ktadd-kgpdb-kerberos.keytab-glob*@GPDB.EXAMPLE.COM
3. Enter quit toexit kadmin.local .
4. CopythekeytabyoucreatedtotheGreenplumDatabasemasterhost,replacingtheoldkeytabfile.Thelocationofthefileisgivenbythekrb_server_keyfile parameterinthe $MASTER_DATA_FILE/postgresql.conf file.Setthepermissionsonthefilesothatitcanbereadonlybythe gpadmin
user.
5. UpdateanyentriesrequiredfornewGreenplumDatabaseprincipalsinthe pg_hba.conf fileand pg_ident.conf files.SeeUpdatetheGreenplumDatabasepg_hba.confFilefordetails.
CommandCenterRunningontheStandbyMasterIftheCommandCenterwebserverisonadifferenthostthantheGreenplumDatabasemaster,youneedseparatekeytabfilesforGreenplumDatabaseandCommandCenter.ThekeytabfileforGreenplumDatabasemaynotrequireanyupdates,butyouwillneedtocreateakeytabfileforCommandCenter.
TheGreenplumDatabasekeytabfilemustcontaintheGreenplumDatabaseservicekeyandallprincipalsforuserswithdatabaseaccess.
TheCommandCenterkeytabfilecontainstheCommandCenterservicekeyandprincipalsforusersthathaveCommandCenteraccess.UserswithCommandCenteraccessmustalsohaveGreenplumDatabaseaccess,souserprincipalsintheCommandCenterkeytabfilemustalsobeintheGreenplumDatabasekeytabfile.
UpdatetheGreenplumDatabasekeytabifyoucreatednewdatabaserolesandprincipalsforCommandCenter.Forexample,ifyouwanttouseKerberosauthenticationforthe gpmon user,youmustcreateaprincipalandaddittoboththeGreenplumDatabaseandCommandCenterkeytabfiles.
TocreatethekeytabfileforCommandCenter,performthefollowingstepsasrootontheKDChost.
1. Start kadmin.local .
kadmin.local
2. CreateakeytabfileandaddtheCommandCenterservicekey.
kadmin.local:ktadd-kgpcc-kerberos.keytabHTTP/[email protected]
3. Ifyouwanttoauthenticatethe gpmon userwithKerberos,addthe gpmon principal.
kadmin.local:[email protected]
©CopyrightPivotalSoftwareInc,2013-2018 35 4.0.0
4. AddprincipalsforallCommandCenterusers:
kadmin.local:[email protected][email protected]
Youcanenteroneormoreprincipalswitheach ktadd command.
5. Enter quit toexit kadmin.local .
6. CopythekeytabyoucreatedtothethehostrunningCommandCenter,forexample:
$scpgpcc-kerberos.keytabgpadmin@<host-name>:/home/gpadmin
7. Updateanyentriesrequiredfornewprincipalsinthe pg_hba.conf fileand pg_ident.conf filesontheGreenplummaster.SeeUpdatetheGreenplumDatabasepg_hba.confFile.
UpdatetheGreenplumDatabasepg_hba.confFileTheGreenplumDatabase $MASTER_DATA_DIRECTORY/pg_hba.conf configurationfiledetermineswhichauthenticationmethodstousetoallowdatabaseaccess.
IfyoucreatednewCommandCenterusers,youmayneedtoaddanentrytoallowaccessviaCommandCenter.Theentryforanindividualuserhasthisformat:
hostdatabase<user-name><gpccCIDR>gss[options]
Authenticationforthe gpmon userneedstobesetupinthe pg_hba.conf fileinoneofthefollowingways.
Basicauthentication
The /home/gpadmin/.pgpass filecontainsthepasswordfor gpmon touse.SeeChangingthegpmonPasswordfordetails.Anentryinthe pg_hba.conffilespecifiesthemd5authenticationmethodfor gpmon :
localallgpmonmd5
Trustauthentication
OntheGreenplumDatabasemasterhostonly,the gpmon usercanaccessdatabaseswithoutauthentication:
localallgpmontrust
The /home/gpadmin/.pgpass fileisnotneeded.
Kerberosauthentication
AKerberosprincipalhasbeencreatedforthe gpmon userandaddedtotheGreenplumDatabaseandCommandCenterkeytabfiles.
hostallgpmon<gpccCIDR>]gss[options]
Removeanyexistingrejectrulesfor gpmon :
hostallgpmon<auth-method>reject
SeeUsingKerberosAuthentication formoreinformationaboutthe pg_hba.conf file.
EnableKerberosforCommandCenterSetupCommandCentertousetheCommandCenterkeytabfileyoucreated.
IfyouareaddingKerberosauthenticationtoanexistingCommandCenter,usethe gpcc command.Forexample:
©CopyrightPivotalSoftwareInc,2013-2018 36 4.0.0
$gpcc--krbenable
EntertheCommandCenterhostnameandpathtothekeytabfileattheprompts.SeethegpccReferenceformoreinformation.
AuthenticatingWithKerberosontheClientWorkstationTouseKerberosCommandCenterauthentication,theusermusthaveauthenticatedwithKerberosusingthe kinit command-linetool.
TheuserthenaccessestheCommandCenterwebserverwithaURLcontainingthehostnameintheformatspecifiedintheCommandCenterserviceprincipalandtheportnumber,forexample http://gpcc.example.com:28080 .
ThewebbrowsermustbeconfiguredtousetheSPNEGOprotocolsothatitofferstheuser’sKerberosprincipaltothewebbrowser.Themethodforconfiguringwebbrowsersvarieswithdifferentbrowsersandoperatingsystems.SearchonlinetofindinstructionstosetupyourbrowserandOS.
©CopyrightPivotalSoftwareInc,2013-2018 37 4.0.0
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
DisplaysthecurrentvaluesoftheCommandCenterconfigurationvariables.SeeSetupConfigurationFileforalistoftheconfigurationvariables.
--version or -vDisplaystheGreenplumCommandCenterversion.
-W <password>
Theoptional -W optionspecifiesthepasswordforthegpmonuser.The gpcc commandnormallygetsthepasswordfromthe $PGPASSWDenvironmentvariableorthe .pgpass fileinthegpadminuser’shomedirectory.Ifthepasswordisnotavailablewitheitherofthesemethods,the-W optionmustbeincludedtospecifythepasswordwheneveryourun gpcc .
Description
©CopyrightPivotalSoftwareInc,2013-2018 38 4.0.0
Oncestarted,theCommandCenterbackendmonitorsthemetricsagentswithaheartbeat.Ifafailedagentisdetected,thebackendspawnsanewagentprocess.
ExamplesStartCommandCenterandthemetricsagents,promptingforthegpmonpassword.
$gpccstart-WPasswordforGPDBusergpmon:Startingthegpccagentsandwebserver…2018/03/2217:51:51Agentsuccessfullystartedon7/8hosts2018/03/2217:51:51ViewGreenplumCommandCenterathttp://smdw:28080
©CopyrightPivotalSoftwareInc,2013-2018 39 4.0.0
ConfigurationFileReferenceConfigurationparametersforGreenplumCommandCenterarestoredinthefollowingfiles.
$MASTER_DATA_DIRECTORY/gpperfmon/conf/gpperfmon.conf ,onGreenplumDatabasemasterhostStoresconfigurationparametersfortheGreenplumCommandCenteragents.
$GPPERFMONHOME/conf/app.conf ,onCommandCenterhostStoresconfigurationparametersfortheCommandCenterwebapplicationandwebserver.
$MASTER_DATA_DIRECTORY/postgresql.conf
StoresconfigurationparameterstoenabletheGreenplumCommandCenterfeaturesforGreenplumDatabaseserver.Theseparametersarenormallysetusingthe gpconfig GreneplumDatabasemanagementutility.
$GPPERFMONHOME/bin/ssh-wrapper
GreenplumCommandCenternormallyfindsthe ssh commandonthepath.Ifyourenvironmenthasanincompatibleimplementationofthiscommandonthepath,youcanprovidetheabsolutepathtoyourversioninthe ssh-wrapper script,locatedat$GPPERFMONHOME/bin/ssh-wrapper .
Forexample:
ssh="/opt/bin/myssh"
©CopyrightPivotalSoftwareInc,2013-2018 40 4.0.0
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-2018 41 4.0.0
©CopyrightPivotalSoftwareInc,2013-2018 42 4.0.0
CommandCenterConsoleParametersTheCommandCenterConsoleconfigurationfileisontheCommandCenterhostat $GPPERFMONHOME/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-2018 43 4.0.0
TheGreenplumDatabasehostname.Thedefaultis localhost .
master_port = <port>
TheGreenplumDatabasemasterport.Thedefaultis 5432 .
©CopyrightPivotalSoftwareInc,2013-2018 44 4.0.0
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-2018 45 4.0.0
######GPCC4.0setupconfigurationfile#####path=/optdisplay_name=GreenplumDatabaseProductionClustermaster_port=5432webserver_port=28081EnableHTTP=true;allowbothHTTPandHTTPSEnableHTTPS=truessl_cert_file=/etc/ssl/cert.pemenable_kerberos=false
©CopyrightPivotalSoftwareInc,2013-2018 46 4.0.0
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.TheworkloadmanagementandquerymetricsextensionlibrariesmustbeincludedinthisconfigurationvariabletouseGreenplumCommandCenter.
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-2018 47 4.0.0
ClusterState
SegmentStatus
ClusterMetrics
HostMetrics
StorageStatus
©CopyrightPivotalSoftwareInc,2013-2018 48 4.0.0
GreenplumDatabaseClusterStateTheGreenplumCommandCenterDashboardprovidesaquickviewofthecurrentsystemstatus,SegmentHealth,Queries,CPU,Memory,andDiskusage.Clickingonapanelprovidesmoredetailedinformationaboutthatmetric.TheAlertspanelshowsthemostrecentmessagesfromtheGreenplumDatabaselogfile.SomeinformationisavailableonlytoCommandCenteruserswithAdminorOperatorpermissionlevel.
SystemInformationThefollowingsysteminformationisdisplayedatthetopofthepage.
UptimeTheelapsedtimesincetheGreenplumDatabasesystemwaslaststarted.
GPDBVersionTheversionoftheGreenplumDatabasesoftwarethemonitoredclusterisrunning.
GPCCVersionTheversionoftheGreenplumCommandCentersoftware.
ConnectionsThenumberofactiveGreenplumDatabasesessions(clientconnections).
ServerThedisplaynameforthisGreenplumCommandCenter.
LastSyncDateandtimethedatawaslastsynchronized.TheCommandCenteruserinterfaceupdatesviewswithlivedataevery15seconds.
SegmentHealthTheSegmentHealthsectionoftheDashboardprovidesaquickoverviewofthestatusofthedatabasesystemandsegmentsthisCommandCentermonitors.
DatabaseStateDatabaseStateisthecurrentstateoftheGreenplumDatabasesystem.Thestatecanbeoneofthefollowing:
Normal:Thedatabaseisfunctioningwithnomajorerrorsorperformanceissues.
©CopyrightPivotalSoftwareInc,2013-2018 49 4.0.0
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-2018 50 4.0.0
MonitoringSegmentStatusTheSegmentStatuspageprovidesahealthoverviewfortheGreenplumDatabasesegmentsanddetailsforeachprimaryandmirrorsegment.
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.
TotalSegments
©CopyrightPivotalSoftwareInc,2013-2018 51 4.0.0
ThetotalnumberofprimaryandmirrorsegmentsintheGreenplumcluster.
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-2018 52 4.0.0
PreferredRoleThesegment’sintendedrole,either“primary”or“mirror”.
ReplicationModeThereplicationstatusforthesegment.SeeSegmentHealthforpossiblevalues.
LastEvent|[Total]Thedateandtimeoflastsegmenthealth-relatedactivity.Clicktodisplayalistofrecentevents.
©CopyrightPivotalSoftwareInc,2013-2018 53 4.0.0
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-2018 54 4.0.0
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.
AboutSkewCalculationsDiskandNetworkskewratingsarecalculatedaseachserver’sstandarddeviationfromthemeancalculatedfromallsegmenthosts.
©CopyrightPivotalSoftwareInc,2013-2018 55 4.0.0
LowValueiswithin1standarddeviationfromthemean.(Note:ifthevarianceofthesetislessthan3,skewisconsideredlowregardlessofdeviationfrommean.)
ModerateValueisbetween1and2standarddeviationsfromthemean.
VeryHighValueisgreaterthan3standarddeviationsfromthemean.
©CopyrightPivotalSoftwareInc,2013-2018 56 4.0.0
StorageStatusTheStorageStatuspageshowscurrenthistoricaldiskusageforGreenplummasterandsegmenthosts.
DiskUsageSummaryYoucanseecurrentdiskspaceinuse,spacefree,andtotalspaceintheDiskUsageSummarypanel.Diskspacemetricsforthesegmenthosts(GPSegments)andthemaster(GPMaster)areshowninseparatebarcharts.
TheGPSegmentsbarchartshowscombineddiskspaceforallsegments.
TheGPMastersbarchartshowscombineddiskspaceformasterandstandbymaster.
Hoverovereitherofthechartstoseethespaceused,free,andtotalingigabytesandasapercentageofthetotal.
GPSegmentsUsageHistoryTheGPSegmentsUsageHistorypanelpresentsachartofpercentageofdiskspaceinuseforthetimeperiodsetbythecontrolinthepanelheader.
Hoveroverthecharttoseethepercentagediskinuseonanygivenpoint.
StorageStatusTableTheStorageStatustableprovidescurrentdiskspaceusagemetricsforeachhostandbydatadirectorywithinhosts.
©CopyrightPivotalSoftwareInc,2013-2018 57 4.0.0
MonitoringandManagingGreenplumDatabaseQueriesMonitoringGreenplumDatabaseQueries
ViewingQueryTextandPlan
ViewingQueryHistory
©CopyrightPivotalSoftwareInc,2013-2018 58 4.0.0
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-2018 59 4.0.0
Thestatusofthequery.Thiscanbeoneofthefollowing:
Queued:thequeryhasnotyetstartedtoexecute
Running:executionhasstarted,butisnotyetcomplete
Blocked:thequeryiswaitingforoneormoreotherqueriestoreleaselocks
Done:completedsuccessfully
Cancelling:cancelrequestsent,cancelpending
Cancelled:terminated,nolongerrunning
IdleTransaction:thetransactionisopen,butidle,forexample,waitingwhileauserinaninteractivesessionentersastatement
UserTheGreenplumDatabaserolethatsubmittedthequery.
DatabaseThenameofthedatabasethatwasqueried.
ResGrouporResQueueTheresourcegrouporresourcequeuethatismanagingthequery.
SubmittedThetimethequerywassubmittedtothequeryplanner.
QueuedTimeTheamountoftimethequeryhasbeen(orwas)inqueueawaitingexecution.
RunTimeTheamountoftimesincequeryexecutionbegan.
SpillFilesThetotalsizeofspillfilescreatedforthequery.GreenplumDatabasecreatesspillfileswhenthereisinsufficientmemorytotoexecutethequeryinmemory.SeeManagingSpillFilesGeneratedbyQueries forinformationaboutspillfiles.
BlockedbyShowsthenumberoflocksblockingthequery.Hoveroverthecolumntodisplaydetailsofthelocks.Thetipshowsthetypeofeachlock,theIDofthetransactionorquerythatholdsthelock,andtheamountoftimethequeryhasbeenblocked.
UsingtheQueryMonitorControlsClickacolumnheadingtosorttherowsonthatcolumninascendingordescendingorder.
Clickthecheckboxattheleftofarowtochooseaquerytocancelorexport.Clickthecheckboxintheheadingrowtochooseallqueries.
ClickCancelQuerytocancelselectedqueries.
ClickExporttodownloadacomma-separatedvalues(CSV)textfilecontainingrowsfortheselectedqueries.Whennoqueriesareselected,allrowsareexported.Thedefaultfilenameis spreadsheet.csv .
ClickanyqueryIDtoseetheQueryDetails,includingmetrics,thetextofthequery,andthequeryplan.
©CopyrightPivotalSoftwareInc,2013-2018 60 4.0.0
QueryDetails
ViewingQueryDetailsTheQueryDetailspagedisplaysquerymetrics,thetextofthequery,andthequeryplanforasinglequeryselectedontheQueryMonitororHistorypage.
TheQueryID,executionstatus,andruntimeofthequeryaredisplayedatthetop.
Thefollowingmetricsaredisplayedforthequery.
UserTheGreenplumDatabaserolethatsubmittedthequery.
DatabaseThenameofthedatabasethatwasqueried.
ResGrouporResQueueThenameoftheresourcegrouporresourcequeuethatismanagingthequery.
SubmittedThetimethequerywassubmittedtothequeryplanner.
QueuedTimeTheamountoftimethequeryhasbeen(orwas)inqueueawaitingexecution.
RunTimeTheamountoftimesincequeryexecutionbegan.
CPU(Activequeriesonly.)CurrentCPUpercentaverageforallsegmentprocessesexecutingthisquery.Thepercentagesforallprocessesrunningoneachsegmentareaveraged,andthentheaverageofallthosevaluesiscalculatedtorenderthismetric.CurrentCPUpercentaverageisalwayszeroinhistoricalandtaildata.Themasterandstandbymasterareexcludedfromthecalculation.
CPUSkew
©CopyrightPivotalSoftwareInc,2013-2018 61 4.0.0
TheamountofCPUskew.CPUskewoccurswhenqueryexecutorprocessesforonesegmentuseadisproportionateamountofCPUcomparedtoprocessesforothersegmentsexecutingthequery.Thisvalueiscalculatedas
1−(averagesegmentCPU/maximumsegmentCPU)
MemoryMemoryconsumedbyallsegmentprocessesexecutingthequery.
SpillFileSizeThetotalsizeofspillfilescreatedforthequery.GreenplumDatabasecreatesspillfileswhenthereisinsufficientmemorytoexecutethequeryinmemory.SeeManagingSpillFilesGeneratedbyQueries forinformationaboutspillfiles.
DiskRThecurrentaveragediskreadrateforallsegmenthosts.
DiskWThecurrentaveragediskwriterateforallsegmenthosts.
BlockingAlistofqueriesblockedbylocksheldbythisquery.ClickaqueryIDinthelisttoseethedetailsforthatquery.
BlockedbyAlistofquerieswithlocksblockingthisquery.ClickaqueryIDinthelisttoseethedetailsforthatquery.
Thequerytextandqueryplanareshownintwopanels.WhenyouclickRUNEXPLAIN,CommandCenterdisplaysthegeneratedexplainplanintherightpanel.
ClickthePlan&Progresstabtoseeagraphicalviewoftheexplainplan,withnodesfilledtoindicatequeryexecutionprogress.ClickTexualExplaintoseeatextualrepresentationoftheexecutionplan,similartotheoutputoftheGreenplumDatabase EXPLAIN command.
Explainplansareexecutedfromthebottomup.
CommandCenterisunabletodisplaytheexplainplanifthesizeofthequerytextisgreaterthan100Korifthequerytextcontainsmultiplestatements.
©CopyrightPivotalSoftwareInc,2013-2018 62 4.0.0
SeeGreeplumDatabaseAdministratorGuideforhelpreadingthequeryplan.
©CopyrightPivotalSoftwareInc,2013-2018 63 4.0.0
HistoryTheHistorypageallowsyoutodisplaysystemmetricsandqueriesexecutedduringaspecifiedtimeperiod.Queriesmayalsobefilteredbydatabaseand/oruser.
SetthetimeperiodtodisplaybyenteringdatesandtimesintheFromandTodateandtimefields.Youcanenterdatesbytypingthemintothedatefieldorbychoosingfromthepop-upcalendar.Enter24-hourtimesinHH:MMformat.
Torestrictqueriesthatdisplayinthequerytableatthebottomofthepage,enteraGreenplumdatabasenameintheDatabasefield,ausernameintheUserfield,orboth.Filteringbydatabaseanduseronlyaffectsthequeriesdisplayedinthetable.Themetricsdisplayedinchartsincludeallactivityduringtheselectedtimeperiod.
ClickSearchtodisplayresultsthatmatchyourcriteria.
Note:TheHistorydataisnotderivedfromthereal-timemetricsdisplayedbytheQueryMonitorandQueryDetailview.Historyiscollectedandsavedinthegpperfmondatabasebythe gpmmon and gpsmon agents.Variationsshouldbeexpectedduetothedifferentdatacollectionmethods.
©CopyrightPivotalSoftwareInc,2013-2018 64 4.0.0
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.
CPUSkewTheamountofCPUskew.CPUskewoccurswhenqueryexecutorprocessesforonesegmentuseadisproportionateamountofCPUcomparedtoprocessesforothersegmentsexecutingthequery.ThisvalueisthecoefficientofvariationfortheCPUusedbyprocessesrunningthisqueryoneachsegment,multipliedby100.Forexample,avalueof.95isshownas95.
RowSkew
©CopyrightPivotalSoftwareInc,2013-2018 65 4.0.0
Ameasureofrowskewinthesystem.Rowskewoccurswhenonesegmentproducesadisproportionatenumberofrowsforaquery.ThisvalueisthecoefficientofvariationfortheRowsOutmetricofalliteratorsacrossallsegmentsforthisquery,multipliedby100.Forexample,avalueof.95isshownas95.
QueueThenameoftheresourcequeueforthequery.
PriorityEachqueryinheritsthepriorityassignedtoitsresourcequeue.
FormoreinformationaboutResourceQueuesandQueryPlans,refertotheGreenplumDatabaseAdministratorGuide.
©CopyrightPivotalSoftwareInc,2013-2018 66 4.0.0
ManagingGreenplumDatabaseWorkloadsAboutWorkloads
EnablingWorkloadManagement
SettingUpWorkloadAssignmentFilters
©CopyrightPivotalSoftwareInc,2013-2018 67 4.0.0
AboutGreenplumCommandCenterWorkloadsGreenplumDatabasesegmenthostshaveasetamountofmemory,CPU,I/O,andnetworkresources.Iftheseresourcesstarttorunshortduetoheavydatabaseload,queriescanfailortheentiredatabasesystemcanfailorbecomeunacceptablyslow.Forthisreason,itisimportanttomanagedatabaserequeststopreventresourcedepletion.
GreenplumDatabaseadministratorscancreateworkloadsinCommandCentertolimitthenumberofconcurrentqueriesthatcanexecuteandtoallocatememoryandCPUresourcestodifferenttypesofqueries.Bycreatingworkloadsfordifferentclassesofqueries,theadministratorcanensurethatindividualqueriesandtheGreenplumDatabasesystemmeetuser’sperformancerequirements.
GreenplumCommandCenterworkloadsarebasedonresourcegroups,thenewGreenplumDatabaseworkloadmanagementmethodbasedonLinuxcontrolgroups(cgroups).ThedefaultmethodformanagingworkloadsinGreenplumDatabase,however,istouseresourcequeues.Resourcegroupsaresimilartoresourcequeuesinsomeways,butarebetteratmanagingCPUandmemorydynamically.Withresourcegroups,memoryandCPUareallocatedtogroupsaspercentagesofavailablememoryandCPU,ratherthancalculatedfixedvalues.
WhenresourcegroupsareenabledinGreenplumDatabase,eachdatabaseroleisassignedtoaresourcegroup.AresourcegroupisadatabaseobjectmappedtoaLinuxcgroup.Whenauserstartsatransaction,theuser’sresourcegroupdeterminesifthetransactioncanrunorifitmustwaitforothertransactionstocomplete,anditallocatesmemoryandCPUresourcestothetransaction’squeries.
WhentheGreenplumCommandCenterworkloadmanagementextensionisenabledinGreenplumDatabase,ratherthanautomaticallyassignthetransactiontotheuser’sresourcegroup,GreenplumDatabasecallsintotheextensiontodeterminetheresourcegroupforthetransaction.BycreatingqueryassignmentfiltersinGreenplumCommandCenter,youcanchoosetheresourcegroupthatwillexecuteatransaction.Assignmentfiltersevaluatethecurrentdatabaseroleandquerytagsthataresetinthedatabasesessiontoselecttheresourcegroup.
TouseGreenplumCommandCenter’sworkloadmanagementfeatures,LinuxcontrolgroupsmustbeconfiguredontheGreenplumclusterhosts,andtheGreenplumDatabasesystemmustbeconfiguredtouseresourcegroupsinsteadofresourcequeues.SeeEnablingWorkloadManagementinGreenplumCommandCenterforstepstoenableGreenplumCommandCenterworkloads.
Tocreatethequeryassignmentfiltersthatassigntransactionstoworkloads,seeManagingWorkloadQueryAssignmentFilters.
FormoreinformationaboutLinuxcgroupsandGreenplumDatabaseresourcegroupsseeUsingResourceGroups intheGreenplumDatabaseAdministratorGuide.
©CopyrightPivotalSoftwareInc,2013-2018 68 4.0.0
EnablingWorkloadManagementinGreenplumCommandCenter
EnableResourceGroupsinGreenplumDatabaseTouseGreenplumCommandCenterworkloads,youmustfirstconfigureGreenplumDatabasetouseresourcegroups(insteadofresourcequeues,thedefault)tomanagedatabaseresources.
Thisisaone-timeconfigurationtaskfortheGreenplumDatabaseadministrator.
1. Enablecgroups(controlgroups)intheLinuxoperatingsystemandaddacgroupconfigurationforGreenplumDatabase.Seethe“Prerequisite”sectionofUsingResourceGroups intheGreenplumDatabaseAdministratorGuide.
2. EnableresourcegroupsinGreenplumDatabasebysettingthe gp_resource_manager serverconfigurationparameterto "group" .
$gpconfig-sgp_resource_manager$gpconfig-cgp_resource_manager-v'group'
3. RestarttheGreenplumDatabasesystem.
$gpstop$gpstart
EnableWorkloadManagementinGreenplumCommandCenterAfteryouhaveenabledresourcegroupsinGreenplumDatabase,youcanenableWorkloadManagementinGreenplumCommandCenter.
1. LogintoGreenplumCommandCenterasauserwithadminpermissionandchooseAdmin>WorkloadMgmt.
2. ClicktheEnableWorkloadsbutton.
WhenyouclickEnableWorkloadsGreeplumCommandCenterperformsthefollowingsteps:
Createsthe gp_wlm extensioninGreenplumDatabase.
CreatestheWorkloadManagerusertableanduser-definedfunctionsinthe postgres database.
EnablesmanagingworkloadsintheGreenplumCommandCenteruserinterface.
Oncetheextensionisenabled,atthestartofatransactioninanycurrentorfuturedatabasesession,GreenplumDatabasecallsintotheworkloadmanagementextensiontoevaluateassignmentfilterstodeterminetheresourcegroup.Ifnoassignmentfilterismatched,thetransactionisassignedtothecurrentdatabaseusers’resourcegroup.
FutureGreenplumCommandCenterreleaseswillallowyoutocreateandmanageresourcegroupsandassignmentconditionsintheCommandCenteruserinterface.Untilthen,youcreateworkloadassignmentfiltersbyeditingtheJSONdocumenttheWorkloadManagerextensionusestoassigntransactionstoworkloads.
SeeCreatingWorkloadAssignmentFiltersforinstructionstocreateworkloadassignmentfiltersinGreenplumCommandCenter.
TroubleshootingWorkloadManagementIfyouexperienceproblemswithworkloadsinGreenplumCommandCenter,reviewthefollowinglisttoensureprerequisitesaremetandallofthedependenciesareproperlyconfigured.
RedHat6.xand7.xandCentOS6.xand7.xarecurrentlysupported.
YoumustberunningGreenplumDatabaseversion5.7.0orlater.
ConfiguretheLinuxcgroupskernelfeatureonyourhostsbyfollowingtheinstructionsat“Prerequisite”inUsingResourceGroups .
Makesurethe /etc/cgconfig.d/gpdb.conf filecontainsthreeobjects:perm,cpu,andcpuacct.Ifthedocumentisincorrectandthe gp_resource_manager
configurationparameterissetto "group" ,GreenplumDatabasecanhangatstartup.
©CopyrightPivotalSoftwareInc,2013-2018 69 4.0.0
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.TheextensionisaddedwhenyouclickEnableWorkloadsintheGreenplumCommandCenterAdmin>WorkloadMgmtview.
$psqlpostgres\dxpostgres=#\dxListofinstalledextensionsName|Version|Schema|Description--------+---------+--------+--------------------------------------gp_wlm|0.1|gpcc|GreenplumWorkloadManagerExtension
Makesurethe gpcc.workload_config tableandfunctionsarepresentinthepostgresdatabase:
©CopyrightPivotalSoftwareInc,2013-2018 70 4.0.0
$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-2018 71 4.0.0
ManagingWorkloadQueryAssignmentFiltersWhentheGreenplumCommandCenterWorkloadManagementfeatureisenabled,GreenplumDatabasedeferstoCommandCentertoassigntransactionstoresourcegroups.CommandCenteruserswithAdminpermissionlevelcancreateassignmentfiltersinCommandCentertoassigntransactionstoworkloads,andCommandCenterevaluatestheconditionstodeterminetheGreenplumDatabaseresourcegroupforthetransaction.
Ifnoassignmentrulesmatch,GreenplumDatabaseassignsthetransactiontothedatabaseuser’sresourcegroup.
InfutureGreenplumCommandCenterreleases,youwillbeabletousetheWorkloadManagementuserinterfacetointeractivelydefineworkloadsandassignmentrules.Inthecurrentrelease,youmustedittheJSONdocumentCommandCenterevaluatestodeterminetheworkloadforatransaction.
GreenplumCommandCentersavestheJSONdocumentinaGreenplumDatabaseusertable, gp_wlm_config ,inthe postgres database.Whenyousaveyourchanges,CommandCenterupdatesthedocumentinthedatabase.Thesizeofthedocumentmustnotexceed1MB.
TheJSONdocumentcontainsan assignmentRules array.Thisexamplehastwoassignmentfilters:onemappedto vip_group andonemappedtothedefault_group GreenplumDatabaseresourcegroup.
{"version":1,"assignmentRules":[{"resourceGroupName":"vip_group","roleName":"vip","queryTags":"appName=tableau;appUser=bi_sales","disabled":"true"},{"resourceGroupName":"default","roleName":"joe","queryTags":"appName=tableau;appUser=bi_acct"}]}
versionThe version parameterisusedtomanageconcurrenteditsoftheJSONdocument.CommandCenterincrementstheversionwhenyousaveyourchanges.IfmultipleCommandCentersessionsattempttosavethesameversion,onlythefirstsucceeds.Ifanupdatefails,anerrormessageisdisplayedandthedocumentmustberefreshedandre-editedbeforeitcanbesavedagain.
assignmentRulesThe assignmentRules arrayhasoneentryforeachassignmentcondition.EachentrymapstheworkloadtoaresourcegroupinGreenplumDatabaseanddefinestheconditionsthatassignatransactiontothatresourcegroup.
GreenplumCommandCenterevaluateseachentryinthe assignmentRules arrayfromtoptobottomandstopsatthefirstmatch,sotheorderis
©CopyrightPivotalSoftwareInc,2013-2018 72 4.0.0
important.
resourceGroupNameThenameoftheGreenplumDatabaseresourcegroup.Inthecurrentrelease,theresourcegroupmusthavebeencreatedinGreenplumDatabasewiththe CREATE RESOURCE GROUP SQLstatement.
roleNameThenameofaGreenplumDatabaseroletomatchagainstthecurrentroleidentifierintheGreenplumDatabasesession.ThecurrentroleisinitiallythedatabaserolethatauthenticatedwiththeGreenplumDatabasesystemtobeginthesession.Auserwithsufficientprivilegescanchangethecurrentroleinthedatabasesessionusingthe SET ROLE SQLcommand.
The roleName parameterisoptional.Ifnoroleisspecifiedintheassignmentruleandthequerytagsmatch,thetransactionisassignedtothespecifiedresourcegroup.Ifthe roleName parameterispresent,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.
=#SETgpcc.query_tagsTO'appName=tableau;appUser=bi_sales';
The queryTags parameterisrequired.Tomatch,alltagsinthe gpcc.query_tags parameterinthedatabasesessionmustbepresentinthe queryTagsvalue.Theorderofthetagsisnotsignificant,andthe queryTags parameterintherulecanbeasupersetofthetagsfoundinthe gpcc.query_tagsparameter.
The gpcc.query_tags parametercanbespecifiedusingtheSETcommand,asshownabove,orasaconnectionparameterwithdatabaseclientsthatsupportit.
disabledIfsetto "true" ,theassignmentruleisignoredwhenCommandCenterevaluatesrulestoassigntransactionstoworkloads.Thisparameterisoptionalanditsdefaultvalueis "false" .
©CopyrightPivotalSoftwareInc,2013-2018 73 4.0.0