Pivotal GemFire® for Pivotal Cloud Foundry 1 · Installing GemFire for Pivotal Cloud Foundry Using...

46
Pivotal GemFire® for Pivotal Cloud Foundry 1.7 © Copyright Pivotal Software Inc, 2013-2018

Transcript of Pivotal GemFire® for Pivotal Cloud Foundry 1 · Installing GemFire for Pivotal Cloud Foundry Using...

PivotalGemFireregforPivotalCloudFoundry17

copyCopyrightPivotalSoftwareInc2013-2018

234

1215151516162023254040404141414244464646

TableofContents

TableofContentsPivotalGemFireforPivotalCloudFoundryReleaseNotesforGemFireforPivotalCloudFoundryOverviewInstallingGemFireforPivotalCloudFoundryPrerequisitesServiceConfigurationDefaultsInstallationStepsSelf-SignedandInternalSSLCertificatesCreatingGemFireServicePlansApplicationSecurityGroupsUsingGemFireforPivotalCloudFoundryUsingtheGemFireforCloudFoundryCLIPlug-inInstallationOverviewBrokerHTTPUsernameandPasswordexport-gemfirerestart-gemfireshow-wan-config-urlTroubleshootingUninstallingGemFireforPivotalCloudFoundryPrerequisitesUninstalling

copyCopyrightPivotalSoftwareInc2013-2018 2 17

PivotalGemFireforPivotalCloudFoundry

ThisdocumentationdescribeshowtoinstallconfigureanduseGemFireforPivotalCloudFoundry (PCF)

ProductSnapshotCurrentGemFireforPivotalCloudFoundryDetails

Version170ReleaseDate19thSeptember2016SoftwarecomponentversionGemFire821SpringDataGemFire182Java8(JDKJRE8u60)CompatibleOpsManagerVersion(s)17x18xCompatibleElasticRuntimeVersion(s)17x18xCompatibleJavaBuildpackVersion(s)36371vSpheresupportYesAWSsupportYesIPSecsupportYes

UpgradingtotheLatestVersionThisversionofPivotalGemFireforPivotalCloudFoundrysupportsupgradingfromallthepreviousversionsoftheproductRunningserviceinstancesareautomaticallyupgradedonenodeatatimeIfyouconfiguredyourclusterswithdataredundancythentheupgradeprocessrequiresnodowntimeandresultsinnodataloss

NoteUpgradesfromAlphaorBetaversionsofthesoftwarearenotsupported

DocumentationIndexThedocumentationcontainsthefollowingtopics

ReleaseNotes

Overview

InstallingGemFireforPivotalCloudFoundry

UsingGemFireforPivotalCloudFoundry

Troubleshooting

FormoreinformationaboutPivotalGemFireseethePivotalGemFireDocumentation

FormoreinformationaboutPivotalCloudFoundryseethePivotalCloudFoundryDocumentation

NOTEThisproducthasbeendiscontinued

copyCopyrightPivotalSoftwareInc2013-2018 3 17

ReleaseNotesforGemFireforPivotalCloudFoundry

OverviewGemFireforPivotalCloudFoundry (PCF)supportsthedeploymentofmultiplePivotalGemFireclusterconfigurationstoPCFtosupportGemFireapplicationdevelopmentanddeploymentGemFireforPCFenablesadministratorstocustomizethreedifferentclusterconfigurationstoprovidecoarsecontroloverthenumberoflocatorsandserversavailableineachGemFireinstanceInadditiondeveloperscancustomizetheGemFireinstancethatisboundtotheirappusingGemFireclusterconfigurationcommandsoranewCloudFoundryCLIinterface

YourfeedbackiswelcomePleaseprovideanybugsfeaturerequestsorquestionseithertoPivotalCustomerSupportathttpssupportpivotalio oremailpivotal-cf-feedbackpivotalio

v1720

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1660

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1710

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1650

copyCopyrightPivotalSoftwareInc2013-2018 4 17

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1640

ReleaseDate11thNovember2016

Newinthisrelease

Bugfixes

Upgradedgolangtov17

v1630

ReleaseDate28thOctober2016

Newinthisrelease

StemcellAWS323217patchesUbuntuCVEs

CompatibilityfixesforPCFv17runningonvSphereandAzure

v1700

ReleaseDate19thSeptember2016

NewinthisRelease

CompatibilityreleaseforPCFv17andPCFv18TheGemFireforPCFservicenowinstallsonbothPCFv17andPCFv18withoutsupportforspecificfeaturessuchasmultipleavailabilityzones

IPsecsupportTheGemFireforPCFtilenowsupportsIPsec

LogformatchangedfromfreetexttoJSON

Bugfixes

DBsynchissuesUpgradedgolangtov17UsecryptolibraryforcertificatechaindiscoveryUseofCF_DIAL_TIMEOUTServiceinstanceroutearenowuniqueacrossorgsandspaces

StemcellAWS323217patchesUbuntuCVEs

StemcellAzure323217patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xv35xToresolvethisusethelatestJavabuildpack

CurrentlytilesupportsonlyasingleAvailabilityZone(AZ)

copyCopyrightPivotalSoftwareInc2013-2018 5 17

v162

ReleaseDate28thJuly2016

NewinthisRelease

CompatibilityreleaseforPCFv17TheGemFireforPCFservicenowinstallsonPCFv17withoutsupportforPCFv17ndashspecificfeaturessuchasmultipleavailabilityzones

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34x35xToresolvethisusethelatestJavabuildpack

v161

ReleaseDate22ndJuly2016

NewinthisRelease

StemcellAWS323213patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34xand35xToresolvethisupdateJavabuildpackto36 InJavabuildpack34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1600

ReleaseDate31stMay2016

NewinthisRelease

StemcellAWS32324patchesUbuntuCVEs

StemcellAzure32325patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1500

ReleaseDate9thMay2016

NewinthisRelease

ThepackagedGemFireisupgradedfromv8205tov82014

The enable-network-partition-detection propertyisnowenabled topreventagainstdatacorruptioninsplit-brainscenarios

Clusterstabilityhasbeenimprovedduringrestartsandduringserviceinstancedeletions

Defaulttimeoutof cf restart-gemfire hasbeenincreasedfrom120secondsto900secondstoaccommodateslower-than-expectedstartupofserversandlocators

copyCopyrightPivotalSoftwareInc2013-2018 6 17

WhenrunningonAzureGemFireserverswillhaveredundancyzones tieddirectlytoAzurersquosfaultdomains sothatredundancyforpartitionedregionsissatisfiedacrossmultiplevirtualserverracks

The cf export-gemfire commandnowgivesfeedbackaboutmissingargumentsmakingiteasiertoexportyourGemFirelogsclusterconfigsandproperties

UpgradeWarningDowntimeRequired

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeployment

Sincethe enable-network-partition-detection=true propertymustbesetontheentireclusteratthesametimeweareunabletodoarollingupgradePreviouslydeployedappsandserviceinstanceswillcontinuetofunctionnormallyaftertheupgradethoughGemFireforPCFwillbeunavailableduringtheupgrade

ForOpsManager-deployedtiles

1 Uploadthev1500GemFireforPCFtiletoOpsManager

2 UnderAvailableProductsgtPivotalGemFireclickAdd

3 boshtarget yourOpsManager-deployedboshdirector

4 boshstop yourpreviouslydeployedGemFireforPCFtileThiswillstoptheGemFireforPCFservicebrokerandallserviceinstances

5 InOpsManagerclickApplyChanges

Forbosh-deployedreleases

1 bosh upload thereleasescontainedinthistile

2 bosh stop yourexistingGemFiredeployment

3 bosh deploy themanifestcontainedinthistile

4 bosh start yournewdeployment

copyCopyrightPivotalSoftwareInc2013-2018 7 17

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

234

1215151516162023254040404141414244464646

TableofContents

TableofContentsPivotalGemFireforPivotalCloudFoundryReleaseNotesforGemFireforPivotalCloudFoundryOverviewInstallingGemFireforPivotalCloudFoundryPrerequisitesServiceConfigurationDefaultsInstallationStepsSelf-SignedandInternalSSLCertificatesCreatingGemFireServicePlansApplicationSecurityGroupsUsingGemFireforPivotalCloudFoundryUsingtheGemFireforCloudFoundryCLIPlug-inInstallationOverviewBrokerHTTPUsernameandPasswordexport-gemfirerestart-gemfireshow-wan-config-urlTroubleshootingUninstallingGemFireforPivotalCloudFoundryPrerequisitesUninstalling

copyCopyrightPivotalSoftwareInc2013-2018 2 17

PivotalGemFireforPivotalCloudFoundry

ThisdocumentationdescribeshowtoinstallconfigureanduseGemFireforPivotalCloudFoundry (PCF)

ProductSnapshotCurrentGemFireforPivotalCloudFoundryDetails

Version170ReleaseDate19thSeptember2016SoftwarecomponentversionGemFire821SpringDataGemFire182Java8(JDKJRE8u60)CompatibleOpsManagerVersion(s)17x18xCompatibleElasticRuntimeVersion(s)17x18xCompatibleJavaBuildpackVersion(s)36371vSpheresupportYesAWSsupportYesIPSecsupportYes

UpgradingtotheLatestVersionThisversionofPivotalGemFireforPivotalCloudFoundrysupportsupgradingfromallthepreviousversionsoftheproductRunningserviceinstancesareautomaticallyupgradedonenodeatatimeIfyouconfiguredyourclusterswithdataredundancythentheupgradeprocessrequiresnodowntimeandresultsinnodataloss

NoteUpgradesfromAlphaorBetaversionsofthesoftwarearenotsupported

DocumentationIndexThedocumentationcontainsthefollowingtopics

ReleaseNotes

Overview

InstallingGemFireforPivotalCloudFoundry

UsingGemFireforPivotalCloudFoundry

Troubleshooting

FormoreinformationaboutPivotalGemFireseethePivotalGemFireDocumentation

FormoreinformationaboutPivotalCloudFoundryseethePivotalCloudFoundryDocumentation

NOTEThisproducthasbeendiscontinued

copyCopyrightPivotalSoftwareInc2013-2018 3 17

ReleaseNotesforGemFireforPivotalCloudFoundry

OverviewGemFireforPivotalCloudFoundry (PCF)supportsthedeploymentofmultiplePivotalGemFireclusterconfigurationstoPCFtosupportGemFireapplicationdevelopmentanddeploymentGemFireforPCFenablesadministratorstocustomizethreedifferentclusterconfigurationstoprovidecoarsecontroloverthenumberoflocatorsandserversavailableineachGemFireinstanceInadditiondeveloperscancustomizetheGemFireinstancethatisboundtotheirappusingGemFireclusterconfigurationcommandsoranewCloudFoundryCLIinterface

YourfeedbackiswelcomePleaseprovideanybugsfeaturerequestsorquestionseithertoPivotalCustomerSupportathttpssupportpivotalio oremailpivotal-cf-feedbackpivotalio

v1720

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1660

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1710

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1650

copyCopyrightPivotalSoftwareInc2013-2018 4 17

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1640

ReleaseDate11thNovember2016

Newinthisrelease

Bugfixes

Upgradedgolangtov17

v1630

ReleaseDate28thOctober2016

Newinthisrelease

StemcellAWS323217patchesUbuntuCVEs

CompatibilityfixesforPCFv17runningonvSphereandAzure

v1700

ReleaseDate19thSeptember2016

NewinthisRelease

CompatibilityreleaseforPCFv17andPCFv18TheGemFireforPCFservicenowinstallsonbothPCFv17andPCFv18withoutsupportforspecificfeaturessuchasmultipleavailabilityzones

IPsecsupportTheGemFireforPCFtilenowsupportsIPsec

LogformatchangedfromfreetexttoJSON

Bugfixes

DBsynchissuesUpgradedgolangtov17UsecryptolibraryforcertificatechaindiscoveryUseofCF_DIAL_TIMEOUTServiceinstanceroutearenowuniqueacrossorgsandspaces

StemcellAWS323217patchesUbuntuCVEs

StemcellAzure323217patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xv35xToresolvethisusethelatestJavabuildpack

CurrentlytilesupportsonlyasingleAvailabilityZone(AZ)

copyCopyrightPivotalSoftwareInc2013-2018 5 17

v162

ReleaseDate28thJuly2016

NewinthisRelease

CompatibilityreleaseforPCFv17TheGemFireforPCFservicenowinstallsonPCFv17withoutsupportforPCFv17ndashspecificfeaturessuchasmultipleavailabilityzones

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34x35xToresolvethisusethelatestJavabuildpack

v161

ReleaseDate22ndJuly2016

NewinthisRelease

StemcellAWS323213patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34xand35xToresolvethisupdateJavabuildpackto36 InJavabuildpack34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1600

ReleaseDate31stMay2016

NewinthisRelease

StemcellAWS32324patchesUbuntuCVEs

StemcellAzure32325patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1500

ReleaseDate9thMay2016

NewinthisRelease

ThepackagedGemFireisupgradedfromv8205tov82014

The enable-network-partition-detection propertyisnowenabled topreventagainstdatacorruptioninsplit-brainscenarios

Clusterstabilityhasbeenimprovedduringrestartsandduringserviceinstancedeletions

Defaulttimeoutof cf restart-gemfire hasbeenincreasedfrom120secondsto900secondstoaccommodateslower-than-expectedstartupofserversandlocators

copyCopyrightPivotalSoftwareInc2013-2018 6 17

WhenrunningonAzureGemFireserverswillhaveredundancyzones tieddirectlytoAzurersquosfaultdomains sothatredundancyforpartitionedregionsissatisfiedacrossmultiplevirtualserverracks

The cf export-gemfire commandnowgivesfeedbackaboutmissingargumentsmakingiteasiertoexportyourGemFirelogsclusterconfigsandproperties

UpgradeWarningDowntimeRequired

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeployment

Sincethe enable-network-partition-detection=true propertymustbesetontheentireclusteratthesametimeweareunabletodoarollingupgradePreviouslydeployedappsandserviceinstanceswillcontinuetofunctionnormallyaftertheupgradethoughGemFireforPCFwillbeunavailableduringtheupgrade

ForOpsManager-deployedtiles

1 Uploadthev1500GemFireforPCFtiletoOpsManager

2 UnderAvailableProductsgtPivotalGemFireclickAdd

3 boshtarget yourOpsManager-deployedboshdirector

4 boshstop yourpreviouslydeployedGemFireforPCFtileThiswillstoptheGemFireforPCFservicebrokerandallserviceinstances

5 InOpsManagerclickApplyChanges

Forbosh-deployedreleases

1 bosh upload thereleasescontainedinthistile

2 bosh stop yourexistingGemFiredeployment

3 bosh deploy themanifestcontainedinthistile

4 bosh start yournewdeployment

copyCopyrightPivotalSoftwareInc2013-2018 7 17

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

PivotalGemFireforPivotalCloudFoundry

ThisdocumentationdescribeshowtoinstallconfigureanduseGemFireforPivotalCloudFoundry (PCF)

ProductSnapshotCurrentGemFireforPivotalCloudFoundryDetails

Version170ReleaseDate19thSeptember2016SoftwarecomponentversionGemFire821SpringDataGemFire182Java8(JDKJRE8u60)CompatibleOpsManagerVersion(s)17x18xCompatibleElasticRuntimeVersion(s)17x18xCompatibleJavaBuildpackVersion(s)36371vSpheresupportYesAWSsupportYesIPSecsupportYes

UpgradingtotheLatestVersionThisversionofPivotalGemFireforPivotalCloudFoundrysupportsupgradingfromallthepreviousversionsoftheproductRunningserviceinstancesareautomaticallyupgradedonenodeatatimeIfyouconfiguredyourclusterswithdataredundancythentheupgradeprocessrequiresnodowntimeandresultsinnodataloss

NoteUpgradesfromAlphaorBetaversionsofthesoftwarearenotsupported

DocumentationIndexThedocumentationcontainsthefollowingtopics

ReleaseNotes

Overview

InstallingGemFireforPivotalCloudFoundry

UsingGemFireforPivotalCloudFoundry

Troubleshooting

FormoreinformationaboutPivotalGemFireseethePivotalGemFireDocumentation

FormoreinformationaboutPivotalCloudFoundryseethePivotalCloudFoundryDocumentation

NOTEThisproducthasbeendiscontinued

copyCopyrightPivotalSoftwareInc2013-2018 3 17

ReleaseNotesforGemFireforPivotalCloudFoundry

OverviewGemFireforPivotalCloudFoundry (PCF)supportsthedeploymentofmultiplePivotalGemFireclusterconfigurationstoPCFtosupportGemFireapplicationdevelopmentanddeploymentGemFireforPCFenablesadministratorstocustomizethreedifferentclusterconfigurationstoprovidecoarsecontroloverthenumberoflocatorsandserversavailableineachGemFireinstanceInadditiondeveloperscancustomizetheGemFireinstancethatisboundtotheirappusingGemFireclusterconfigurationcommandsoranewCloudFoundryCLIinterface

YourfeedbackiswelcomePleaseprovideanybugsfeaturerequestsorquestionseithertoPivotalCustomerSupportathttpssupportpivotalio oremailpivotal-cf-feedbackpivotalio

v1720

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1660

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1710

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1650

copyCopyrightPivotalSoftwareInc2013-2018 4 17

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1640

ReleaseDate11thNovember2016

Newinthisrelease

Bugfixes

Upgradedgolangtov17

v1630

ReleaseDate28thOctober2016

Newinthisrelease

StemcellAWS323217patchesUbuntuCVEs

CompatibilityfixesforPCFv17runningonvSphereandAzure

v1700

ReleaseDate19thSeptember2016

NewinthisRelease

CompatibilityreleaseforPCFv17andPCFv18TheGemFireforPCFservicenowinstallsonbothPCFv17andPCFv18withoutsupportforspecificfeaturessuchasmultipleavailabilityzones

IPsecsupportTheGemFireforPCFtilenowsupportsIPsec

LogformatchangedfromfreetexttoJSON

Bugfixes

DBsynchissuesUpgradedgolangtov17UsecryptolibraryforcertificatechaindiscoveryUseofCF_DIAL_TIMEOUTServiceinstanceroutearenowuniqueacrossorgsandspaces

StemcellAWS323217patchesUbuntuCVEs

StemcellAzure323217patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xv35xToresolvethisusethelatestJavabuildpack

CurrentlytilesupportsonlyasingleAvailabilityZone(AZ)

copyCopyrightPivotalSoftwareInc2013-2018 5 17

v162

ReleaseDate28thJuly2016

NewinthisRelease

CompatibilityreleaseforPCFv17TheGemFireforPCFservicenowinstallsonPCFv17withoutsupportforPCFv17ndashspecificfeaturessuchasmultipleavailabilityzones

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34x35xToresolvethisusethelatestJavabuildpack

v161

ReleaseDate22ndJuly2016

NewinthisRelease

StemcellAWS323213patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34xand35xToresolvethisupdateJavabuildpackto36 InJavabuildpack34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1600

ReleaseDate31stMay2016

NewinthisRelease

StemcellAWS32324patchesUbuntuCVEs

StemcellAzure32325patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1500

ReleaseDate9thMay2016

NewinthisRelease

ThepackagedGemFireisupgradedfromv8205tov82014

The enable-network-partition-detection propertyisnowenabled topreventagainstdatacorruptioninsplit-brainscenarios

Clusterstabilityhasbeenimprovedduringrestartsandduringserviceinstancedeletions

Defaulttimeoutof cf restart-gemfire hasbeenincreasedfrom120secondsto900secondstoaccommodateslower-than-expectedstartupofserversandlocators

copyCopyrightPivotalSoftwareInc2013-2018 6 17

WhenrunningonAzureGemFireserverswillhaveredundancyzones tieddirectlytoAzurersquosfaultdomains sothatredundancyforpartitionedregionsissatisfiedacrossmultiplevirtualserverracks

The cf export-gemfire commandnowgivesfeedbackaboutmissingargumentsmakingiteasiertoexportyourGemFirelogsclusterconfigsandproperties

UpgradeWarningDowntimeRequired

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeployment

Sincethe enable-network-partition-detection=true propertymustbesetontheentireclusteratthesametimeweareunabletodoarollingupgradePreviouslydeployedappsandserviceinstanceswillcontinuetofunctionnormallyaftertheupgradethoughGemFireforPCFwillbeunavailableduringtheupgrade

ForOpsManager-deployedtiles

1 Uploadthev1500GemFireforPCFtiletoOpsManager

2 UnderAvailableProductsgtPivotalGemFireclickAdd

3 boshtarget yourOpsManager-deployedboshdirector

4 boshstop yourpreviouslydeployedGemFireforPCFtileThiswillstoptheGemFireforPCFservicebrokerandallserviceinstances

5 InOpsManagerclickApplyChanges

Forbosh-deployedreleases

1 bosh upload thereleasescontainedinthistile

2 bosh stop yourexistingGemFiredeployment

3 bosh deploy themanifestcontainedinthistile

4 bosh start yournewdeployment

copyCopyrightPivotalSoftwareInc2013-2018 7 17

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

ReleaseNotesforGemFireforPivotalCloudFoundry

OverviewGemFireforPivotalCloudFoundry (PCF)supportsthedeploymentofmultiplePivotalGemFireclusterconfigurationstoPCFtosupportGemFireapplicationdevelopmentanddeploymentGemFireforPCFenablesadministratorstocustomizethreedifferentclusterconfigurationstoprovidecoarsecontroloverthenumberoflocatorsandserversavailableineachGemFireinstanceInadditiondeveloperscancustomizetheGemFireinstancethatisboundtotheirappusingGemFireclusterconfigurationcommandsoranewCloudFoundryCLIinterface

YourfeedbackiswelcomePleaseprovideanybugsfeaturerequestsorquestionseithertoPivotalCustomerSupportathttpssupportpivotalio oremailpivotal-cf-feedbackpivotalio

v1720

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1660

ReleaseDate30thJanuary2017

NewinthisRelease

Securityfixes

Runsgfshprocessasthe vcap userinsteadofthe root user

v1710

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1650

copyCopyrightPivotalSoftwareInc2013-2018 4 17

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1640

ReleaseDate11thNovember2016

Newinthisrelease

Bugfixes

Upgradedgolangtov17

v1630

ReleaseDate28thOctober2016

Newinthisrelease

StemcellAWS323217patchesUbuntuCVEs

CompatibilityfixesforPCFv17runningonvSphereandAzure

v1700

ReleaseDate19thSeptember2016

NewinthisRelease

CompatibilityreleaseforPCFv17andPCFv18TheGemFireforPCFservicenowinstallsonbothPCFv17andPCFv18withoutsupportforspecificfeaturessuchasmultipleavailabilityzones

IPsecsupportTheGemFireforPCFtilenowsupportsIPsec

LogformatchangedfromfreetexttoJSON

Bugfixes

DBsynchissuesUpgradedgolangtov17UsecryptolibraryforcertificatechaindiscoveryUseofCF_DIAL_TIMEOUTServiceinstanceroutearenowuniqueacrossorgsandspaces

StemcellAWS323217patchesUbuntuCVEs

StemcellAzure323217patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xv35xToresolvethisusethelatestJavabuildpack

CurrentlytilesupportsonlyasingleAvailabilityZone(AZ)

copyCopyrightPivotalSoftwareInc2013-2018 5 17

v162

ReleaseDate28thJuly2016

NewinthisRelease

CompatibilityreleaseforPCFv17TheGemFireforPCFservicenowinstallsonPCFv17withoutsupportforPCFv17ndashspecificfeaturessuchasmultipleavailabilityzones

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34x35xToresolvethisusethelatestJavabuildpack

v161

ReleaseDate22ndJuly2016

NewinthisRelease

StemcellAWS323213patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34xand35xToresolvethisupdateJavabuildpackto36 InJavabuildpack34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1600

ReleaseDate31stMay2016

NewinthisRelease

StemcellAWS32324patchesUbuntuCVEs

StemcellAzure32325patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1500

ReleaseDate9thMay2016

NewinthisRelease

ThepackagedGemFireisupgradedfromv8205tov82014

The enable-network-partition-detection propertyisnowenabled topreventagainstdatacorruptioninsplit-brainscenarios

Clusterstabilityhasbeenimprovedduringrestartsandduringserviceinstancedeletions

Defaulttimeoutof cf restart-gemfire hasbeenincreasedfrom120secondsto900secondstoaccommodateslower-than-expectedstartupofserversandlocators

copyCopyrightPivotalSoftwareInc2013-2018 6 17

WhenrunningonAzureGemFireserverswillhaveredundancyzones tieddirectlytoAzurersquosfaultdomains sothatredundancyforpartitionedregionsissatisfiedacrossmultiplevirtualserverracks

The cf export-gemfire commandnowgivesfeedbackaboutmissingargumentsmakingiteasiertoexportyourGemFirelogsclusterconfigsandproperties

UpgradeWarningDowntimeRequired

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeployment

Sincethe enable-network-partition-detection=true propertymustbesetontheentireclusteratthesametimeweareunabletodoarollingupgradePreviouslydeployedappsandserviceinstanceswillcontinuetofunctionnormallyaftertheupgradethoughGemFireforPCFwillbeunavailableduringtheupgrade

ForOpsManager-deployedtiles

1 Uploadthev1500GemFireforPCFtiletoOpsManager

2 UnderAvailableProductsgtPivotalGemFireclickAdd

3 boshtarget yourOpsManager-deployedboshdirector

4 boshstop yourpreviouslydeployedGemFireforPCFtileThiswillstoptheGemFireforPCFservicebrokerandallserviceinstances

5 InOpsManagerclickApplyChanges

Forbosh-deployedreleases

1 bosh upload thereleasescontainedinthistile

2 bosh stop yourexistingGemFiredeployment

3 bosh deploy themanifestcontainedinthistile

4 bosh start yournewdeployment

copyCopyrightPivotalSoftwareInc2013-2018 7 17

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

ReleaseDate29thDecember2016

NewinthisRelease

StemcellAWS32336patchesUbuntuCVEs

StemcellAzure32337patchesUbuntuCVEs

Securityfixes

RemovepublicroutethatexposedWANreplicationcredentials[CVE-2016-8220]Addauthenticationtobrokerendpoints[CVE-2016-9880]

v1640

ReleaseDate11thNovember2016

Newinthisrelease

Bugfixes

Upgradedgolangtov17

v1630

ReleaseDate28thOctober2016

Newinthisrelease

StemcellAWS323217patchesUbuntuCVEs

CompatibilityfixesforPCFv17runningonvSphereandAzure

v1700

ReleaseDate19thSeptember2016

NewinthisRelease

CompatibilityreleaseforPCFv17andPCFv18TheGemFireforPCFservicenowinstallsonbothPCFv17andPCFv18withoutsupportforspecificfeaturessuchasmultipleavailabilityzones

IPsecsupportTheGemFireforPCFtilenowsupportsIPsec

LogformatchangedfromfreetexttoJSON

Bugfixes

DBsynchissuesUpgradedgolangtov17UsecryptolibraryforcertificatechaindiscoveryUseofCF_DIAL_TIMEOUTServiceinstanceroutearenowuniqueacrossorgsandspaces

StemcellAWS323217patchesUbuntuCVEs

StemcellAzure323217patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xv35xToresolvethisusethelatestJavabuildpack

CurrentlytilesupportsonlyasingleAvailabilityZone(AZ)

copyCopyrightPivotalSoftwareInc2013-2018 5 17

v162

ReleaseDate28thJuly2016

NewinthisRelease

CompatibilityreleaseforPCFv17TheGemFireforPCFservicenowinstallsonPCFv17withoutsupportforPCFv17ndashspecificfeaturessuchasmultipleavailabilityzones

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34x35xToresolvethisusethelatestJavabuildpack

v161

ReleaseDate22ndJuly2016

NewinthisRelease

StemcellAWS323213patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34xand35xToresolvethisupdateJavabuildpackto36 InJavabuildpack34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1600

ReleaseDate31stMay2016

NewinthisRelease

StemcellAWS32324patchesUbuntuCVEs

StemcellAzure32325patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1500

ReleaseDate9thMay2016

NewinthisRelease

ThepackagedGemFireisupgradedfromv8205tov82014

The enable-network-partition-detection propertyisnowenabled topreventagainstdatacorruptioninsplit-brainscenarios

Clusterstabilityhasbeenimprovedduringrestartsandduringserviceinstancedeletions

Defaulttimeoutof cf restart-gemfire hasbeenincreasedfrom120secondsto900secondstoaccommodateslower-than-expectedstartupofserversandlocators

copyCopyrightPivotalSoftwareInc2013-2018 6 17

WhenrunningonAzureGemFireserverswillhaveredundancyzones tieddirectlytoAzurersquosfaultdomains sothatredundancyforpartitionedregionsissatisfiedacrossmultiplevirtualserverracks

The cf export-gemfire commandnowgivesfeedbackaboutmissingargumentsmakingiteasiertoexportyourGemFirelogsclusterconfigsandproperties

UpgradeWarningDowntimeRequired

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeployment

Sincethe enable-network-partition-detection=true propertymustbesetontheentireclusteratthesametimeweareunabletodoarollingupgradePreviouslydeployedappsandserviceinstanceswillcontinuetofunctionnormallyaftertheupgradethoughGemFireforPCFwillbeunavailableduringtheupgrade

ForOpsManager-deployedtiles

1 Uploadthev1500GemFireforPCFtiletoOpsManager

2 UnderAvailableProductsgtPivotalGemFireclickAdd

3 boshtarget yourOpsManager-deployedboshdirector

4 boshstop yourpreviouslydeployedGemFireforPCFtileThiswillstoptheGemFireforPCFservicebrokerandallserviceinstances

5 InOpsManagerclickApplyChanges

Forbosh-deployedreleases

1 bosh upload thereleasescontainedinthistile

2 bosh stop yourexistingGemFiredeployment

3 bosh deploy themanifestcontainedinthistile

4 bosh start yournewdeployment

copyCopyrightPivotalSoftwareInc2013-2018 7 17

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

v162

ReleaseDate28thJuly2016

NewinthisRelease

CompatibilityreleaseforPCFv17TheGemFireforPCFservicenowinstallsonPCFv17withoutsupportforPCFv17ndashspecificfeaturessuchasmultipleavailabilityzones

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34x35xToresolvethisusethelatestJavabuildpack

v161

ReleaseDate22ndJuly2016

NewinthisRelease

StemcellAWS323213patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacks34xand35xToresolvethisupdateJavabuildpackto36 InJavabuildpack34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1600

ReleaseDate31stMay2016

NewinthisRelease

StemcellAWS32324patchesUbuntuCVEs

StemcellAzure32325patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1500

ReleaseDate9thMay2016

NewinthisRelease

ThepackagedGemFireisupgradedfromv8205tov82014

The enable-network-partition-detection propertyisnowenabled topreventagainstdatacorruptioninsplit-brainscenarios

Clusterstabilityhasbeenimprovedduringrestartsandduringserviceinstancedeletions

Defaulttimeoutof cf restart-gemfire hasbeenincreasedfrom120secondsto900secondstoaccommodateslower-than-expectedstartupofserversandlocators

copyCopyrightPivotalSoftwareInc2013-2018 6 17

WhenrunningonAzureGemFireserverswillhaveredundancyzones tieddirectlytoAzurersquosfaultdomains sothatredundancyforpartitionedregionsissatisfiedacrossmultiplevirtualserverracks

The cf export-gemfire commandnowgivesfeedbackaboutmissingargumentsmakingiteasiertoexportyourGemFirelogsclusterconfigsandproperties

UpgradeWarningDowntimeRequired

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeployment

Sincethe enable-network-partition-detection=true propertymustbesetontheentireclusteratthesametimeweareunabletodoarollingupgradePreviouslydeployedappsandserviceinstanceswillcontinuetofunctionnormallyaftertheupgradethoughGemFireforPCFwillbeunavailableduringtheupgrade

ForOpsManager-deployedtiles

1 Uploadthev1500GemFireforPCFtiletoOpsManager

2 UnderAvailableProductsgtPivotalGemFireclickAdd

3 boshtarget yourOpsManager-deployedboshdirector

4 boshstop yourpreviouslydeployedGemFireforPCFtileThiswillstoptheGemFireforPCFservicebrokerandallserviceinstances

5 InOpsManagerclickApplyChanges

Forbosh-deployedreleases

1 bosh upload thereleasescontainedinthistile

2 bosh stop yourexistingGemFiredeployment

3 bosh deploy themanifestcontainedinthistile

4 bosh start yournewdeployment

copyCopyrightPivotalSoftwareInc2013-2018 7 17

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

WhenrunningonAzureGemFireserverswillhaveredundancyzones tieddirectlytoAzurersquosfaultdomains sothatredundancyforpartitionedregionsissatisfiedacrossmultiplevirtualserverracks

The cf export-gemfire commandnowgivesfeedbackaboutmissingargumentsmakingiteasiertoexportyourGemFirelogsclusterconfigsandproperties

UpgradeWarningDowntimeRequired

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeployment

Sincethe enable-network-partition-detection=true propertymustbesetontheentireclusteratthesametimeweareunabletodoarollingupgradePreviouslydeployedappsandserviceinstanceswillcontinuetofunctionnormallyaftertheupgradethoughGemFireforPCFwillbeunavailableduringtheupgrade

ForOpsManager-deployedtiles

1 Uploadthev1500GemFireforPCFtiletoOpsManager

2 UnderAvailableProductsgtPivotalGemFireclickAdd

3 boshtarget yourOpsManager-deployedboshdirector

4 boshstop yourpreviouslydeployedGemFireforPCFtileThiswillstoptheGemFireforPCFservicebrokerandallserviceinstances

5 InOpsManagerclickApplyChanges

Forbosh-deployedreleases

1 bosh upload thereleasescontainedinthistile

2 bosh stop yourexistingGemFiredeployment

3 bosh deploy themanifestcontainedinthistile

4 bosh start yournewdeployment

copyCopyrightPivotalSoftwareInc2013-2018 7 17

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

KnownIssuesandLimitations

Upgradingtov1500willrequiredowntimeforyourGemFireforPCFdeploymentasdetailedintheprevioussection

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1400

ReleaseDate4thApril2016

NewinthisRelease

AddssupportforusingCLIpluginwithahttpproxyToenableproxyusagefollowthesameinstructionsfortheCLI

EnablesbestpracticeOStuningsettingsforserverandlocatorVMsIncludessettingsfor

fsfile-max

vmswappiness

netcoresomaxconn

netcorenetdev_max_backlog

netcorermem_max

netcorewmem_max

netipv4tcp_wmem

netipv4tcp_rmem

netipv4tcp_syncookies

netipv4tcp_max_syn_backlog

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1300

ReleaseDate18thMarch2016

NewinthisRelease

Addsupportforasynchronousserviceinstanceallocationanddeallocation

AddbasicauthforGemfireagentendpoints

Improveerrorhandlingandreportingduringserviceinstancedeallocation

Includestacktracesinerrorlogsfortheservicebroker

IntroduceloglevelsfortheservicebrokerFornowtheyareonlyconfigurableatthereleaselevelandsetto info bydefaultTheyarenotexposedinthetileatthispoint

Increasethedefaultlimitforfiledescriptorsto32000fortheGemFireVM

EnsurethattheJVMis kill edwhenitisOutofMemory

Upgradestemcellto314610patchingUSN-2929-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

copyCopyrightPivotalSoftwareInc2013-2018 8 17

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

v1230

ReleaseDate4thFebruary2016

NewinthisRelease

Stemcell31466patchesUbuntuCVEs

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1220

ReleaseDate22ndJanuary2016

NewinthisRelease

Stemcell31465resolvesCVE-2016-0728

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1210

ReleaseDate12thJanuary2016

NewinthisRelease

Stemcell31462resolvesCVEUSN-2857-1

KnownIssuesandLimitations

ThereisaknownissuewhereappsfailtostagewhenusingtheJavabuildpacksv34xandv35xToresolvethisupdateJavabuildpacktov36 InJavabuildpackv34GemFirewasupgradedfromv80tov82GemFirev81introducedadependencyonlog4jbutlog4jwasnotaddedtotheJavabuildpackv34ThisdependencyhasbeenincludedinJavabuildpackv36

v1200

ReleaseDate1stDecember2015

NewinthisRelease

SupportforGemFiremulti-site(WAN)replication

SupportfortheldquoTrustedCertificatesrdquofeatureinOpsManagerThecertificatesfromldquoTrustedCertificatesrdquoaredeployedtoallGemFirenodesandtotheGemFireservicebrokerNoteonself-signedandinternalCAsignedcertificatesIfyouareusingaself-signedcertificateoracertificatesignedbyaninternalorothernotknowncertificateauthority(CA)youmustaddthecertificate(orcertificatechain)totheldquoTrustedCertificatesrdquoinOpsManager

GemFireupgradedtov8205

copyCopyrightPivotalSoftwareInc2013-2018 9 17

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

Drainscriptimprovements

BettererrorreportingforserviceinstanceallocationfailuresInsteadofreturningldquoThemaximumnumberofServiceInstancesalreadyexistrdquomessageforallfailuresduringaserviceinstanceallocationeachdifferenttypeoffailurereturnsadescriptiveerrormessage

Stemcell3144

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartofanupgradeThisproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofanupgradeanewVMhasbeencreatedwiththesameIPbutwithadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

v1110

ReleaseDate5thNovember2015

NewinthisRelease

SupportforOpsManagerv16andElasticRuntimev16ThisreleasedoesnotworkwiththepreviousreleasesofOpsManagerandElasticRuntime

Stemcell3100

KnownIssuesandLimitations

SeeKnownIssuesandLimitationsforv1100below

v1100

ReleaseDate22ndSeptember2015

NewinthisRelease

UpgradedPivotalGemFiretov82

UpgradedJavatov8andJREv18

Spring-relatedenhancements

SupportfordeployingaSpringXMLconfigurationandapplicationcodetoGemFireserviceinstances

IfyouuseSpringldquoallthewayrdquoyoucandosowithGemFireserviceinstancesaswellThereisnoneedtotranslatetheSpringconfigurationtoGemFireXMLSpringsupportisprovidedusingconfigurationoptionsoftheGemFireforPCFCLIplug-incommand cf restart-gemfire

SupportforusingSSLencryptiontoaccessGemFireServiceInstancesfromoutsideofPCF

GemFirePulseisnowaccessibleviaHTTPSGemFireRESTclientscanbeconfiguredtoaccessaserviceinstancersquosRESTAPIendpointviaHTTPSYoucanconfiguretheGemFireshell(gfsh)toaccessaserviceinstanceoverHTTPS

Additionalfixesandimprovements

DrainscriptimprovementsImprovedhandlingofself-signedcertificatesYAMLsyntaxvalidationforclusterpropertiesthatareprovidedviathe --properties optionofthe cf restart-gemfire CLIcommand

Stemcell3062

copyCopyrightPivotalSoftwareInc2013-2018 10 17

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

SupportfortheexperimentalfeatureHTTPStraffictoUAA

KnownIssuesandLimitations

UpgradingtheGemFiretileonAWScanfailwhenthestemcellischangingaspartoftheupgradeTheproblemusuallymanifestsitselfduringtheinstallprocessrsquosmoketesterrandTheissueariseswhenaspartofupgradeanewVMhasbeencreatedwiththesameIPbutadifferentMACaddressBecauseAWSsuppressesunsolicitedARPsothermembersmaynotknowthattheirARPcachehasbecomeinvalid

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

v1000

ReleaseDate10August2015

KnownIssuesandLimitations

TheservicesupportsonlyasinglePCFavailabilityzone AlthoughtheserviceenablesGemFireHAfeaturessuchasredundancyandpersistenceafailureofthetargetedavailabilityzonecanresultinthelossofGemFireregiondataNoteIfthereismorethanoneavailablezoneyoumayseedeploymentfailuresorunevensizedclusters

TheexperimentalHTTPS-onlyfeatureinElasticRuntimev15isnotsupportedandmaycauseissueswiththisversionoftheproductPivotalisworkingtoprovidefullsupportforHTTPS-onlytrafficinafuturerelease

ElasticscalingisnotsupportedYoucannotchangethenumberofcacheserversandlocatorsinaserviceplanwithoutdestroyingandrecreatingthecurrentserviceplaninstances

Ifyoudeploytheserviceandthensubsequentlyreducethenumberofclustersallallocatedinstancesaredestroyed

GemFireWANreplicationisnotsupported

copyCopyrightPivotalSoftwareInc2013-2018 11 17

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

OverviewGemFireforPivotalCloudFoundry (PCF)enablesyoutoeasilyconfigureandprovisioncompletePivotalGemFireclientserverclustersusingPivotalCloudFoundryACloudFoundryAdministratorcaneasilyconfigurethreedifferenttypesofGemFireclusters(serviceplans)usingdifferentnumbersoflocatorsandserversaswellasdifferentresourcesperclusternodeforeachserviceplanEachserviceplaninstanceusesGemFirebestpracticestoautomaticallyconfigureJVMresourceutilizationandgarbagecollectionsettingstakingintoconsiderationtheresourcesavailableontheclusternodeServiceinstancesarededicatednotmultitenantbydefaultbuttheycanbeusedbydifferentapplicationsifdesiredAllocatingaserviceinstanceprovisionsaGemFireclusterfromthepoolofavailableunallocatedGemFireclustersthatwereinstantiatedduringthetileinstallationGemFireprocesseslocatorsandserversrunindedicatedVMs

PivotalprovidestheGemFirePulseWebapplicationgfshcommand-lineutilitytohelpyoumonitormanagetheserviceinstancesthatyoudeployInadditionPivotalprovidesaCloudFoundryCLIplug-inthatdeveloperscanusetoperformthemostcommonGemFireclustermanagementoperationssuchas

Restartingthecluster

Downloadingclusterconfigurationfileslogfilesorstatistics

Uploadingcustomclusterconfigurations

FinallyGemFireforPivotalCloudFoundryprovidesacustomrestURLtohelpyoueasilyusetheGemFireRESTAPIwithaboundserviceinstanceRequeststotheURLautomaticallyround-robintoavailablecacheserverssothereisnoneedtoassociateRESTrequestswithaspecificserver

HowDoestheServiceWork

PCFAdministratorWorkflowThefollowingdiagramdepictsthehigh-levelworkflowfordeployingtheGemFireservice

Figure1InstallingandConfiguringtheService

copyCopyrightPivotalSoftwareInc2013-2018 12 17

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

1 PivotalCloudFoundryAdministratorimportstheGemFireserviceproductfileintoPivotalCloudFoundryOperationsManager

2 WhenaPivotalCloudFoundryAdministratorconfigurestheGemFireserviceforthefirsttimetheydefinethenumberofdiscreteserviceinstancesforeachGemFireServicePlanAserviceinstanceisaGemFireclusterGemFireforPivotalCloudFoundryenablesyoutoconfigureinstancesforthreedifferentGemFireclusterconfigurationswhereeachinstancecanprovideadifferentnumberoflocatorsandcacheserversaswellasmemoryanddiskspaceresources

3 AftermakingtheirconfigurationchoicesthePivotalCloudFoundryAdministratordeploystheservicecausingPivotalCloudFoundryOpsManagertocreateandsetuptheappropriatesetofvirtualmachines

4 OperationsManagerdeploysavirtualmachinetoruntheGemFireServiceBrokerwhichisresponsibleforallocatingGemFireClusterserviceinstancestoPivotalCloudFoundryusersandforpassingrelevantinformationintotheapplicationsthatareboundtoeachserviceinstance

5 OperationsManageralsodeploysthespecifiednumberofGemFireserviceinstances(clusters)asconfiguredbytheadministratorLastlythereareafewtemporaryVMsusedforinstallanduninstallerrands

AftertheservicehasbeendeployedinOperationsManageritisreadyforusebyapplicationdevelopersintheElasticRuntimeenvironmentThefollowingdiagramdepictsthehigh-levelworkflowthatanapplicationdeveloperwouldusetoconsumetheservice

PCFDeveloper(ServiceUser)WorkflowFigure2UsingtheService

copyCopyrightPivotalSoftwareInc2013-2018 13 17

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

1 PivotalCloudFoundryDeveloperusestheCLIorDeveloperConsoletocreateaGemFireserviceinstanceintheElasticRuntimespacewheretheyarepushingtherelevantapplications

2 CreatingaserviceinstancecausesElasticRuntimetocontacttheGemFireServiceBrokerwhichallocatesoneun-allocatedGemFireclusterofdedicatedvirtualmachinestotheGemFireserviceinstanceIntheresponsetoElasticRuntimetheServiceBrokerincludestheURLtoreachtheGemFirePulsemonitoringtoolfortheserviceinstanceTheElasticRuntimeexposesthisURLintheDeveloperConsolersquosmetadatafortheserviceinstance

3 PivotalCloudFoundryDeveloperpushestheirapplicationtoElasticRuntime

4 PivotalCloudFoundryDeveloperbindstheirapplicationtotheGemFireserviceinstanceTheGemFireServiceBrokerpopulatestheapplicationrsquosVCAP_SERVICESenvironmentvariablewiththemetadatarequiredtoaccesstheGemFireserviceinstancersquoslocatorsandcacheservers

5 PivotalCloudFoundrydevelopercanconfiguremonitorandmanagetheclusterusingPulseandortheGemFireforPivotalCloudFoundryCLIplug-in

AdditionalResourcesPivotalGemFireProductDocumentation

PivotalGemFireCommunityForum

PivotalGemFireKnowledgeBase

PivotalCloudFoundryDocumentation

copyCopyrightPivotalSoftwareInc2013-2018 14 17

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

InstallingGemFireforPivotalCloudFoundryPrerequisites

ServiceConfigurationDefaults

InstallationSteps

CreatingGemFireServicePlans

ApplicationSecurityGroups

PrerequisitesBeforeyoubeginyourGemFireforPivotalCloudFoundry (PCF)deploymentyoursystemneedstomeetthefollowingminimumrequirements

PivotalCloudFoundryOpsManagerforvSphereorPivotalCloudFoundryOpsManagerforvCloudAirorvCloudDirectororPivotalCloudFoundryOpsManagerforAWS

IPSec(optional)IfyouwishtouseIPSecinyourPivotalGemFireinstallationpleaseensureyouhavetheIPSecBOSHreleasedeployedbeforeinstallingtheElasticRuntimeandGemFiretileForinstructionsondeployingtheIPSecBOSHreleaseseetheinstructionshere

PivotalCloudFoundryElasticRuntime

NetworkaccessandcredentialsforthePivotalCloudFoundryOpsManagerWebConsole

CapacityinthevSphereclusterforserviceinstancesyouwanttodeployBydefaulttheGemFireserviceconfiguresthreedifferentGemFireserviceplansEachplandeploystheminimumof2locatorsbutdeploy35and7GemFirecacheserversrespectivelySeveralsupportingVMsarealsorequiredforservicedeploymentTheresourceallocationsforthedefaultGemFireserviceplaninstancesandcomponentsareasfollows

Table1DefaultResourceRequirementsforaGemFireServiceInstances

Service VirtualMachines CPU RAM(MB) EphemeralDisk(MB) PersistentDisk(MB)

GemFirelocator(Plan1)

2 1 1024 2048 1024

GemFirelocator(Plan2)

2 1 1024 2048 1024

GemFirelocator(Plan3)

2 1 1024 2048 1024

GemFireServer(Plan1)

3 2 4096 6144 8192

GemFireServer(Plan2)

3 2 4096 6144 8192

GemFireServer(Plan3)

3 2 4096 6144 8192

GemFireBroker 1 2 4096 4096 4096

BrokerRegistrar 1 1 2048 2048 0

BrokerDeregistrar 1 1 2048 2048 0

ClusterSmokeTest 1 1 512 2048 0

ClusterAgentSmokeTest

1 1 512 2048 0

ServiceOfferingSmokeTest

1 1 512 2048 0

Compilation 2 1 1024 4096 0

Totals 12 9 16384 24576 12800

RequiredforeachVM

ServiceConfigurationDefaults

copyCopyrightPivotalSoftwareInc2013-2018 15 17

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

TheGemFireforPivotalCloudFoundryserviceautomaticallyimplementsthebestpracticesanoperatorwouldnormallyemploywhendeployingGemFireTheseconfigurationsinclude

DynamicmemorymanagementDynamicallysettheJVMmaximumandminimummemoryutilizationforeachinstanceoftheGemFiresoftwareprocessbasedontheVMrsquostotalmemory

GarbagecollectionEnableandconfigurememorygarbagecollectionforeachinstanceoftheGemFiresoftwareprocess

LoggingconfigurationCreateandstorelogsattheconfigloglevelwithappropriatelimitationsonsizingandautomaticlogrotation

StatisticsmonitoringCreateandstorestatisticsfilesatasamplerateof1000whichcorrespondstoasamplingrateofoncepersecond

DataoverflowconfigurationOverflowdatatodiskwhencrossing70memoryutilization

MemoryoverutilizationprotectionPreventfurtherwritestomemorywhencrossing80memoryutilization

ClientauthenticationRequireclientstoauthenticatewhendirectlyaccessingcacheservers

Thedefaultconfigurationsettingscanbeadjustedifneededonaperserviceinstancebasis

InstallationSteps1 DownloadtheGemFireforPivotalCloudFoundrytilefromPivotalNetwork

2 UseaWebbrowsertologintothePivotalOpsManagerapplicationThePivotalCloudFoundryOpsManagerInstallationDashboarddisplays

3 ClickImportaProductTheAddProductsscreendisplays

4 ClickChooseFileandnavigatetothefileyoudownloadedThefileuploadstoyourPivotalCloudFoundrydeployment

5 ClickAddPivotalOpsManageraddsanewtileforGemFireforPivotalCloudFoundrytotheInstallationDashboard

Self-SignedandInternalSSLCertificatesInproductionenvironmentswerecommendthatyouuseanSSLcertificatesignedbyareputablecertificateauthority(CA)PleaseensureyourSSLcertificatehasalltheSubjectAlternativeNames(SANs)

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

IfyourcertificateissignedbyaknownauthorityandhasthecorrectSANspleasedisregardthissection

copyCopyrightPivotalSoftwareInc2013-2018 16 17

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

InternalCertificatesInthecaseofInternalCertificates(iecertificatessignedbyaninternalRootCA)youneedtoconfiguretheOpsManagerDirectortiletotrusttheinternalRootCAToachievethispleasefollowthestepsbelow

1 AddtheinternalRootCAistotheSecurityConfigsectionundertheOpsManagerDirectorTile

2 CopytheinternalcertificateandRootCA(certificatechain)totheElasticRuntimetilebynavigatingtoPivotalElasticRuntimegtNetworkinggtLoadBalancerwithTLSenabled(orHAProxy)

Self-SignedCertificatesWhenusingselfsignedcertificatesgeneratedbytheElasticRuntimeTileyouneedtoensurethatthiscertificateisprovidedtotheOpsManagerDirectorTile

GeneratingSelf-SignCertificatesusingtheElasticRuntimeTileTheElasticRuntimeTileallowsyoutogenerateself-signedcertificatesbynavigatingtoPivotalElasticRuntimegtNetworkinggtGenerateRSACertificatePleasespecifythefollowingwildcardsubdomains

systemexamplecom

appsexamplecom

uaasystemexamplecom

loginsystemexamplecom

OnceyouhavegeneratedyourcertificatecopythecertificatetotheOpsManagerDirectorTileandplaceitintheSecurityConfigsection

GeneratingSelf-SignedCertificatesusingOpenSSL1 TousetheOpenSSLCLIrunthefollowingcommands

a Generateaprivatekey openssl genrsa -des3 -out serverkey 1024b GenerateaCertificateSigningRequest(CSR)withthe subjectAltName entriesandeditthe subj flagasneeded

openssl req -new -key serverkey -out servercsr -subj C=USST=StateL=LocalityO=OrganizationOU=OrganizationUnitCN=wwwexamplecomemailAddress=exampleexamplecomsubjectAltName=DNS1=systemexamplecomDNS2=appsexamplecomDNS3=uaasystemexamplecomDNS4=loginsystemexamplecom

c RemovePassphrasefromKey cp serverkey serverkeyorg openssl rsa -in serverkeyorg -out serverkeyd GenerateaSelf-SignedCertificate openssl x509 -req -days 365 -in servercsr -signkey serverkey -out servercrt

2 UploadtheSSLcertificatetoyourloadbalancerInstructionsforAWS

a AuthenticatewiththeAWSCLI$ aws configure AWS Access Key ID [None] ltACCESS KEY GOES HEREgt AWS Secret Access Key [None] ltSECRET ACCESS KEY GOESHEREgt Default region name [None] us-east-1 Default output format [None] ENTER

b Uploadyourself-signedcertificateinIAMaws iam upload-server-certificate --server-certificate-name ltNAME OF CERTIFICATEgt --certificate-bodyfileservercrt --private-key fileserverkey

c Uploadyourself-signedcertificatetoyourElasticLoadBalancer(ELB)aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name ltELB NAMEgt --load-balancer-port ltPORTgt --ssl-certificate-id arnawsiamltIAM NUMBERgtserver-certificateltNAME OF CERTIFICATEgt

3 AddtheSSLcertificateasatrustedcertificatetoyourOpsManager-deployedVMs

a InOpsManagerontheDirectorTileundertheSecuritysectionpastethecertificateandsave

copyCopyrightPivotalSoftwareInc2013-2018 17 17

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

b OntheElasticRuntimeTileundertheNetworkingsectionpasteboththecertificateandtheprivatekeybesuretocheckDisableSSLcertificateverificationforthisenvironmentandsave

copyCopyrightPivotalSoftwareInc2013-2018 18 17

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

WANReplicationandSelf-SignedCertificates

AWANtopologyinGemFireisaclient-serverrelationshipWhenusingself-signedcertificateseachclientneedstotrusttheserverrsquosSSLcertificate

WhenusingWANreplicationwithself-signedcertificateswestronglyrecommendusingcertificatesthatweregeneratedwiththeOpenSSLCLIThisisbecauseOpsManagerself-signedcertificatesareactuallysignedbyOpsManagerrsquosinternalCAcertificateIfyoudouseacertificategeneratedbyOpsManageryoursquollneedtotrusttheOpsManagerrsquosinternalCAcertificateinstead

ForexamplewhensettingupWANreplicationacrosstwoPCFinstallationswhoeachusetheirownselfsignedcertificatesnamedWestandEast

1 InWestOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforEast(appendingifnecessary)andsave

copyCopyrightPivotalSoftwareInc2013-2018 19 17

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

2 InEastOpsManagerontheDirectorTileunderExperimentalFeaturesgtTrustedCertificatesaddthecertificateforWest(appendingifnecessary)andsave

3 InbothinstallationsyouneedtoredeploytheGemFireforPivotalCloudFoundrytileforthesechangestotakeeffectThesimplestwaytoforcearedeployistomakeasmallchangetoanyoftheconfigurationpropertiessuchastheServicePlanConfiguration

ThenproceedtoconfigureWANreplicationacrossyourmultiplesites

CreatingGemFireServicePlansConfigureGemFireserviceinstancestosetthemaximumcapacityforeachclusterprovidedinyourCloudFoundryenvironment

NoteIfyouhavealreadyconfiguredtheservicereducingthenumberofresourcesandreconfiguringtheservicecausesallallocatedinstancestobedestroyedSeetheReleaseNotesformoreinformationaboutknownproblemsandlimitations

copyCopyrightPivotalSoftwareInc2013-2018 20 17

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

FollowthesestepstoconfiguretheGemFireservice

1 SelecttheGemFireforPivotalCloudFoundrytiletodisplaytheconfigurationpage

2 (Optional)SelecttheAssignNetworkstabtospecifythevSphereNetworkwhereOpsManagerdeploystheGemFireServiceBrokerandrelatedvirtualmachinesSeeConfiguringNetworkIsolationOptionsinOpsManager inthePivotalCloudFoundrydocumentationformoreinformation

3 SelectAssignAvailabilityZonestospecifytheAvailabilityZoneintowhichOpsManagershoulddeploytheGemFireServiceBrokerandvirtualmachinesNotethatthecurrentversionoftheGemFireservicemustbedeployedtoasingleAvailabilityZoneSeeConfiguringOpsManagerDirectorforVMwarevSphere formoreinformationNoteThecurrentversionoftheserviceonlysupportsdeploymenttooneAvailabilityZoneevenifmultipleAvailabilityZonesareavailableDeployingtheservicetomorethanoneAZresultsinaninvalidinstallation

4 SelecttheConfigureServicePlan1-3tabstoconfiguretheeachofthethreeGemFireplansthatwillbeavailableintheElasticRuntimeCLIandWebConsoleGemFireforPivotalCloudFoundryprovidesthreedifferentserviceplansthatyoucanconfiguretoprovidedifferentGemFireclustersizesForeachofthethreeserviceplanconfigurations

a (Optional)AsabestpracticeusetheServicePlanNameServicePlanDescriptionandServicePlanFeatureBullet1-3fieldstodescribethesizeofeachclusterThisinformationwillappearintheMarketplacewhendevelopersarechoosingfromtheavailableplansForexample

2SpecifythenumberoflocatorsperclustertocreateintheGemFireclusterforthisplanaswellasthenumberofcacheserversperclusterForexample

copyCopyrightPivotalSoftwareInc2013-2018 21 17

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

NoteEachserviceplanmustspecifyaminimumoftwolocatorsandthreecacheserversperGemFireclusterRecordthenumberoflocatorsandserversusedineachplantohelpyouconfigurethetotalplanresourcesinthenextstepIfyouwouldliketodeferaplanconfigurationorallocationuntilalatertimeyoucandothatintheResourceConfigtab(seebelow)3ClickSavetosavethecurrentserviceplanconfiguration4RepeattheabovestepstoconfigureeachofthethreeGemFireserviceplans

5 (Optional)SelecttheResourceConfigtabtochangetheallocationofresourcesforofGemFiremembersineachserviceplan

a EnterthetotalnumberofGemFirelocatorandserverInstancesthatyouwanttocreateforeachoftheavailableserviceplansNoteThenumberoflocatororserverinstancesthatyouspecifyforaplanmustbeamultipleoftheperclusternumberlocatorsandserversthatyouconfiguredinthepreviousstepTheonlyexceptiontothisruleisifyouwanttodeferallocatingresourcesfortheplantoalatertimeinwhichcaseyoucansetthenumberoflocatorsandserverstozeroForexampleifyouconfiguredGemFireServicePlan1toprovideasmallGemFireclusterusingtheminimumof2locatorsand3serversbutyouwanttowantedtomake3instancesofthisplanavailableinthemarketplacethenyouwouldsetGemFirelocator(Plan1)to6instancesandGemFireserver(Plan1)to9instancesIfyouinsteadwantedtopostponeconfiguringtheplanandldquosaverdquoyourpendingchangestotheplanthensetthenumberoflocatorsandserverstozeroYoucanthenrevisittheplanconfigurationandresourceallocationatalatertimeBesuretosetvalidvaluesfortheclustersizeandresourcesunderResourceConfigbeforeyouapplyyourfinalchangestotheplan

b (Optional)ForGemFireserviceplancacheserversonlyentertheamountofCPURAM(MB)EPHEMERALDISK(MB)andPERSISTENTDISK

copyCopyrightPivotalSoftwareInc2013-2018 22 17

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

(MB)resourcestoallocateforeachserverVMbasedonyourcapacityrequirementsForproductiondeploymentsPivotalrecommendsincreasingthenumberofCPUstoatleast2Approximately1GBofconfiguredRAMisreservedfortheVMoperatingsystemallRAMabovethisamountisallocatedtotheJVMthatrunstheGemFireserverNoteTheresourcesallocationsforGemFirelocatorsandotherservicecomponentsareautomaticallyconfiguredtotheirrecommendedsettingsandtheycannotbechanged

6 ClickSave

7 ClicktheInstallationDashboardlinkTheInstallationDashboardscreendisplays

8 ClickApplyChanges

PivotalCloudFoundryOpsManagerdeploysasinglevirtualmachinetoruntheGemFireServiceBrokerpreallocatesalladditionalVMsrequiredforthethreeGemFireServiceplanclustersYoucanaccessinformationaboutthedeploymentsfromthePivotalCloudFoundryOpsManagerconsole

AftertheGemFireclusterserviceinstancesaredeployedtheGemFireServiceBrokerautomaticallyregisterstheserviceanditsserviceplansintheElasticRuntimeMarketplacePivotalCloudFoundryuserscannowcreateandbindtoinstancesoftheconfiguredserviceplansSeeUsingthePivotalGemFireServiceonPivotalCloudFoundry

DeferringServicePlanConfigurationAsmentionedintheprocedureaboveitispossibletoleaveaserviceplanunallocatedanddeferitsconfigurationandresourceallocationtoalatertimeTodothissetthenumberoflocatorsandserversfortheplantozerointheResourceConfigtab

WhenyouarereadytofinalizetheconfigurationfollowthesamestepsinCreatingGemFireServicePlanstosetanyrequiredpropertiesandallocateresourcesfortheplanintheResourceConfigtabFinallyclickApplychangesintheOpsManagertocreatetheserviceinstancesthatyouallocated

ApplicationSecurityGroupsToenableaccesstotheGemFireforPCFtileserviceyouneedtoensureyoursecuritygroupallowsaccesstotheGemfirelocatorandserverVMsconfiguredinyourdeploymentTheIPaddressesforthesecanbeobtainedfromOpsManagerbyclickingonGemFireTileandnavigatingtoStatustabAlltheIPSarementionedunderthecolumnIPSYoushouldensurethefollowingTCPportsareenabledfortheIPaddresses70714040455221MoredetailscanbefoundatApplicationSecurityGroups

protocoltcpdestinationltYOUR-GEMFIRE-LOCATORS-AND-SERVERS-IP-RANGEgtports70714040455221

WarningWerecommendupdatingyourPCFinstallationrsquosdefaultapplicationsecuritygroupasthedefaultapplicationsecuritygroupinPivotalCloudFoundryallowsallegresstraffic

Defaultapplicationsecuritygroup

[destination0000-169254169253protocolalldestination169254169255-255255255255protocolall]

AdditionalapplicationsecuritygrouprulesmaybenecessarytotoensureotherPCFservicescontinuetofunctioncorrectly

copyCopyrightPivotalSoftwareInc2013-2018 23 17

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

copyCopyrightPivotalSoftwareInc2013-2018 24 17

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

UsingGemFireforPivotalCloudFoundryAsyouwouldexpectwithanydataserviceonPivotalCloudFoundry (PCF)theGemFireservicesimplifiesthedeploymentandconfigurationofsoftwarethatsupportsyourapplicationsWhenyoucreateaGemFireserviceinstanceyouareinstantlyprovidedwithadedicatedclusterofGemFiremembersruningondedicatedVMsthatuseJVMandGemFiresettingsautomaticallytunedformostusecasesYoucanthenconfiguretheclusterbasedonyourapplicationneedsForexampleyoumightwanttouseanexistingGemFireconfigurationfromaGemFiredevelopmentenvironmentonyourlaptopInthatcaseyoucanexporttheclusterconfigurationusingGemFirersquos gfshexportcluster-configuration anduploadittoaGemFireserviceinstanceinyourPCFenvironmentusingtheGemFireserviceCLIforPCFGemFireCLIisprovidedasaCFCLIpluginthatincludescommandsforrestartingandconfiguringGemFireserviceinstancesaswellasdownloadingGemFireconfigurationandlogsonaperclusterbasis

CreatingaGemFireServiceInstance

ConfiguringaGemFireServiceInstance

WorkingwithaGemFireServiceInstance

AccessingGemFireServiceConnectionInformation(Binding)

DeployingApplicationsforUsewiththeGemFireService

BindinganApplicationtotheGemFireService

PushingorRestagingApplicationsAfterServiceChanges

ViewingBindingMetaDataandEnvironmentVariables

UnbindinganApplicationfromtheGemFireService

DeletingaGemFireServiceInstance

ConfiguringMulti-site(WAN)Connections

CreatingaGemFireServiceInstanceThefollowingproceduredescribeshowtocreateaGemFireserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment

1 IfyouhavenotdonesoalreadyinstallthePivotalCloudFoundryCommandLineInterfaceSeeInstallingthePCFCLI Installationbinariesareavailablehere

2 LogintoPCFusingthePCFCLI$cflogin

3 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttocreatetheservice$cftarget-altapi-endpointgt-oltorganizationgt-sltspacenamegt

4 Runthefollowingcommandtoviewtheavailableserviceplans$cfmarketplace

Getting services from marketplace in org staging space staging as adminOKservice plans descriptionp-gemfire GemFireServicePlan1 Dedicated GemFire instanceTIP Use cf marketplace -s SERVICE to view descriptions of individual plans of agiven service

5 Typethefollowingcommandtocreatetheserviceplan$cfcreate-serviceGemFireServicePlan1ltservice-plan-namegtltservice-instance-namegt

whereisthenameoftheServicePlanyouseeinthemarketplacendashinthisexampleldquoGemFireServicePlan1rdquondashandisadescriptivenamethatyouwanttousefortheserviceForexample

$ cf create-service p-gemfire GemFireServicePlan1 my-gemfire-testCreating service my-gemfire-test in org staging space staging as adminOK

copyCopyrightPivotalSoftwareInc2013-2018 25 17

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

ConfiguringaGemFireServiceInstanceToconfigureaGemFireserviceinstance(cluster)withyourcacheconfigurationandgemfirepropertiesyouwillneedtousetheGemFireserviceCFCLIpluginIfyouhavenotinstalledthepluginyetfollowtheinstructionsforinstallationdescribedinUsingtheGemFireforCloudFoundryCLIPlug-in

ApplyingaclusterconfigurationinvolvesuploadingtheconfigurationzipfiletotheclusterandrestartingtheclusterTheconfigurationzipfileisintheformatusedbytheGemFiregfshcommandsforexportingandimportingclusterconfigurations(seeExportingandImportingClusterConfigurations inthePivotalGemFiredocumentation)ThatallowsforaclusterconfigurationtobeexportedfromanexistingdeploymentandusedforaGemFireserviceinstanceonPCFAlternativelyaclusterconfigurationzipfilecanbecreatedmanuallyfromanexistingGemFirecachexmlconfigurationGemFirepropertiesandanyaccompanyingimplementationandtheirdependencyjarsasfollows

Createadirectorycalled cluster

Copyyourcachexmlconfigurationfileintothedirectoryandrenameitto clusterxml

Ifthereareanygemfirepropertiesthatshouldbesetontheclustercopyyourgemfirepropertiesfileintothedirectoryandrenameittoclusterproperties

Ifthereareanyimplementationjarsandtheirdependencyjarsthatshouldbedeployedtotheservers

copytheimplementationjarsinto cluster directorycopyanydependencyjarsintoadirectorycalled lib under cluster directory

Createazipfilefrom cluster directory

Thefollowingexampleshowsthecontentsofaconfigurationzipfile

$unzip-tcluster_configzipArchivecluster_configziptestingclusterOKtestingclusterclusterpropertiesOKtestingclusterclusterxmlOKtestingclustermyCallbacksjarOKtestingclusterlibOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_configzip

Inthisexample myCallbacksjar containstheimplementationofthecallbacksreferencedinthecacheconfiguration clusterxml andthelibdirectorycontainsthejarsthatmyCalllbacksjardependson

Uploadandapplyyourconfigurationusing cfrestart-gemfire commandwith --cluster-config optionForexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzipBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

Intheaboveexampleaclusterconfigurationcontainedin cluster_configzip fileinthecurrentdirectoryisuploadedtotheserviceinstancemy-gemfire-cluster andappliedtoituponrestartingtheserviceinstance(applyingaclusterconfigurationrequiresthatalltheserversintheclusterberestarted)

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringaServiceInstanceUsingaSpringApplicationContextXMLIfyouuseSpringyoucanconfigureyourGemFireserviceinstancesusingaSpringApplicationContextXMLfileinsteadofGemFirecacheXMLconfigurationTousethisapproachyoumustincludeaSpringapplicationcontextXMLfileinajarthatisprovisionedinyourconfigurationzipfileundera lib subdirectoryofa cluster directoryInadditionyoumustplaceallimplementationanddependencyjarsinthe clusterlib directoryoftheconfigurationzipfileThefollowingaredetailedstepsforcreatingaSpringconfigurationzipfile

1 Createadirectorycalled cluster thenasubdirectoryunderitcalled lib

2 PlaceyourSpringapplicationcontextXMLfileinanimplementationjarandnotethefullclasspathtotheXMLfileasitappearsintheJARYouwillneedtoreferencethispathlaterinthe cf restart-gemfire command

copyCopyrightPivotalSoftwareInc2013-2018 26 17

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

3 CopyalloftheimplementationanddependencyJARsthatshouldbedeployedtotheserverstothe clusterlib directory

4 Createazipfileofthe cluster directory

Forexamplethefollowingcommandshowsthesamplecontentsofaconfigurationzipfile

$unzip-tcluster_spring_configzipArchivecluster_spring_configziptestingclusterOKtestingclusterlibOKtestingclusterlibmyImplementationjarOKtestingclusterlibmyDependency1jarOKtestingclusterlibmyDependency2jarOKNoerrorsdetectedincompresseddataofcluster_spring_configzip

IntheaboveexampleaSpringXMLfilecouldbeplacedinanyoftheJARfilesunderthe clusterlib directoryTheconfigurationwouldthenbeuploadedandappliedtoaserviceinstanceusingthe cfrestart-gemfire commandwith --cluster-config and --spring-xml optionsForexample

cfrestart-gemfiremy-gemfire-cluster--cluster-configcluster_spring_configzip--spring-xmlcommyCompanymyAppmyAppContextxmlBrokerHTTPUsernamegtBrokerHTTPPasswordgtClustersuccessfullyrestarted

Intheaboveexampletheclusterconfigurationfile cluster_spring_configzip isuploadedtothe my-gemfire-cluster serviceinstanceandthenappliedafterrestartingtheserviceinstanceThe --spring-xml optionreferencestheclasspathtoaSpringXMLconfigurationfileisincludedinoneoftheJARfilesincluster_spring_configzip

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

ConfiguringJVMandGemFirePropertiesTheGemFireclusterconfigurationlackstheabilitytosetanyJVMorGemFireimmutableproperties(thepropertiesthathavetobeprovidedattheJVMstartup)Thosepropertiescanbesetusinganoptional --properties argumentthattakesayamlfilecontainingoptionalJVMandGemFirepropertiesforlocatorsandserversForexample

$ cat propertiesymlproperties server jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m - -DgemfireOSProcessENABLE_OUTPUT_REDIRECTION=true gemfire statistic-sample-rate 3000 locator jvmargs - -XXPermSize=96m - -XXMaxPermSize=96m gemfire statistic-sample-rate 2000

Thesettingsprovidedinthiswaywillaugmenttheexisting(default)settingsThisallowsforthevaluesoftheexistingpropertiestobemodifiedandnewonestobeappliedThefollowingcommandforexample

$ cf restart-gemfire my-gemfire-cluster --cluster-config cluster_configzip --properties propertiesymlBroker HTTP UsernamegtBroker HTTP PasswordgtCluster successfully restarted

appliesthepropertiesfrom propertiesyml shownabovetotheserversandlocatorsinthecluster my-gemfire-cluster andtheclusterconfigurationprovidedin cluster_configzip FormoreinformationaboutalltheavailableCLIcommandsseeUsingtheGemFireforCloudFoundryCLIPlug-in

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

copyCopyrightPivotalSoftwareInc2013-2018 27 17

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

CloudDeploymentConsiderationsCertainGemFireconfigurationsettingsareaffectedbythecloudnatureofserviceinstancedeploymentsNotableexamplesareanyGemFirepropertiesthattakeanIPaddressorhostnameforvalueSuchpropertiesshouldnotbeusedAlsodiskdirectoriesforGemFireoverflowandpersistencediskstoresarenotsupportedDiskstoresmustbeconfiguredwithoutdiskdirectoriesAsaresultdiskstoresarecreatedintheworkingdirectory

NetworkPartitionDetectionAsofv1500theGemFireforPCFserviceshipswiththe enable-network-partition-detection propertyenabled

Thisbuilt-infunctionalityofGemFirehelpsdetectandresolveproblemsthatresultfromadversenetworkeventsWithoutthisfunctionalityyouruntheriskofenteringasplit-brainsituationwhereGemFirelocatorsandserverscannotcommunicatewiththerestoftheclusterleadingtodowntimeanddataloss

Sincethe enable-network-partition-detection propertycanonlybeenabledordisabledacrosstheentireclusteratoncetheclustermustbebroughtdowntogetherHenceupgradesfromanearlierversiontov1500cannothappeninarollingfashionFurtherinstructionscanbefoundinourreleasenotes

PleaserefertothePivotalGemFiredocumentation formoreinformationonNetworkPartitioning

WorkingwithaGemFireServiceInstanceFortheadministrationconfigurationandmonitoringofGemFireserviceinstancesthefollowingtoolsareavailable

GemFirePulse providesagraphicaldashboardformonitoringvitalreal-timehealthandperformanceofGemFireclustersmembersandregionsUsePulsetoexaminetotalmemoryCPUanddiskspaceusedbymembersuptimestatisticsclientconnectionsWANconnectionsandcriticalnotifications

GemFireservicepluginforCFCLIprovidesCLIcommandsforconfiguringandrestartingGemFireclustersaswellasaccessingtheGemFirelogsandstatistics

GemFiregfsh providesremoteaccesstoGemFireclustersandmanymanagementmonitoringandconfigurationfeatures

AccessingaClusterviaPulse

EachGemFireserviceinstance(cluster)hasitsownPulseinstancewhichcanbeaccessedviaaManagelinklocatedundertheserviceinstanceintheDeveloperConsole

RestartingaCluster

AGemFireclusterisrestartedusingtheGemFireCLIcommand cfrestart-gemfire Thiscommandhasmultipleoptions(useitwith -h toseeallofthem)thatcanbeusedinanycombinationtoaccomplishdesiredtasksduringarestart

ThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingGemFireLogsandStatisticsandClusterConfiguration

GemFirelogsandstatisticsfilesforaclustercanbedownloadedusingtheGemFireCLIcommand cfexport-gemfire Forexample

$ cf export-gemfire cluster1 --logs cluster1_logszipBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote logs and stats to `cluster1_logszip`

cluster1 isthenameoftheclustertogetthelogsfrom

copyCopyrightPivotalSoftwareInc2013-2018 28 17

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

cfexport-gemfire isusedtoaccesstheclusterconfigurationaswellForexample

$ cf export-gemfire demo1 --cluster-config demo1_configzip --properties demo1_propsyamlBroker HTTP UsernamegtBroker HTTP PasswordgtSuccessfully wrote cluster config to `demo1_configzip`Successfully wrote cluster properties to `demo1_propsyaml`

Inthisexample cfexport-gemfire isusedtodownloadtheclusterconfigurationtothefilenamed demo1_configzip andpropertiestothefilenameddemo1_propsyaml fortheclusternamed demo1

NotethattheGemFirelogfilesalsoincludethefullconfiguration

SeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPassword

AccessingaClusterviagfsh

GemFireclusterscanbeaccessedvia gfsh fromanymachinewithintheCloudFoundrynetwork

FirstidentifythelocatorIPaddressofyourclusterwithaservicekey

$cfcreate-service-keydemo1my-service-keyCreatingservicekeymy-service-keyforserviceinstancedemo1asadminOK$cfservice-keydemo1my-service-keyGettingkeymy-service-keyforserviceinstancedemo1asadminlocators[10244050[55221]10244051[55221]]passwordltCLUSTER_USERNAMEgtusernameltCLUSTER_PASSWORDgt

UsethelocatorIPaddressestoconnectwithgfshrunningonahostwithintheCloudFoundrynetwork

$gfshgfshgtconnect--locator=10244050[55221]ConnectingtoLocatorat[host=10244050port=55221]ConnectingtoManagerat[host=10244050port=1099]Successfullyconnectedto[host=10244050port=1099]

AccessingGemFireServiceConnectionInformation(Binding)AfteryoudeployaJavaBuildpackapplicationandbindittoaGemFireforPivotalCloudFoundryserviceinstanceyourapplicationreceivestheGemFireclusterlocatoraddressesandcredentialsintheVCAP_SERVICESenvironmentvariableIfyouhaveenabledtheGemFireRESTAPIthentheRESTURLisalsoprovidedasmetadatainVCAP_SERVICES

VCAP_SERVICESprovidesdataasaJSONdocumentsoyoucanuseavarietyoftechniquestoaccesstherelevantconnectioninformationSeeViewingBindingMetaDataforanexampleofthedataprovidedinVCAP_SERVICES

NoteGemFireforPivotalCloudFoundryonlysupportsdeployingGemFireclientapplicationsYoucannotdeployanapplicationthatparticipatesintheboundGemFireclusterasapeermember

UsingaJSONLibrarytoAcquireConnectionInformationBecauseVCAP_SERVICESprovidesaJSONdocumentyoucanalsouseaJavaJSONlibrarytoparsethedataforconnectioninformationThisexamplecodeusesthe Jackson librarytoparsethedocument

copyCopyrightPivotalSoftwareInc2013-2018 29 17

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

packagepivotal

importcomfasterxmljacksoncoreJsonParseExceptionimportcomfasterxmljacksondatabindJsonMappingExceptionimportcomfasterxmljacksondatabindObjectMapperimportpivotalGemFireClientLocator

importjavaioIOExceptionimportjavautilArrayListimportjavautilListimportjavautilMap

publicclassEnvParser

privatestaticEnvParserinstance

privateEnvParser()

publicstaticEnvParsergetInstance()if(instance=null)returninstancesynchronized(EnvParserclass)if(instance==null)instance=newEnvParser()returninstance

publicListltLocatorgtgetLocators()throwsJsonParseExceptionJsonMappingExceptionIOExceptionListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()Mapcredentials=getCredentials()ListltStringgtlocators=(ListltStringgt)credentialsget(locators)for(Stringlocatorlocators)StringlocatorIP=locatorsubstring(0locatorindexOf([))StringportString=locatorsubstring(locatorindexOf([)+1locatorindexOf(]))locatorListadd(newLocator(locatorIPIntegerparseInt(portString)))returnlocatorList

publicStringgetUsername()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringusername=nullMapcredentials=getCredentials()username=(String)credentialsget(username)returnusername

publicStringgetPasssword()throwsJsonParseExceptionJsonMappingExceptionIOExceptionStringpassword=nullMapcredentials=getCredentials()password=(String)credentialsget(password)returnpassword

privateMapgetCredentials()throwsJsonParseExceptionJsonMappingExceptionIOExceptionMapcredentials=nullStringenvContent=Systemgetenv()get(VCAP_SERVICES)ListltLocatorgtlocatorList=newArrayListltGemFireClientLocatorgt()ObjectMapperobjectMapper=newObjectMapper()Mapservices=objectMapperreadValue(envContentMapclass)ListgemfireService=getGemFireService(services)if(gemfireService=null)MapserviceInstance=(Map)gemfireServiceget(0)credentials=(Map)serviceInstanceget(credentials)returncredentials

privateListgetGemFireService(Mapservices)return(List)servicesget(p-gemfire)

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

copyCopyrightPivotalSoftwareInc2013-2018 30 17

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

packagepivotal

importcomgemstonegemfireLogWriterimportcomgemstonegemfiredistributedDistributedMemberimportcomgemstonegemfiresecurityAuthInitializeimportcomgemstonegemfiresecurityAuthenticationFailedException

importjavaioIOExceptionimportjavautilProperties

publicclassClientAuthInitializeimplementsAuthInitialize

privateEnvParserenv=EnvParsergetInstance()

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()tryStringusername=envgetUsername()Stringpassword=envgetPasssword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)catch(IOExceptione)thrownewAuthenticationFailedException(Exceptionreadingusernamepasswordfromenvvariablese)returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

TheauthenticatedapplicationcanthencreateaGemFireClientCache asfollows

Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)tryListltURIgtlocatorList=EnvParsergetInstance()getLocators()for(URIlocatorlocatorList)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCacheclient=ccfcreate()catch(IOExceptione)handle

Usingspring-cloudtoAcquireConnectionInformationAsanalternativetouseaJavaJSONlibraryyoucanuse spring-cloud withtheSpringCloudGemFireConnector toparsetheJSONdataNotethatthismethoddoesnotrequireyourapplicationtobeaSpringprojectortohave spring-core asadependencyYouonlyneedtospecify spring-cloud andspring-cloud-gemfire-cloudfoundry-connector asdependenciesasshowninthisexerpt

copyCopyrightPivotalSoftwareInc2013-2018 31 17

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

ltdependencygtltgroupIdgtcomgemstonegemfireltgroupIdgtltartifactIdgtgemfireltartifactIdgtltversiongt810ltversiongtltdependencygtltdependencygtltgroupIdgtiopivotalspringcloudltgroupIdgtltartifactIdgtspring-cloud-gemfire-cloudfoundry-connectorltartifactIdgtltversiongt100BUILD-SNAPSHOTltversiongtltdependencygtltdependencygtltgroupIdgtorgspringframeworkcloudltgroupIdgtltartifactIdgtspring-cloud-coreltartifactIdgtltversiongt120RC1ltversiongtltdependencygtltrepositorygtltidgtspring-milestonesltidgtlturlgthttprepospringiolibs-milestonelturlgtltrepositorygtltrepositorygtltidgtgemfire-repositoryltidgtltnamegtGemfireRepositoryltnamegtlturlgthttpdistgemstonecommavenreleaselturlgtltrepositorygt

ForanapplicationthatbindstoaGemFireservicenamed MyService youwouldthenusethe CloudFactory APItoobtainaserviceconnectionfromwhichyougetmetadatasuchastheavailablelocatorsusernameandpasswordForexample

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

URI[]locators=myServicegetLocators()StringuserName=myServicegetUsername()Stringpassword=myServicegetPassword()

ToauthenticateyourclientapplicationyoumustimplementtheGemFireAuthInitialize interfaceasshowninthisexample

publicclassClientAuthInitializeimplementsAuthInitialize

publicstaticfinalStringUSER_NAME=security-usernamepublicstaticfinalStringPASSWORD=security-password

publicGemfireServiceInfoserviceInfo

privateClientAuthInitialize()CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()serviceInfo=(GemfireServiceInfo)cloudgetServiceInfo(MyService)

publicstaticAuthInitializecreate()returnnewClientAuthInitialize()

Overridepublicvoidclose()

OverridepublicPropertiesgetCredentials(Propertiesarg0DistributedMemberarg1booleanarg2)throwsAuthenticationFailedExceptionPropertiesprops=newProperties()

Stringusername=serviceInfogetUsername()Stringpassword=serviceInfogetPassword()propsput(USER_NAMEusername)propsput(PASSWORDpassword)

returnprops

Overridepublicvoidinit(LogWriterarg0LogWriterarg1)throwsAuthenticationFailedException

copyCopyrightPivotalSoftwareInc2013-2018 32 17

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

ThecodetoinitializetheclientobtainauthorizationandfinallycreateaGemFireClientCache wouldresemble

CloudFactorycloudFactory=newCloudFactory()Cloudcloud=cloudFactorygetCloud()GemfireServiceInfomyService=(GemfireServiceInfo)cloudgetServiceInfo(MyService)Propertiesprops=newProperties()propssetProperty(security-client-auth-initpivotalClientAuthInitializecreate)ClientCacheFactoryccf=newClientCacheFactory(props)URI[]locators=myServicegetLocators()for(URIlocatorlocators)ccfaddPoolLocator(locatorgetHost()locatorgetPort())ClientCachecache=ccfcreate()

AcquiringaConnectionfromaSpringApplicationIfyouaredevelopingaSpringApplicationthenacquiringGemFireserviceconnectioninformationisasimpletwo-stepprocess

1 ConfigureGemFire spring-cloud and spring-cloud-gemfire-cloudfoundry-connector asdependenciesinyourproject

dependenciescompile(comgemstonegemfiregemfire810)compile(iopivotalspringcloudspring-cloud-gemfire-spring-connector100BUILD-SNAPSHOT)compile(iopivotalspringcloudspring-cloud-gemfire-cloudfoundry-connector100BUILD-SNAPSHOT)

2 Inyourapplicationauto-wiretheGemFireClientCache

ConfigurationServiceScanRestControllerpublicclassMyController

AutowiredClientCachecache

ConfiguringaJavaRESTClienttoAccessaServiceInstanceviaHTTPSTosupportJavaclientapplicationsaccessingaserviceinstanceRESTAPIendpointviaHTTPSyoumustmodifytheJavaBuildpacktoprovisionsecurityartifactsYouwillneedtoobtainthecorrectSSLcertificatefromyourCloudFoundryHAProxycredentialsandimportitintotheJREtruststoreoftheJavaBuildpackImportingthecertificatethenmakesitavailabletoyourJavaapplications

YouconfiguretheJREwithadditionalresourcesbyaddingtheresourcefilestotheappropriatelocationunderthe resources directoryofthebuildpackForSSLcertificatesthatshouldbeaddedtotheOpenJDKJREtruststorethecorrectlocationis resourcesopen_jdk_jrelibsecurity underthebuildpackrootToaddcustomSSLcertificatesaddyourcacertsfileto resourcesopen_jdk_jrelibsecuritycacerts ThisfileisoverlayedontotheOpenJDKdistributionTheexactproceduretofollowis

1 GettheSSLcertificatefromyourPCFOpsManagerbygoingtotheCredentialstabinElasticRuntimeandcopyingtheSSLRSAcertificatefromtheHAProxysectionSavethecertificatetoanewfile(forexample myCertcert )

2 Importthesavedcertificatefiletoyourtruststore

3 Clonethejavabuild-pack

4 CopyyourtruststorefromStep2aboveinto resourcesopen_jdk_jrelibsecuritycacerts underyourbuildpackrootdirectory

5 RebuildyourJavaBuildpackThisexampleusesofflinemode

$cd~projectsjava-buildpack$bundleinstall$bundleexecrakepackageOFFLINE=true

6 UploadthebuildpackForexample

copyCopyrightPivotalSoftwareInc2013-2018 33 17

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

$cfcreate-buildpacksecure-java-buildpackbuildjava-buildpack-offline-ltshagtzip1

7 MakesureclientapplicationsuseHTTPSwhenformingtheRESTAPIendpointURL

8 UsethenewbuildpackwhenpushingyourclientapplicationsForexample

$cfpush-fappyml-t30-bsecure-java-buildpack

DeployingApplicationsforUsewiththeGemFireServiceThissectionprovidestipsonpushingyourapplicationtothePivotalCloudFoundryElasticRuntimeenvironmentforusewiththeGemFireserviceSomeoftheapplicationdeploymentstepsmaydifferdependingonwhatkindofapplicationyouaredeploying

Re-deployingyourapplicationdoesnotaffectdatastoredinanyexistingserviceinstancesboundtotheapplication

SeeDeployanApplication inthePivotalCloudFoundryDocumentationfordetailedinformationonpushingCFapplications

UsingtheJavaBuildpackImportantPivotalrecommendsthatyouusethelatestJavaBuildpackwhenpushingyourapplicationsSpecifythelocationofthebuildpackusingthe-b parameter

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit

Toavoidhavingtorestageyourapplicationafterbindingtheserviceyoucanpushtheapplicationinitiallywiththe --no-start command

$cfpushltyour-app-namegt-pltlocation-of-your-app-filegt-bhttpsgithubcomcloudfoundryjava-buildpackgit--no-start

BindinganApplicationtotheGemFireServiceThefollowingproceduresdescribehowtobindaGemFireserviceinstancetoyourPivotalCloudFoundryapplication

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleftThisshouldbethesameOrgwhereyoucreatedtheserviceinstance

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouwishtobindtotheserviceApagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication

5 ClickBindAlistofavailableservicesdisplays

6 ClicktheBindbuttonfortheGemFireserviceyouwanttobindtothisapplication

7 UsingthePivotalCloudFoundryCLIstartorrestageyourapplicationSeePushingorRestagingApplicationsAfterChanges

CLIInstructions

copyCopyrightPivotalSoftwareInc2013-2018 34 17

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

AlternatelyviatheCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 Runthefollowingcommandtotargetthespecificorgandspacewhereyouwanttocreatetheserviceplan$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommandtoviewrunningserviceinstances$cfservices

Getting services in org staging space staging as adminOKname service plan bound appsmy-gemfire-test gemfire GemFireSmallPlan

4 Runthefollowingcommandtobindtheapplicationtotheserviceinstance$cfbind-serviceltapplicationgtltservice-instance-namegt

Forexample

$ cf bind-service gfe-app my-gemfire-testBinding service my-gemfire-test to app gfe-appin org staging space staging as adminOKTIP Use cf restage to ensure your env variable changes take effect

5 Restageyourapplication$cfrestageltapplicationgt

PushingorRestagingApplicationsAfterServiceChangesToensurethatyourapplicationpicksupthecorrectenvironmentvariablesyoumustrestageorre-pushyourapplicationsafterbindingthemtotheGemFireserviceThiscancurrentlybedoneusingtheCLIInadditionifyoumakeanyotherchangestotheGemFireServicewhileitisboundtoyourapplication(forexampleaddmodifyordeletetheservice)youwillneedtore-pushorrestageyourapplicationafterwards

Pushingorre-stagingyourapplicationdoesnotaffectdatastoredintheexistingserviceinstance

Torestageorre-pushyourapplicationusingthePivotalCloudFoundryCLI

1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI$cflogin

2 RunthefollowingcommandtotargettheAPIendpointorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-altapi-endpointgt-oltorganizationgt-sltspace_namegt

3 Pushorrestageyourexistingapplication$cfpushltapplicationgt-pltlocation-of-your-app-filegt-bltbuildpack-locationgt

or$cfrestageltapplicationgt

Alternatelyifyoupushedyourapplicationwithoutstartingityoucanstartyourapplicationnowtopickupthenewlyboundservice$cfstartltapplicationgt

FormoredetailsondeployingapplicationsseeDeployanApplication inthePivotalCloudFoundrydocumentation

ViewingBindingMetaDataToviewthebindingvariablesusethefollowingprocedures

copyCopyrightPivotalSoftwareInc2013-2018 35 17

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

PCFDeveloperConsoleInstructions1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireservice

5 ClickontheEnvVariablestabTheenvironmentvariablesfortheservicebindingdisplay

AlternatelyyoucanalsoviewcredentialsusedbytheservicewhenbindingtotheapplicationbyclickingontheServicestabandclickingShowcredentialsServicecredentialsandlocatoraddressinformationdisplays

CLIInstructionsToviewthebindingvariablesintheCLItypethefollowingcommandafteryouhaveboundyourapplicationtotheGemFireservice

$cfenvltapplication-namegt

Ifsuccessfulyoushouldseesimilartothefollowinginthereturnedoutput

Getting env variables for app in org space as OKSystem-Provided VCAP_SERVICES p-gemfire [ credentials locators [ 100055[55221] 100056[55221] ] password 15587128842615488747 rest_url username dacaf950-1633-4741-7dc5-eb11ce5f33e2 label p-gemfire name MyService plan GemFireServicePlan1

copyCopyrightPivotalSoftwareInc2013-2018 36 17

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

tags [ gemfire ] ] No user-defined env variables have been setNo running env variables have been setNo staging env variables have been set

UnbindinganApplicationfromtheGemFireServiceWhenyoucreateaGemFireserviceinstancetheGemFireServiceBrokerallocatesaspecificclusterofGemFirelocatorsandserversYoucanbindunbindandthebindagaintothatparticularserviceinstanceasoftenasyouwantTheserviceinstancealwaysusesthesameclusterandtheServiceBrokerdoesnotdoanythingtothedatainthatserviceinstance

PCFDeveloperConsoleInstructionsTounbindtheapplicationfromtheGemFireservice

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 SelectthespacewhereyourGemFireserviceinstanceandboundapplicationhavebeendeployed

4 SelecttheapplicationthatyouhaveboundtotheGemFireserviceApagedisplaysthatshowtheboundservicesandinstancesforthisapplication

5 LocatetheboundserviceinstanceyouwanttounbindandclickUnbind

6 AconfirmationdialogboxdisplaysClickUnbindagain

7 Ifsuccessfulthefollowingmessagewillappearatthetopofthescreen

copyCopyrightPivotalSoftwareInc2013-2018 37 17

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

ServicesuccessfullyunboundfromtheapplicationTIPUselsquocfpushrsquotoensureyourenvvariablechangestakeeffect

8 UsethePivotalCloudFoundryCLItopushorrestageyourapplicationforthechangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfunbind-serviceltapplicationgtltservice-instance-namegt

whereisthenameoftheGemFireinstanceyouareunbindingfromthespecifiedForexample

$ cf unbind-service gfe-app my-gemfire-testUnbinding app gfe-app from service my-gemfire-test in org staging spacestaging as adminOK

4 Restageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

DeletingaGemFireServiceInstanceWhenyoudeleteaGemFireserviceinstanceallapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceisclearedInadditiontheallocatedserviceinstance(GemFirecluster)isreturnedtothepoolofavailableclustersandthoselocatorsandcacheserversarenowavailabletofutureapplications

PCFDeveloperConsoleInstructionsTodeleteaserviceinstanceusingthePivotalCloudFoundryDeveloperConsole

1 LogintothePivotalCloudFoundryDeveloperConsole

2 SelectyourOrgfromthedrop-downlistontheleft

3 LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

CLIInstructions1 LogintoyourPivotalCloudFoundryenvironmentusingthePivotalCloudFoundryCLI

$cflogin

2 RunthefollowingcommandtotargettheorgandspacewhereyouwanttopushorrestagetheapplicationForexample$cftarget-oltorganizationgt-sltspace_namegt

3 Runthefollowingcommand$cfdelete-serviceltservice-instance-namegt

whereisthenameoftheGemFireserviceyouaredeletingEnterlsquoyrsquowhenpromptedForexample

$ cf delete-service my-gemfire-testReally delete the service my-gemfire-testgt yDeleting service my-gemfire-test in org staging space staging as admin

copyCopyrightPivotalSoftwareInc2013-2018 38 17

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

OK

4 Ifyouhadapplicationsthatwereboundtothisserviceyoumayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffectSeePushingorRestagingApplicationsAfterChanges

ConfiguringMulti-site(WAN)ConnectionsBetweenTwoorMoreGemFireServiceInstancesYoucanconfigureGemFireserviceinstancesformulti-site(WAN)communicationForinformationaboutGemFiremulti-sitereplicationcapabilitiesseeMulti-site(WAN)Configuration intheGemFireUserrsquosGuide

Akeyprerequisiteformulti-sitereplicationisnetworkconnectivitybetweentheGemFireinstancestobeconfiguredformulti-siteconnectionsGemFirenodesontheoppositesidesofamulti-site(WAN)linkmustbeabletoestablishdirectconnectionstoeachother

TheGemFireserviceforPCFprovidesfunctionalitythatmakestheWANconfigurationprocesseasierforGemFireclustersinPCFTheserviceprovidessupportforconfiguringserviceinstancessothattheydiscovereachotherandestablishWANconnectionsYoumuststillcreateWANsendersandreceiversandconfiguredataregionsformulti-sitereplication

ThestepstoenableWANconnectionsbetweentwoGemFireserviceinstancesareasfollows

1 ForeachserviceinstanceobtaintheWANconfigurationURLusingthecommand

cfshow-wan-config-urlltservice_instancegt

2 WhenyoucreatetheclusterconfigurationforeachserviceinstanceconfiguretheWANsendersandreceiversanddataregionsthatshouldbereplicatedovertheWAN

3 SettheGemFireproperty distributed-system-id toauniqueintegervalueinthepropertiesymlfileforeachserviceinstance(seetheprevioussectionformoreinformationaboutconfiguringGemFirepropertiesforaserviceinstance)

4 RestarteachserviceinstancewiththeWANconfigurationURLsfortheotherinstancespassedasargumenttothe --enable-wan optionofthe cfrestart-gemfire commandForexample

cfrestart-gemfireltservice_instance_Agt--cluster-configltcluster_A_config_zipgt--propertiesltproperties_cluster_A_ymlgt--enable-wanltcluster_B_WAN_config_URLgt

TheabovecommandrestartsthelocatorsinadditiontotheserversThiscommandalsorequirestheBrokerHTTPUsernameandPasswordSeethesectiononBrokerCredentialsonhowtoobtaintheBrokerHTTPUsernameandPasswordAfterrestartingtheclustersareenabledforWANcommunicationtoeachother

copyCopyrightPivotalSoftwareInc2013-2018 39 17

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

UsingtheGemFireforCloudFoundryCLIPlug-in

InstallationFollowthisproceduretoinstalltheGemFireCLIplug-in

1 Downloadtheplug-inbinaryfromPivotalNetwork

2 EnableexecutepermissionsonthedownloadedfileForexample

$chmoda+xcf-gemfire-cli-darwin-amd64

3 Installtheplug-inbinary

$cfinstall-plugincf-gemfire-cli-darwin-amd64-120

Installingplugincf-gemfire-cli-darwin-amd64-120OKPluginGemFirev120successfullyinstalled

4 (Optional)Usethe cfplugins commandtoverifythatyouhavesuccessfullyinstalledtheGemFireplugin

$cfpluginsListingInstalledPluginsOK

PluginNameVersionCommandNameCommandHelpGemFire120gemfireGemFireplugincommandshelptextGemFire120restart-gemfireRestartGemFirecacheservers(Alsousedforapplyingconfigurationchanges)GemFire120export-gemfireRetrieveGemFireartifactssuchaslogsandstatsGemFire120show-wan-config-urlDisplaytheWANconfigurationURLfortheserviceinstance

SeeUsingcfCLIPlugins inthePivotalCloudFoundry (PCF)documentationforgeneralinformationaboutinstallinguninstallingorlistingavailableCloudFoundryCommandLineInterfaceplug-ins

OverviewUsethe cf

gemfirecommandtodisplaybasicusageinformationfortheplugin

$cfgemfireNAMEcf-CloudFoundryplugintointeractwithGemFireserviceinstances

USAGEcf[globaloptions]command[commandoptions][arguments]

VERSION120

AUTHOR(S)PivotalInc

COMMANDSrestart-gemfireSERVICE_INSTANCE--cluster-configCONFIGZIP|-cCONFIGZIPexport-gemfireSERVICE_INSTANCEshow-wan-config-urlSERVICE_INSTANCEhelphShowsalistofcommandsorhelpforonecommand

GLOBALOPTIONS--help-hshowhelp--version-vprinttheversion

Executeanyofthecommandswiththe -h argumenttodisplayusageinformationForexample

copyCopyrightPivotalSoftwareInc2013-2018 40 17

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

$cfexport-gemfire-hNAMEexport-gemfire-RetrieveGemFireartifactssuchaslogsandstats

USAGEcfexport-gemfireSERVICE_INSTANCE[commandoptions]

DESCRIPTIONRetrieveartifactsfromagivenserviceinstance(cluster)

OPTIONS--logs-lpathfordownloadedlogfilearchive--cluster-config-cpathfordownloadedclusterconfiguration--properties-ppathfordownloadedclusterproperties

BrokerHTTPUsernameandPasswordThefollowingcommandsrequireadditionalauthentication

export-gemfire

restart-gemfire

TheBrokerusernameandpasswordcanbefoundonyourPCFOpsManagerontheGemfireforPCFTileSeetheCredentialstabUnderthenameGemfireBrokerCredentialstheywillbeintheformof usernamepassword Thesecredentialswillberequiredwhenrunningthecommands export-gemfire amprestart-gemfire byacommandlineprompt

Optionallythesecommandscanberunnon-interactivelybyusingtheflags --broker-username or -U and --broker-password or -P

export-gemfirecfexport-gemfire enablesyoutoexportartifactsfromagivenserviceinstancesuchastheGemFirelogsandstatisticsandtheclusterconfigurationandpropertiesTheclusterconfigurationandpropertiesexportedinthiswaycanbeappliedtoanotherserviceinstanceusingthe restart-gemfire command

The cfexport-gemfire--cluster-config

commanddownloadstheconfigurationintheformatprovidedbytheGemFireClusterConfigurationserviceSee

OverviewoftheClusterConfigurationService inthePivotalGemFiredocumentationformoreinformation

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

Usage

cfexport-gemfireSERVICE_INSTANCE[commandoptions]

Optionalargumentsinclude

--logs PATH mdashDownloadstheGemFirelogsandstatisticsfilesfortheclustertothepathandzipfilegivenbyPATH

--cluster-config PATH mdashDownloadstheGemFireclusterconfigurationtothepathandzipfilegivenbyPATH

--properties PATH mdashDownloadstheclusterpropertiesyamlfiletothepathandyamlfilegivenbyPATH

Example

cfexport-gemfireclusterA--logsclusterA_logszip--propertiesclusterA_propsyml--cluster-configclusterA_configzip

restart-gemfirecfrestart-gemfire enablesyoutorestartaGemFireclusterandperformanumberofclustertasksthateitherrequireaclusterrestart(suchasapplyingaclustercacheconfiguration)orthatareconvenienttoperformduringarestart(suchasclearingoutlogfiles)Thecommandallowsforldquodaisy-chainingrdquo

copyCopyrightPivotalSoftwareInc2013-2018 41 17

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

optionssoyoucanperformmultipletaskswithasinglerestartForexampleyoucanuseasingleapplicationofthiscommandtoapplyanewclusterconfigurationclearthelogfilesandenabletheRESTAPI

NoteUsing --reset-defaults with --cluster-config firstcausestheclusterconfigurationtoberestoredtotheoriginalconfigurationThenewconfiguration(providedwith --cluster-config )isthenappliedBothoperationstaketakeplaceduringthesamerestart

Yoursquollbepromptedforcredentials BrokerHTTPUsername

amp BrokerHTTPPassword

whenthiscommandisinvokedPleaseseethenoteonhowtoobtainthe

credentialsTorunthiscommandnon-interactivelythebrokerusernameandpasswordcanbeprovidedwith --broker-username or -U and--broker-password or -P flags

TheonlyrequiredargumenttothiscommandisthenameofaGemFireforPivotalCloudFoundryserviceinstancethatyouhavedeployedAllotherargumentsareoptional

Usage

cfrestart-gemfireSERVICE_INSTANCE[--clear-logs][--clear-disks][--cluster-configPATH][--default-serverenable|disable][--enable-wanCOMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS][--include-locators][--spring-xmlCLASSPATH_TO_XML][--propertiesPATH][--reset-defaults][--rest-apienable|disable][--timeoutSECONDS]

Optionalargumentsinclude

--clear-logs mdashClearsalloftheGemFirelogsandstatisticsfilesforthecluster

--clear-disks mdashClearsallofthediskstoresremovingallpersisteddataCAUTIONThisoptionremovesallpersisteddatafromthecluster

--cluster-config PATH mdashUploadstheclusterconfigurationfilegivenbyPATH

--default-server=enable|disable mdashDetermineswhethertostartupthedefaultGemFirecacheserver

--enable-wan COMMA_SEPARATED_LIST_OF_WAN_CONFIG_URLS mdashEnablesaGemFireWANreplicationchanneltoeachoftheserviceinstancesidentifiedbytheWANconfigurationURLsyouprovideYoucanobtaintheWANconfigurationURLsbyinvoking cf show-wan-config-url oneachoftheserviceinstancestowhichyouwanttoenableaWANconnectionThenprovidetheconfigurationURLsascommaseparatedargumentlistSettingthisoptionrestartstheGemFirelocators

--include-locators mdashIncludesthelocatorsinallrequestedactionsIfyouomitthisoptionthecommandonlyappliestocacheservers

--spring-xml mdashSpecifiestheclasspathtoaSpringXMLfileinaclusterconfigurationJARThisoptionappliestheSpringXMLfileintheJARtotheclusterThisoptionmustbeusedalongwiththe --cluster-config optiontoprovisionthecontainingJARfile

--properties PATH mdashAppliesthepropertiesintheYAMLfileatthespecifiedPATHtotheGemFireclusterSeeConfiguringJVMandGemFirePropertiesinConfiguringaGemFireServiceInstanceformoreinformation

--reset-defaults mdashRestorestheoriginaldefaultconfigurationfortheclusterclearsarchivesanddiskstoresCAUTIONThisoptionremovesallpersisteddatafromthecluster

--rest-api=enable|disable mdashEnablesordisablestheGemFireRESTdeveloperAPIEnablingtheRESTAPIsetsupasinglefrontendURLforRESTconnectionsConnectionstotheURLareloadbalancedbetweenallavailableservers

--timeout SECONDS mdashProvidesthetimeoutvalueinsecondsfortherestartcommand

show-wan-config-urlcfshow-wan-config-url showstheWANconfigurationURLforthegivenserviceinstanceinHTTPAuthenticationformatwithplaceholdersforthebrokerusernameamppasswordReplacetheplaceholdersintheURLbeforepassingitasinputtothe --enable-wan optionof cfrestart-gemfire toconfigureotherserviceinstancesforWANcommunicationtothisinstance

Pleaseseethenoteonhowtoobtainthecredentialstoreplacetheplaceholders BROKER_USERNAME and BROKER_PASSWORD intheURL

Usage

cfshow-wan-config-urlSERVICE_INSTANCE

Example

$ cf show-wan-config-url instance_one=gt httpsBROKER_USERNAMEBROKER_PASSWORDgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

Change the placeholders BROKER_USERNAME and BROKER_PASSWORD in the cli output before passing it as input to `cf restart-gemfire --enable-wan`

copyCopyrightPivotalSoftwareInc2013-2018 42 17

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

$ cf restart-gemfire --enable-wan httpsmy-usernamemy-passwordgemfire-brokergf2pcf-gemfirecomadminwancredentials93f7add8-d077-4489-b16b-4905c51d3d46

copyCopyrightPivotalSoftwareInc2013-2018 43 17

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

Troubleshooting

ServiceInstallationTroubleshooting

ProblemCouldnotdeployaserviceinstanceintheElasticRuntimeIfyoutrytodeploy(andallocate)moreSessionStateCachingserviceinstancesthanareavailableasdefinedbyyourPivotalCloudFoundry (PCF)Administratoryoumayreceivethefollowingerrormessage

500ERRORYOUHAVEREACHEDTHISPAGEBECAUSEANERROROCCURREDPLEASECONTACTYOUROPERATOR

Youneedtodeleteexistingserviceinstancesorasktheadmintodeploymoreinstances

ProblemServiceplantiledoesnotshowupintheDeveloperConsoleMarketplaceVerifythattheregistererrandunderlifecycleerrandsisselectedintheOpsManagertileconfigurationscreen

ApplicationTroubleshooting

ProblemApplicationdoesnotpickupchangestotheserviceinstanceMakesureyourestage(orre-push)yourapplicationifyouhavemadeconfigurationchangestotheunderlyingserviceinstance

ServiceBrokerTroubleshootingTheServiceBrokerisresponsibleformanagingthelifecycleofserviceinstancesIfyouencounterissueswithserviceinstancemanagement(creatingdestroyingbindingunbindingetc)thebrokerlogsmaycontainsomeclues

ThelogscanbefoundonbrokerVMsat varvcapsyslogbrokerbrokerstdoutlog andareloggedinJSONformatYoucanuseautilitysuchasjq toparsetheselogsandextractinformation log_level ofeachmessageisnumber0-3correspondingtothefollowingloglevels DEBUG INFO ERROR andFATAL Herearesomeexamples(usingjq15)

DisplayallERRORlogs

jq|select(log_level==2)brokerstdout

Searchlogformessagescontainingasubstring

jq|select(message|contains(some-substring))brokerstdout

Checkoutthejqmanualformoreusagedetails

BrokerendpointsforadvancedtroubleshootingGET admincredentialslocator ip GivenanIPaddressofalocatorwillretrievethecredentialsfortheserversintheGemfirecluster

curl100161538080admincredentials10016155

copyCopyrightPivotalSoftwareInc2013-2018 44 17

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

credentials[passwordapasswordusernameausernamelocators[1001615410016155]]

GET adminwancredentialsservice instance GUID GiventheGUIDofaGemfireserviceinstancewillretrievetheWANcredentialsforthatserver

curl100161538080adminwancredentials7dd9446b-20c6-4fbc-a31f-8416fd96abbd

passwordapasswordusernameausernamelocators[10016154[55221]10016155[55221]]

GET admininstance_counts Displaysthenumberofavailableserviceinstancesassociatedwiththebroker

curl100161538080admininstance_counts

[count3statusAVAILABLE]

GET admincluster_configservice instance GUID Retrievestheclusterconfigasazipfilewhichcontainsclusterxmlandclusterproperties

curl100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38gtcluster_configzip

POST admincluster_configservice instance GUID Updatestheclusterconfigofthespecifiedserviceinstance

Options

reset-defaultsboolclear-logsboolclear-disk-storesboolcluster_configzipfile(clusterclusterxmlclusterclusterpropertiesandanycustomcodetobedeployedonGemFireserver)cluster_propertiesfileunsure

curl-v-Freset-defaults=true100161538080admincluster_config47574053-7050-4911-9277-5725b27e1e38

GET adminarchivesservice instance GUID Retrievesthelogfilesoftheclusterasazipfile

curl100161538080adminarchives47574053-7050-4911-9277-5725b27e1e38gtarchiveszip`

DELETE v2service_instancesservice instance GUID Deletesaserviceinstance

curl-v-XDELETEhttp100181518080v2service_instances608363f1-4811-480d-bd95-b2ad9833cac5

copyCopyrightPivotalSoftwareInc2013-2018 45 17

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling

UninstallingGemFireforPivotalCloudFoundryPrerequisites

Uninstalling

PrerequisitesBeforeyoudeleteyourGemFireforPivotalCloudFoundrytilepleaseensureallGemFireserviceinstanceshavebeendeletedIfyoufailtodeleteallGemFireserviceinstancesbeforedeletingthetileitmaycauseissuesifyoueverwishtore-installtheGemFiretile

TocheckifthereareanyGemFireserviceinstancespresentinyourPivotalCloudFoundrydeploymentyoucanrunthesimpleshellscriptshownbelow

usrbinenvbash

fororgin$(cforgs|awkNRgt3)docftarget-o$orggtdevnullforspacein$(cfspaces|awkNRgt3)docftarget-s$spacegtdevnullcfservices|grepp-gemfiredonedone

UninstallingSeethefollowinginstructionsforuninstalling PivotalCloudFoundrytiles

copyCopyrightPivotalSoftwareInc2013-2018 46 17

  • Table of Contents
  • Pivotal GemFire for Pivotal Cloud Foundry
    • Product Snapshot
    • Upgrading to the Latest Version
    • Documentation Index
      • Release Notes for GemFire for Pivotal Cloud Foundry
        • Overview
        • v1720
          • Release Date 30th January 2017
            • v1660
              • Release Date 30th January 2017
                • v1710
                  • Release Date 29th December 2016
                    • v1650
                      • Release Date 29th December 2016
                        • v1640
                          • Release Date 11th November 2016
                            • v1630
                              • Release Date 28th October 2016
                                • v1700
                                  • Release Date 19th September 2016
                                    • v162
                                      • Release Date 28th July 2016
                                        • v161
                                          • Release Date 22nd July 2016
                                            • v1600
                                              • Release Date 31st May 2016
                                                • v1500
                                                  • Release Date 9th May 2016
                                                    • v1400
                                                      • Release Date 4th April 2016
                                                        • v1300
                                                          • Release Date 18th March 2016
                                                            • v1230
                                                              • Release Date 4th February 2016
                                                                • v1220
                                                                  • Release Date 22nd January 2016
                                                                    • v1210
                                                                      • Release Date 12th January 2016
                                                                        • v1200
                                                                          • Release Date 1st December 2015
                                                                            • v1110
                                                                              • Release Date 5th November 2015
                                                                                • v1100
                                                                                  • Release Date 22nd September 2015
                                                                                    • v1000
                                                                                      • Release Date 10 August 2015
                                                                                          • Overview
                                                                                            • How Does the Service Work
                                                                                              • PCF Administrator Workflow
                                                                                              • PCF Developer (Service User) Workflow
                                                                                                • Additional Resources
                                                                                                  • Installing GemFire for Pivotal Cloud Foundry
                                                                                                  • Prerequisites
                                                                                                  • Service Configuration Defaults
                                                                                                  • Installation Steps
                                                                                                  • Self-Signed and Internal SSL Certificates
                                                                                                    • Internal Certificates
                                                                                                    • Self-Signed Certificates
                                                                                                      • Generating Self-Sign Certificates using the Elastic Runtime Tile
                                                                                                      • Generating Self-SignedCertificates using OpenSSL
                                                                                                          • Creating GemFire Service Plans
                                                                                                            • Deferring Service Plan Configuration
                                                                                                              • Application Security Groups
                                                                                                                • Warning
                                                                                                                  • Using GemFire for Pivotal Cloud Foundry
                                                                                                                    • Creating a GemFire Service Instance
                                                                                                                    • Configuring a GemFire Service Instance
                                                                                                                      • Configuring a Service Instance Using a Spring Application Context XML
                                                                                                                      • Configuring JVM and GemFire Properties
                                                                                                                      • Cloud Deployment Considerations
                                                                                                                      • Network Partition Detection
                                                                                                                        • Working with a GemFire Service Instance
                                                                                                                          • Accessing a Cluster via Pulse
                                                                                                                          • Restarting a Cluster
                                                                                                                          • Accessing GemFire Logs and Statistics and Cluster Configuration
                                                                                                                          • Accessing a Cluster via gfsh
                                                                                                                            • Accessing GemFire Service Connection Information (Binding)
                                                                                                                              • Using a JSON Library to Acquire Connection Information
                                                                                                                              • Using spring-cloud to Acquire Connection Information
                                                                                                                              • Acquiring a Connection from a Spring Application
                                                                                                                              • Configuring a Java REST Client to Access a Service Instance via HTTPS
                                                                                                                                • Deploying Applications for Use with the GemFire Service
                                                                                                                                  • Using the Java Buildpack
                                                                                                                                    • Binding an Application to the GemFire Service
                                                                                                                                      • PCF Developer Console Instructions
                                                                                                                                      • CLI Instructions
                                                                                                                                        • Pushing or Restaging Applications After Service Changes
                                                                                                                                        • Viewing Binding Meta Data
                                                                                                                                          • PCF Developer Console Instructions
                                                                                                                                          • CLI Instructions
                                                                                                                                            • Unbinding an Application from the GemFire Service
                                                                                                                                              • PCF Developer Console Instructions
                                                                                                                                              • CLI Instructions
                                                                                                                                                • Deleting a GemFire Service Instance
                                                                                                                                                  • PCF Developer Console Instructions
                                                                                                                                                  • CLI Instructions
                                                                                                                                                    • Configuring Multi-site (WAN) Connections Between Two or More GemFire Service Instances
                                                                                                                                                      • Using the GemFire for Cloud Foundry CLI Plug-in
                                                                                                                                                      • Installation
                                                                                                                                                      • Overview
                                                                                                                                                      • Broker HTTP Username and Password
                                                                                                                                                      • export-gemfire
                                                                                                                                                      • restart-gemfire
                                                                                                                                                      • show-wan-config-url
                                                                                                                                                      • Troubleshooting
                                                                                                                                                        • Service Installation Troubleshooting
                                                                                                                                                          • Problem Could not deploy a service instance in the Elastic Runtime
                                                                                                                                                          • Problem Service plan tile does not show up in the Developer Console Marketplace
                                                                                                                                                            • Application Troubleshooting
                                                                                                                                                              • Problem Application does not pick up changes to the service instance
                                                                                                                                                                • Service Broker Troubleshooting
                                                                                                                                                                • Broker endpoints for advanced troubleshooting
                                                                                                                                                                  • Uninstalling GemFire for Pivotal Cloud Foundry
                                                                                                                                                                  • Prerequisites
                                                                                                                                                                  • Uninstalling