49
Redis for PCF ® Version 1.7 User's Guide © Copyright Pivotal Software Inc, 2013-2018

Redis for PCF - docs.pivotal.io · Overview of Redis for PCF v1.7 This topic describes the significant new features in Redis for PCF v1.7. This topic also presents a checklist that

  • Upload
    vominh

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

RedisforPCF®

Version1.7

User'sGuide

©CopyrightPivotalSoftwareInc,2013-2018

23571115171819323943454649

TableofContents

TableofContentsRedisforPCFOverviewofRedisforPCFv1.7ReleaseNotesRedisforPCF1.6ArchitectureandLifecycleRedisforPCFRecommendedUsageandLimitationsRedisforPCFSecurityBestPracticesforOperatingRedisforPCFInstallingandUpgradingRedisforPCFManualBackupandRestoreofRedisforPCFMonitoringRedisforPCFTroubleshootingRedisforPCFForAppDevelopersUsingRedisforPCFSampleRedisConfiguration

©CopyrightPivotalSoftwareInc,2013-2018 2 1.7

Redis for PCF

ThisisdocumentationfortheRedisforPCFservicetile.ThistilecanbedownloadedfromPivotalNetwork .

Thisdocumentation:

DescribesthefeaturesandarchitectureofRedisforPCF

InstructsthePCFoperatoronhowtoinstall,configure,maintainandbackupRedisforPCF

InstructstheAppdeveloperonhowtochooseaserviceplan,createanddeleteRedisserviceinstances,andbindanapp

AboutRedisRedisisaneasytouse,highspeedkey-valuestorethatcanbeusedasadatabase,cache,andmessagebroker.Itsupportsarangeofdatastructuresincludingstrings,lists,hashes,sets,bitmaps,hyperloglogs,andgeospatialindexes.ItiseasytoinstallandconfigureandispopularwithengineersasastraightforwardNoSQLdatastore.Itisusedforeverythingfromaquickwaytostoredatafordevelopmentandtestingthroughtoenterprise-scaleappslikeTwitter.

AboutRedisforPCFRedisforPCFpackagesRedisforeasydeploymentandoperabilityonPivotalCloudFoundry(PCF).RedisforPCFcanbeusedasadatastoreorcache.MetricsandloggingenableoperatorstomonitorRedishealth.Operatorscanconfigurescheduledbackupstoavarietyofdestinations.Therearemanualbackupandrestorescriptsforindividualserviceinstances.Newfeaturesareregularlyintroduced.UpgradingRedisforPCFisstraightforwardandpreservesconfigurationanddata.

ProductSnapshotThefollowingtableprovidesversionandversion-supportinformationaboutRedisforPCF :

Element Details

Version v1.7.8

Releasedate January2,2018

Softwarecomponentversion RedisOSSv3.2.11

CompatibleOpsManagerversion(s) v1.8.0,v1.9.0,andv1.10.0

CompatibleElasticRuntimeversion(s) v1.8.0,v1.9.0,andv1.10.0

IaaSsupport AWS,Azure,GCP,OpenStack,andvSphere

IPsecsupport Yes

AboutUpgradingtotheLatestVersionConsiderthefollowingcompatibilityinformationbeforeupgradingRedisforPCF.

Formoreinformation,seetheProductCompatibilityMatrix .

Ops Manager VersionSupported Upgrades from Imported Redis InstallationFrom To

v1.5.x, v1.6.x

v1.40–v1.4.3v1.4.4–latestv1.4.x

v1.5.0–v1.5.7

v1.4.4–latestv1.4.xNextv1.4.x–latestv1.4.x

Note: Redis for PCF v1.7 is no longer supported.Thesupportperiodforv1.7hasexpired.Tostayup-to-datewiththelatestsoftwareandsecurityupdates,upgradetoRedisforPCFv1.10orlater.

©CopyrightPivotalSoftwareInc,2013-2018 3 1.7

v1.4.4–latestv1.4.xv1.5.0–latestv1.5.x

v1.5.0–latestv1.5.x Nextv1.5.x–latestv1.5.x

v1.7.x v1.5.0–latestversion v1.5.1–latestversion

v1.8.x v1.5.17–latestversion v1.6.0–latestversion

v1.9.x v1.6.0–latestversion v1.7.0–latestversion

v1.10.x v1.7.2–latestversion v1.8.0–latestversion

v1.11.x v1.8.0–latestversion 1.8.x

MoreInformationThefollowingtablelistswhereyoucanfindtopicsrelatedtotheinformationonthispage:

For more information about… See…

productcompatibility ProductVersionMatrix

aparticularversionofRedisforPCF ReleaseNotes

howtoupgradeRedisforPCF UpgradingRedisforPCF

howtouseRedis RedisDocumentation

FeedbackPleaseprovideanybugs,featurerequests,orquestionstothePivotalCloudFoundryFeedbacklist.

©CopyrightPivotalSoftwareInc,2013-2018 4 1.7

Overview of Redis for PCF v1.7ThistopicdescribesthesignificantnewfeaturesinRedisforPCFv1.7.ThistopicalsopresentsachecklistthatyoucanusetodecideifRedisforPCFisreadytomeetyourbusinessrequirements.

IntroductionRedisforPCFv1.7focusesonenhancedbackupandrestorecapabilities.Operatorscanconfigureascheduleforbackups,aswellasaseveraloptionsforwheretoputthebackupartifacts.Thereleasealsoincludesscriptsthatcanberunbytheoperatortobackupandrestorededicated-vmorshared-vmserviceinstances.RedisforPCF1.7isconfiguredasadatastore,ifyouwishtouseRedisasacache,pleaseupgradetoRedisforPCF1.8.

NewinThisReleaseThefollowingfeaturesarenewinRedisforPCFv1.7

A choice of destinations for backup artifacts—RedisforPCFv1.7cansendbackupartifactstoAWSS3,SCP,AzureorGoogleCloudStorage

Scripts for manual backup and restore—RedisforPCFv1.7includesscriptsforbackingupandrestoringdedicatedandsharedVMinstances.

Operator configured backup schedule—Theoperatorcanconfigurea cron schedulefortriggeringbackups.

KnownIssuesUpgradefrom1.6sometimesfailsatcf-redis-broker.Clicking apply changes againwillsuccessfullycompleteupgrade.

BackupconfigurationisnotpreservedwhenupgradingfromPCFRedis1.5or1.6;ifbackinguptoAWSS3,operatorswillneedtore-enterS3configuration.

Theservicebrokerandallshared-vmserviceinstancesareunavailablewhilethemanualrestorescriptisbeingrun.

Ifthemanualrestorescriptfails,theRedisserviceinstancethatisbeingrestoredtoisleftinanunusablestate.

Themanualrestorescriptcantimeoutonverylargefiles,e.g.largerthan60GB.

TheRedisbrokervminstancelistensonport12350insteadofport80.Anyvmsthatneedtocommunicatetothebroker(e.g.broker-registrar,cloud_controller)shouldhavethisportopen.Pleaseensureyouhavetheappropriatefirewallsettings.

Enterprise-ReadyChecklistReviewthefollowingtabletodetermineifRedisforPCFv1.7hasthefeaturesneededtosupportyourenterprise.

Plans and Instances More Information

Dedicatedandsharedplans

RedisforPCFprovidesbothdedicatedVMandsharedVMplans. Plans

Customizableplans ForthededicatedVMplan,theoperatorcancustomizetheVManddisksize. Configuring

Installation and Upgrades More Information

Productupgrades RedisforPCFcanbeupgradedfromv1.5andv1.6tiles UpgradingRedisforPCF

DeploymentSmokeTests

RedisforPCFinstallationandupgraderunsapostdeploymentBOSHerrandthatvalidatesbasicRedisoperations

SmokeTests

Maintenance and Backups More Information

OperationalMonitoringandLogging

RedisforPCFv1.7providesmetricsforhealthmonitoringandsyslogredirectiontoexternallogingestors.

MonitoringRedisforPCF

BackupandRestoreRedisforPCFv1.7providesautomaticbackupsonaconfigurablescheduletoavarietyofdestinations,aswellasscriptsforbackupandrestoreofserviceinstances.

ManualBackupandRestoreofRedisforPCF

Scale and Availability More Information

Scale RedisforPCFhasbeentestedwith60GBofdata

AbilitytoScaleUp/OperatorscanscaleVMsup,butnotdown Configuring

©CopyrightPivotalSoftwareInc,2013-2018 5 1.7

DownRollingDeployments

RedisforPCFdoesnotsupportrollingdeploymentsbecauseitissinglenode;theserviceisunavailableduringupgrades.

Upgrades

AZSupport AssigningmultipleAZstoRedisjobsdoesnotguaranteehighavailability.AboutMultipleAZsinRedisforPCF

Encryption More Information

EncryptedCommunicationinTransit

RedisforPCFhasbeentestedsuccessfullywiththeBOSHIPsecAdd-onSecuringDatainTransitwiththeIPsecAdd-on

AboutMultipleAZsinRedisforPCFv1.7RedisforPCFv1.7supportsconfiguringmultipleAZs.However,assigningmultipleAZstoRedisjobsdoesnotguaranteehighavailability.

Shared-VMinstancesrunonasinglenodeinjustoneoftheconfiguredavailabilityzonesandarethereforenothighlyavailable.

Dedicated-VMinstancescanbeassignedtoanyoftheconfiguredavailabilityzones.Howevereachinstancestilloperatesasasinglenodewithnoclustering.Thisseparationoveravailabilityzonesprovidesnohighavailability.

MoreInformationThefollowingtablelistswhereyoucanfindtopicsrelatedtotheinformationonthispage:

For more information about… See…

thev1.7releases ReleaseNotes

©CopyrightPivotalSoftwareInc,2013-2018 6 1.7

Release Notes

RedisforPCFv1.7.8January 2, 2018

Compatibility

Thistileusesthefollowingreleases:ServiceBackup18.1.3andServiceMetrics1.5.8.

Seethechangetometricsconfigurationintroducedinv1.7.2.

Features

Nochange

Bug Fixes

Nochange

Known Issues

Nochange

RedisforPCFv1.7.7November 15, 2017

Compatibility

Thisreleaseiscompatiblewithstemcellline3445.

Seethechangetometricsconfigurationintroducedinv1.7.2.

Features

Nochange

Bug Fixes

Nochange

Known Issues

Nochange.RedisbackupstoAWSS3arestilllimitedtostandardregion.

RedisforPCFv1.7.6October 27, 2017

Compatibility

Thisreleaseiscompatiblewithstemcellline3468.

ThisreleaseusesOSRedis3.2.11.

Seethechangetometricsconfigurationintroducedinv1.7.2.

Features

Nochange

©CopyrightPivotalSoftwareInc,2013-2018 7 1.7

Bug Fixes

Nochange

Known Issues

Thisstemcelllinewasnotintendedtobesupported.RedisBackupstoAWSS3stilllimitedtostandardregion.

RedisforPCFv1.7.5April 27, 2017

Compatibility

Bumpstemcelllineto3363.

Seethechangetometricsconfigurationintroducedinv1.7.2.

Features

ImplementedRedis3.2.8

AdjustedsmoketeststobemoreresilienttounresponsivefactorsexternaltoRedis,whichwillreducefalsefailures.

Bug Fixes

Nochange

Known Issues

Nochange.RedisBackupstoAWSS3stilllimitedtostandardregion.

RedisforPCFv1.7.4April 5, 2017

Compatibility

Nochange.Seethechangetometricsconfigurationintroducedinv1.7.2.

Features

Nochange

Bug Fixes

Fixanissuewithprocesswatcherbeingrestartedeverytwo/threehours.

Known Issues

Nochange.RedisBackupstoAWSS3stilllimitedtostandardregion.

RedisforPCFv1.7.3March 6, 2017

Compatibility

Nochange.Seethechangetometricsconfigurationintroducedinv1.7.2.

Features

©CopyrightPivotalSoftwareInc,2013-2018 8 1.7

Nochange

Bug Fixes

FixanissuewithRedisbeingrestartedeverythreehours.ThisissuewasintroducedinRedisforPCFv1.7.1andalsoexistsin1.7.2.

RedisforPCFv1.7.2 Known Issues

Nochange.RedisBackupstoAWSS3stilllimitedtostandardregion.

February 16, 2017

Compatibility

InorderforRedisforPCFv1.7toworkwithPCFv1.8andlater,theoperatorneedstobeabletoconfigurewhetherTLSisturnedonoroffformetricscommunications.RedisforPCFv1.7.2addstheabilityfortheoperatortoturnon/offTLScommunicationsformetrics,viaaUsenon-securecommunicationformetrics checkboxonthemetricsconfigurationpageinOpsManager.Youshouldconfigurethischeckboxfordifferentversions

ofPCFasfollow:

PCF v1.8:ThischeckboxmustbecheckedformetricstobeemittedtotheFirehose.

PCF v1.9:Metricscommunicationsaresecurebydefaultbutwillworkinanon-securemode.

PCF v1.10 and later:MetricscommunicationsaresecurebydefaultsothischeckboxmustbeuncheckedformetricstobeemittedtotheFirehose.

Features

Nochange

Bug Fixes

Nochange

Known Issues

InordertoenableTLScommunicationsformetrics,theadditionofaconsulagenttoallinstanceswasrequired.Thismeanstherearenownewopenportsrequired.PleasemakechangestoanyfirewallrulestoallowoutboundtrafficfromallRedisvminstancesonport 8301 .

RedisBackupstoAWSS3stilllimitedtostandardregion.

RedisforPCFv1.7.1January 25, 2017

Compatibility

Nochange

Features

Nochange

Bug Fixes

FixissuewithmigrationofbackupconfigurationwhenupgradingfromRedisforPCFv1.6.

FixissuewiththeservicebrokerandsharedvminstancesbeingunavailablewhilerunningtherestorescriptonasharedVMinstance.

Fixissuewithverylargefilesbeingrestored.

Resolved Security Issues

UpgradetoGolangv1.7.4

©CopyrightPivotalSoftwareInc,2013-2018 9 1.7

Known Issues

Nochange.RedisBackupstoAWSS3stilllimitedtostandardregion.

RedisforPCFv1.7.0December 22, 2016

Known Issues

RedisBackupstoAWSS3LimitedtoStandardRegionBackupsareonlysenttoAWSS3bucketsthathavebeencreatedintheUSStandardregion ,“us-east-1.”

Releasenoteshere.

©CopyrightPivotalSoftwareInc,2013-2018 10 1.7

Redis for PCF 1.6 Architecture and Lifecycle

HowRedisforPCFConfiguresRedisRedisforPCFconfiguresRedisinthefollowingways.Theseconfigurationscannotbechanged.

Redisisconfiguredwithamaxmemory-policyofno-eviction.Thispolicymeansthatwhenthememoryisfull,theservicedoesnotevictanykeysorperformanywriteoperationsuntilmemorybecomesavailable.

Persistenceisconfiguredforboth RDB and AOF .Thedefaultmaximumnumberofconnections,maxclients,issetat10000butthisnumberisadjustedbyRedisaccordingtothenumberoffilehandlesavailable.

Replicationandeventnotificationarenotconfigured.

Asample redis.conf fromaDedicated-VMplaninstancecanbeviewedonSampleRedisConfiguration

ServicePlansRedisforPCFoffersDedicated-VMandShared-VMplans.

Shared-VMPlanThisplandeploysaRedisinstanceinsidetheservicebrokerVM.

Youcandisablethisplanbysettingthe Max instances limit onthe Shared-VM plan tabinOpsManagertobe 0 .

Themaximumnumberofinstancescanbeincreasedfromthedefault5toavalueofyourchoosing.IfyouincreasethenumberofinstancesthatcanberunonthissingleVM,youshouldconsiderincreasingtheresourcesallocatedtotheVM.InparticularRAMandCPU.Youcanovercommittoacertainextent,butmaystarttoseeperformancedegradations.

YoucanalsoincreasethemaximumamountofRAMallocatedtoeachRedisprocess(serviceinstance)thatisrunningonthisVM

Ifyoudecreasetheserviceinstancelimit,anyinstancesthatarerunningwherethecountisnowgreaterthanthelimitarenotterminated.Theyarelefttoberemovednaturally,untilthetotalcountdropsbelowthenewlimityoucannotcreateanynewinstances.Forexampleifyouhadalimitof10andallwereusedandreducedthisto8,thetwoinstanceswillbeleftrunninguntilyouterminatethemyourself.

Dedicated-VMPlanThisplandeploystheoperator-configurednumberofdedicatedRedisVMsalongsidetheservicebrokerVM.

Theseinstancesarepre-provisionedduringthedeploymentofthetilefromOpsManagerintoapool.TheVMsareprovisionedandconfiguredwithaRedisprocessreadytobeusedwhenaninstanceoftheDedicated-VMplanisrequested.

Adefaultdeploymentwillprovision 5 instances oftheDedicated-VMplanintothepool.Thisnumbercanbeincreasedonthe Resource Config

tabinOpsManager,eitherintheinitialdeployment,orsubsequentlythereafter.ThenumberofVMscannotbedecreasedoncedeployed.

Whenauserprovisionsaninstance,itismarkedasinuseandtakenoutofthepool.

Whenauserdeprovisionsaninstance,theinstanceiscleansedofanydataandconfigurationtorestoreittoafreshstateandplacedbackintothepool,readytobeusedagain.

Youcandisablethisplanbysettingthenumberofinstancesofthe Dedicated node jobinOpsManagerto 0 .

RedisforPCFArchitectureThisdiagramshowshowthearchitectureoftheservicebrokerandShared-VMandDedicated-VMplansandhowtheuser’sappbindstoaRedisinstance.

©CopyrightPivotalSoftwareInc,2013-2018 11 1.7

RedisforPCFLifecycleHereisthelifecycleofRedisforPCF,fromanoperatorinstallingthetilethroughanappdeveloperusingtheservicethenanoperatordeletingthetile.

©CopyrightPivotalSoftwareInc,2013-2018 12 1.7

©CopyrightPivotalSoftwareInc,2013-2018 13 1.7

©CopyrightPivotalSoftwareInc,2013-2018 14 1.7

Redis for PCF Recommended Usage and Limitations

RecommendedUseCasesRedisforPCFcanbeusedasadatastoreorcache.Itisconfiguredwith maxmemory-policy=

noevictionandRDBandAOFpersistence.

Rediscanbeusedinmanydifferentways,including:

Key/valuestoreforstringsandmorecomplexdatastructuresincludingHashes,Lists,Sets,SortedSets

Sessioncache-persistenceenablespreservationofstate

Fullpagecache-persistenceenablespreservationofstate

Databasecache-cachequeries

Dataingestion-becauseRedisisinmemoryitcaningestdataveryquickly

MessageQueues-listandsetoperations. PUSH , POP ,andblockingqueuecommands.

Leaderboards/Counting-incrementsanddecrementsofsetsandsortedsetsusing ZRANGE , ZADD , ZREVRANGE , ZRANK , INCRBY , GETSET

Pub/Sub-builtinpublishandsubscribeoperations- PUBLISH , SUBSCRIBE , UNSUBSCRIBE

ServicePlanRecommendedUsageandLimitations

Dedicated-VMPlanEachdedicatedVMplaninstancesisdeployedtoitsownVMandissuitableforproductionworkloads.

ThenumberofDedicated-VMplaninstancesavailabletodevelopersissetbytheoperator.Configurationsofupto100Dedicated-VMplaninstanceshavebeentested.

NoabilitytochangetheRedisconfiguration.The CONFIG commandisdisabled.

CannotscaledownthenumberofVMsontheplanoncedeployed.

CannotscaledownthesizeofVMsontheplanoncedeployed(thisprotectsagainstdataloss).

Thedefaultmaximumnumberofconnections,maxclients,issetat10000butthisnumberisadjustedbyRedisaccordingtothenumberoffilehandlesavailable.

Shared-VMPlanTheShared-VMplandoesnotmanage‘noisyneighbor’problemssoitisnotrecommendedforproductionapps.

ThenumberofSharedVMinstancesavailabletodevelopersissetbytheoperator.ThemaximumnumberofsharedVMinstancesisrelativetothememoryallocatedtoeachSharedVMinstanceandthetotalmemoryoftheRedisservicebroker.PleaseseeConfiguringServicePlansformoredetail.

Itcannotbescaledbeyondasinglevirtualmachine.

Thefollowingcommandsaredisabled: CONFIG , MONITOR , SAVE , BGSAVE , SHUTDOWN , BGREWRITEAOF , SLAVEOF , DEBUG ,and SYNC .

ConstrainingCPUand/ordiskusageisnotsupported.

Thedefaultmaximumnumberofconnections,maxclients,issetat10000butthisnumberisadjustedbyRedisaccordingtothenumberoffilehandlesavailable.

AvailabilityUsingMultipleAZsRedisforPCF1.6supportsconfiguringmultipleavailabilityzonesbutthisconfigurationdoesnotprovidehighavailability.

©CopyrightPivotalSoftwareInc,2013-2018 15 1.7

DowntimeDuringRedeploysRedeployingPCFRedisforconfigurationchangesorupgradeswillresultinRedisbeinginaccessibletoappsforabriefperiodoftime.

RedisKeyCountandMemorySizeRediscanhandleupto2 keys,andwastestedinpracticetohandleatleast250millionkeysperinstance.Everyhash,list,set,andsortedset,canhold2 elements.VMmemoryismorelikelytobealimitingfactorthannumberofkeysthatcanbehandled.

32

32

©CopyrightPivotalSoftwareInc,2013-2018 16 1.7

Redis for PCF Security

SecurityPivotalrecommendsthatRedisforPCFisruninitsownnetwork.

RedisforPCFworkswiththeIPsecAdd-onforPCF.ForinformationabouttheIPsecAdd-onforPCF,seeSecuringDatainTransitwiththeIPsecAdd-on .

ToallowthisservicetohavenetworkaccessyoumustcreateApplicationSecurityGroups.Formoreinformation,seeNetworks,Security,andAssigningAZs.

©CopyrightPivotalSoftwareInc,2013-2018 17 1.7

Best Practices for Operating Redis for PCFThistopicisforPCFoperators.Itintroducessomebestpractices,butdoesnotprovidedetailsaboutoperation.

BestPracticesPivotalrecommendsthatoperatorsdothefollowing:

ResourceAllocation—WorkwithappdeveloperstoanticipatememoryrequirementsandtoconfigureVMsizes.RedisforPCFisconfiguredbydefaultwithsmallVMs.ForinformationaboutconfiguringVMsizes,seeConfigureRedisServicePlans.

Logs—Configureasyslogoutput.Storinglogsinanexternalservicehelpsoperatorsdebugissuesbothcurrentandhistorical.

Monitoring—Setupamonitoringdashboardformetricstotrackthehealthoftheinstallation.

BackingUpData—WhenusingRedisforpersistence,configureautomaticbackupssothatdatacanberestoredinanemergency.Validatethebacked-updatawithatestrestore.

AboutCreatingBackupsofRedisInstancesYoucanbackupRedisforPCFinstancesintwoway:

Configureautomaticbackupstoberunforeachinstance,acrossbothserviceplans.Forinformationaboutsettingupautomaticbackups,seeConfigureBackups.

Createmanualbackupsofindividualinstances.Forinformationabouthowtomakemanualbackupsofinstances,seeManualBackupandRestoreofRedisforPCF.

AboutMonitoringRedisforPCF

RedisMetricsRedisforPCFemitsRedismetricsviathefirehose.Detailshere

LoggingSyslogcanbeforwardedtoanexternallogservice.

Thefollowingexampleshowssyslogmessage:

Nov1517:05:0110.0.24.10audispd:[job=dedicated-nodeindex=4]node=7bfe8b1b-6cfd-4d33-b704-c9214ce6bb3etype=USER_ACCTmsg=audit(1479229501.290:86):pid=6655uid=0auid=4294967295ses=4294967295msg='op=PAM:accountingacct="root"exe="/usr/sbin/cron"hostname=?addr=?terminal=cronres=success'

Forinformationabouthowtosetupsyslogoutput,seeConfigureSyslogOutput.

SmokeTestsRedisforPCFhassmoketeststhatarerunasapost-installerrandbyOpsManager.Informationonwhattheydoishere .Theycanberunbytheoperatorvia boshrunerrandsmoke-

tests.

©CopyrightPivotalSoftwareInc,2013-2018 18 1.7

Installing and Upgrading Redis for PCF

InstallationStepsToaddRedisforPCFtoOpsManager,followtheprocedureforaddingPivotalOpsManagertiles:

1. DownloadtheproductfilefromPivotalNetwork .

2. UploadtheproductfiletoyourOpsManagerinstallation.

3. ClickAddnexttotheuploadedproductdescriptionintheAvailableProductsviewtoaddthisproducttoyourstagingarea.

4. (Optional)Clickthenewlyaddedtiletoconfigureyourpossibleserviceplans,syslogdraining,andbackups.

5. ClickApply Changestoinstalltheservice.

Afterinstalling,besureto:

MonitorthehealthandperformanceofyourRedisinstancesbysettinguplogging andtrackingmetrics .

Configureautomaticbackups .

ConfiguringPCFRedis

ConfigureRedisServicePlansSelecttheRedistilefromtheInstallationDashboardtodisplaytheconfigurationpageandallocateresourcestoRedisserviceplans.

Shared-VMPlan1. SelecttheShared-VM Plantab.

2. Configurethesefields:

Redis Instance Memory Limit—Maximummemoryusedbyashared-VMinstanceRedis Service Instance Limit—Maximumnumberofshared-VMinstances

MemoryandinstancelimitsdependonthetotalsystemmemoryofyourRedisbrokerVMandrequiresomeadditionalcalculation.Formoreinformation,seeMemoryLimitsforShared-VMPlansbelow.

3. ClickSave.

4. Ifyoudonotwanttousetheon-demandservice,youmustmakealloftheon-demandserviceplansinactive.Clickthetabforeachon-demandplan,andselectPlan Inactive.SeetheexampleinStep4ofRemovingOn-DemandServicePlansabove.

©CopyrightPivotalSoftwareInc,2013-2018 19 1.7

5. TochangetheallocationofresourcesfortheRedisbroker,clicktheResource Configtab.

TheRedisbrokerserverrunsalloftheRedisinstancesforyourShared-VMplan.FromtheResource Configpage,youcanchangetheCPU,RAM,EphemeralDisk,andPersistentDiskmadeavailable,asneeded.

MemoryLimitsforShared-VMPlans

Additionalcalculationisrequiredtoconfigurememorylimitsforshared-VMplans.Withtheseplans,severalserviceinstancessharetheVM,andtheRedisbrokeralsorunsonthissameVM.Therefore,thememoryusedbyalltheshared-vminstancescombinedshouldbeatmost45%ofthememoryoftheRedisbrokerVM.

Toconfigurethelimitsinthesefields,estimatethemaximummemorythatcouldbeusedbyallyourRedisshared-VMinstancescombined.Ifthatfigureishigherthan45%oftheRedisbrokerVM’stotalsystemmemory,youcandooneofthefollowing:

DecreasetheRedis Instance Memory Limit.

DecreasethenumberofinstancesinRedis Service Instance Limit.

IncreasetheRAMfortheRedisBrokerintheResource Configtabasshownbelow.

Herearesomeexamplesforsettingtheselimits:

Redis Broker VM Total Memory Redis Instance Memory Limit Redis Service Instance Limit

16GB 512MB 14

16GB 256MB 28

64GB 512MB 56

Dedicated-VMPlan1. SelecttheResource ConfigtabtochangetheallocationofresourcesfortheDedicatedNode.

Thedefaultconfigurationcreatesfivededicatednodes(VMs).EachnodecanrunoneRedisdedicated-VMinstance.Youcanchangethenumberofdedicatednodes,andconfigurethesizeofthepersistentandephemeraldisks,andtheCPUandRAMforeach

Note:ItispossibletoconfigurealargerRedis Service Instance Limit,ifyouareconfidentthatthemajorityofthedeployedinstanceswillnotusealargeamountoftheirallocatedmemory,forexampleindevelopmentortestenvironments.

However,thispracticeisnotsupportedandcancauseyourservertorunoutofmemory,preventingusersfromwritinganymoredatatoanyRedisshared-VMinstance.

©CopyrightPivotalSoftwareInc,2013-2018 20 1.7

node.ThedefaultVMsizeissmall.ItisimportantthatyousetthecorrectVMsizetohandleanticipatedloads.WithdedicatedVMplans,thereisoneRedisserviceinstanceoneachVM.Themaximummemoryaninstancecanuseshouldbeatmost45%ofthetotalsystemRAMontheVM.Youcansetthiswiththe maxmemory configuration.Theappcanuse100%of maxmemory ,thatis,upto45%ofthesystemRAM.Pivotalrecommendsthepersistentdiskbesetto3.5xtheamountofsystemRAM.

2. Afteryouhavefinishedconfiguringresourceallocations,clickSave.

ConfigureResourcesforDedicated-VMandShared-VMPlansToconfigureresourcesfortheShared-VMandDedicated-VMplans,clicktheResource ConfigsettingstabontheRedisforPCFtile.

TheShared-VMplanisontheRedis Brokerresource.

TheDedicated-VMplanisontheDedicated Noderesource.

ThefollowingarethedefaultresourceandIPrequirementsforRedisforPCFwhenusingtheShared-VMorDedicated-VMplans:

Product Resource Instances CPU Ram Ephemeral Persistent Static IP Dynamic IP

Redis RedisBroker 1 2 3072 4096 9216 1 0

Redis DedicatedNode 5 2 1024 4096 4096 1 0

Redis BrokerRegistrar 1 1 1024 2048 0 0 1

Redis BrokerDe-Registrar 1 1 1024 2048 0 0 1

Redis Compliation 2 2 1024 4096 0 0 1

DisableSharedandDedicatedVMPlansYoucandisableSharedandDedicatedVMPlansbydoingthefollowingwhileconfiguringRedistile:

1. EnsureatleastoneOn-Demandplanisactive.

2. Configurethefollowingtabs:

Shared-VM Plan:a.SetRedis Service Instance Limitto0.b.ClickSave.

Errands:a.SetBroker RegistrartoOff.b.SetSmoke TeststoOff.c.SetBroker DeregistrartoOff.d.LeaveallfourOn-DemanderrandsOn.e.ClickSave.

Resource Config:a.DecreaseRedis BrokerPersistentdisktypetothesmallestsizeavailable.b.DecreaseRedis BrokerVMtypetothesmallestsizeavailable.c.SetDedicated NodeInstancesto0.d.ClickSave.

ConfiguringSecureCommunicationRedisforPCFv1.7.2letstheoperatorturnon/offTLScommunicationsformetrics,viaa Usenon-securecommunicationformetrics checkboxonthemetricsconfigurationpageinOpsManager.ConfigurethischeckboxfordifferentversionsofPCFasfollows:

PCF v1.8:SelectthischeckboxtosendmetricstotheFirehose.

PCF v1.9:ClearthischeckboxtosendmetricstotheFirehosesecurely,orselectittosendmetricsinsecurely.

©CopyrightPivotalSoftwareInc,2013-2018 21 1.7

PCF v1.10 and later:ClearthischeckboxtosendmetricstotheFirehoseandavoiderrors.

Settingthischeckboxincorrectlycancausea Cannotgeneratemanifest...unknownproperty"cf_etcd_client_cert"

error:

ConfigureSyslogOutputPivotalrecommendsthatoperatorsconfigureasyslogoutput.

1. AddtheSyslogaddress,Syslogportandtransportprotocolofyourlogmanagementtool.Theinformationrequiredforthesefieldsisprovidedbyyourlogmanagementtool.

2. ClickSave.

CreatingBackupsofRedisInstancesYoucanconfigurebackupstoberunforallinstances,acrossbothserviceplans.

Thekeyfeaturesare:

©CopyrightPivotalSoftwareInc,2013-2018 22 1.7

Runsonaconfigurableschedule

Everyinstanceisbackedup,acrossbothserviceplans

TheRedisbrokerstatefileisbackedup

Foreachbackupartefact,afileiscreatedthatcontainstheMD5checksumforthatartifact.Thiscanbeusedtovalidatethattheartefactisnotcorrupted.

YoucanconfigureAWSS3,SCP,AzureorGoogleCloudStorageasyourdestination

DatafromRedisisflushedtodisk,beforethebackupisstartedbyrunninga BGSAVE oneachinstance

Backupsarelabelledwithtimestamp,instanceGUIDandplanname

Configuration

Toenablebackups,youwillfirstneedtochooseyourbackupdestinationtype-AWSS3,SCP,AzureorGoogleCloudStorage.

ClickonthetileinOpsManager,followedbythe Backups linkonthelefthandmenu.

S3backupfields

©CopyrightPivotalSoftwareInc,2013-2018 23 1.7

Field Description Mandatory/Optional

AccessKeyID

TheaccesskeyforyourS3account Mandatory

SecretAccessKey

TheSecretKeyassociatedwithyourAccessKey Mandatory

EndpointURL

TheendpointofyourS3account,e.g. http://s3.amazonaws.com

Optional,defaultstohttp://s3.amazonaws.com

ifnotspecified

BucketName

Nameofthebucketyouwishthefilestobestoredin. Mandatory

Path Pathinsidethebuckettosavebackupsto. Mandatory

Backuptimeout

Theamountoftime,inseconds,thatthebackupprocesswillwaitfortheBGSAVEcommandtocompleteonyourinstance,beforetransferringtheRDBfiletoyourconfigureddestination

Mandatory

CronSchedule

Backupsscheduleincrontabformat.Forexample,oncedailyat2amis * 2 * * * .Alsoacceptsapre-definedschedule:anyof @yearly , @monthly , @weekly , @daily , @hourly ,or @every <time> ,where <time> isanysupportedtimestring(e.g. 1h30m ).Formoreinformation,seethecronpackagedocumentation .

Mandatory

AWSIAMPolicy

©CopyrightPivotalSoftwareInc,2013-2018 24 1.7

AnAWSIAMpolicydescribesthepermissionsrelatedtoyourbucket.Theminimumsetofpoliciesrequiredinordertouploadthebackupfilesare:

{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["s3:ListBucket","s3:ListBucketMultipartUploads","s3:ListMultipartUploadParts","s3:PutObject"],"Resource":["arn:aws:s3:::<bucket-name>","arn:aws:s3:::<bucket-name>/*"]}]}

Notes:

Makesuretoreplace <bucket-name> withyourcorrectvalues.

s3:CreateBucket isonlyrequirediftheS3bucketdoesnotexist.

Theadditional s3:CreateBucket actionisalsorequirediftheS3bucketdoesnotexist.

SCPbackupfields

©CopyrightPivotalSoftwareInc,2013-2018 25 1.7

Field Description Mandatory/Optional

Username Theusernametousefortransferringbackupstothescpserver Mandatory

PrivateKey Theprivatesshkeyoftheuserconfiguredin Username Mandatory

Hostname ThehostnameorIPaddressoftheSCPserver Mandatory

DestinationDirectory

Thepathinthescpserver,wherethebackupswillbetransferred Mandatory

SCPPort Thescpportofthescpserver Mandatory

CronSchedule

Backupsscheduleincrontabformat.RefertotableforS3backupsfordetails Mandatory

Backuptimeout

Theamountoftime,inseconds,thatthebackupprocesswillwaitfortheBGSAVEcommandtocompleteonyourinstance,beforetransferringtheRDBfiletothescpserver

Mandatory

©CopyrightPivotalSoftwareInc,2013-2018 26 1.7

GCSbackupfields

PCFRedisusesserviceaccountcredentialstouploadbackupstoGoogleCloudStorage.TheserviceaccountshouldhaveStorageAdmin permissions.Pleaserefertothedocumentation fordetailsonhowtosetupaGCPserviceaccount.

Field Description Mandatory/Optional

ProjectID GCPProjectID Mandatory

Bucketname

Nameofthebucketyouwishthefilestobestoredin. Mandatory

Serviceaccountprivatekey

TheJSONSecretKeyassociatedwithyourServiceAccount.Seedocumentation fordetailsonhowtosetupserviceaccountkeys.

Mandatory

CronSchedule

Backupsscheduleincrontabformat.Forexample,oncedailyat2amis*2***.Alsoacceptsapre-definedschedule:anyof@yearly,@monthly,@weekly,@daily,@hourly,or@every,whereisanysupportedtimestring(e.g.1h30m).Formoreinformation,seethecronpackagedocumentation.

Mandatory

Backuptimeout

Theamountoftime,inseconds,thatthebackupprocesswillwaitfortheBGSAVEcommandtocompleteonyourinstance,beforetransferringtheRDBfiletoyourconfigureddestination

Mandatory

Azurebackupfields

©CopyrightPivotalSoftwareInc,2013-2018 27 1.7

Field Description Mandatory/Optional

Account Accountname Mandatory

AzureStorageAccessKey

AzurespecificcredentialsrequiredtowritetotheAzurecontainer Mandatory

Containername

NameoftheAzurecontainerwhichwillstorebackupfiles. Mandatory

DestinationDirectory

DirectorywherethebackupfileswillbestoredwithintheAzurecontainer. Mandatory

BlobStoreBaseURL

URLpointingtoAzureresource Optional

CronSchedule

Backupsscheduleincrontabformat.Forexample,oncedailyat2amis*2***.Alsoacceptsapre-definedschedule:anyof@yearly,@monthly,@weekly,@daily,@hourly,or@every,whereisanysupportedtimestring(e.g.1h30m).Formoreinformation,seethecronpackagedocumentation.

Mandatory

Backuptimeout

Theamountoftime,inseconds,thatthebackupprocesswillwaitfortheBGSAVEcommandtocompleteonyourinstance,beforetransferringtheRDBfiletoyourconfigureddestination

Mandatory

Foreachbackupdestination,thefield Backuptimeout causesbackupstofailafteraconfiguredtimeout.Redis’BGSAVEwillcontinue,butbackupswillnotbeuploadedtodestinatonsifthistimeoutisreached.

©CopyrightPivotalSoftwareInc,2013-2018 28 1.7

Networks,Security,andAssigningAZs

NetworkConfiguration

Thefollowingportsandrangesareusedinthisservice:

Port Protocol Direction and Network Reason

83008301

tcptcpandudp

InboundtoCloudFoundrynetwork,outboundfromservicebrokerandserviceinstancenetworks*

CommunicationbetweentheCFconsul_serverandconsul_agentsonRedisdeployment;usedformetrics

4001 tcpInboundtoCloudFoundrynetwork,outboundfromservicebrokerandserviceinstancenetworks*

UsedbytheRedismetron_agenttoforwardmetricstotheCloudFoundryetcdserver

80 tcpOutboundfromCloudFoundrytothecf-redis-brokerservicebrokernetwork

(Onlyifusingacf-redis-broker)Accesstothecf-redis-brokerfromthecloudcontrollers.

6379 tcpOutboundfromCloudFoundrytoanyserviceinstancenetworks

AccesstoallnodesfromtheDiegoCellandDiegoBrainnetwork(s)

32768-61000

tcpOutboundfromCloudFoundrytothecf-redis-brokerservicebrokernetwork

FromtheDiegoCellandDiegoBrainnetwork(s)totheservicebrokerVM.Thisisonlyrequiredforthesharedserviceplan.

80or443(Typically)

httporhttpsrespectively

Outboundfromanyserviceinstancenetworks Accesstothebackupblobstore

*Typicallytheservicebrokernetworkandserviceinstancenetwork(s)arethesame.

ApplicationSecurityGroups

ToallowthisservicetohavenetworkaccessyoumustcreateApplicationSecurityGroups(ASGs) .EnsureyoursecuritygroupallowsaccesstotheRedisServiceBrokerVMandDedicatedVMsconfiguredinyourdeployment.YoucanobtaintheIPaddressesfortheseVMsinOpsManagerundertheResourceConfigsectionfortheRedistile.

ApplicationContainerNetworkConnections

ApplicationcontainersthatuseinstancesoftheRedisservicerequirethefollowingoutboundnetworkconnections:

Destination Ports Protocol Reason

ASSIGNED_NETWORK 32768-61000 tcp Enableapplicationtoaccesssharedvmserviceinstance

ASSIGNED_NETWORK 6379 tcp Enableapplicationtoaccessdedicatedvmserviceinstance

CreateanASGcalled redis-app-containers withtheaboveconfigurationandbindittotheappropriatespaceor,togiveallstartedappsaccess,bindtothedefault-running ASGsetandrestartyourapps.Example:

[{"protocol":"tcp","destination":"ASSIGNED_NETWORK","ports":"6379"}]

AssigningAZs

AssigningmultipleAZstoRedisjobswillnotguaranteehighavailability.

AllofyourShared-VMinstanceswillrunonasinglenodeinjustoneoftheconfiguredavailabilityzonesandarethereforenothighlyavailabile.

EachDedicated-VMinstancecouldbeassignedtoanyoftheconfiguredavailabilityzones,howevereachinstancestilloperatesasasinglenodewithno

Note:WithoutASGs,thisserviceisunusable.

©CopyrightPivotalSoftwareInc,2013-2018 29 1.7

clustering.Thisseparationoveravailabilityzonesprovidesnohighavailability.

ValidatingInstallation

SmoketestsSmoketestsarerunaspartofRedisforPCFinstallationtovalidatethattheinstallsucceeded.Smoketestsaredescribedhere .

UpgradingRedisforPCFThisproductenablesareliableupgradeexperiencebetweenversionsoftheproductthatisdeployedthroughOpsManager.

Theupgradepathsaredetailedhere foreachreleasedversion.

Toupgradetheproduct:

TheOperatorshoulddownloadthelatestversionoftheproductfromPivotalNetwork

Uploadthenew.pivotalfiletoOpsManager

Uploadthestemcellassociatedwiththeupdate(ifrequired)

Updateanynewmandatoryconfigurationparameters(ifrequired)

Press“Applychanges”andtherestoftheprocessisautomated

DuringtheupgradedeploymenteachRedisinstancewillexperienceasmallperiodofdowntimeaseachRedisinstanceisupdatedwiththenewsoftwarecomponents.ThisdowntimeisbecausetheRedisinstancesaresingleVMsoperatinginanonHAsetup.ThelengthofthedowntimedependsonwhetherthereisastemcellupdatetoreplacetheoperatingsystemimageorwhethertheexistingVMcansimplyhavetheredissoftwareupdated.StemcellsupdatesincuradditionaldowntimewhiletheIaaScreatesthenewVMwhileupdateswithoutastemcellupdatearefaster.

OpsManagerensurestheinstancesareupdatedwiththenewpackagesandanyconfigurationchangesareappliedautomatically.

Upgradingtoanewerversionoftheproductdoesnotcauseanylossofdataorconfiguration.Thisisexplicitlytestedforduringourbuildandtestprocessforanewreleaseoftheproduct.

ReleasepolicyWhenanewversionofRedisisreleasedweaimtoreleaseanewversionoftheproductcontainingthissoonafter.

WherethereisanewversionofRedisoranotherdependentsoftwarecomponentsuchasthestemcellreleasedduetoacriticalCVE,Pivotal’sgoalistoreleaseanewversionoftheproductwithin48hours.

©CopyrightPivotalSoftwareInc,2013-2018 30 1.7

UninstallingRedisforPCFTouninstallRedisforPCF,clickonthetrashcaniconinthelowerrighthandcornerofthePCFRedistileinthePCFOpsManagerInstallationdashboard.Confirmdeletionoftheproductandclickapplychanges.

©CopyrightPivotalSoftwareInc,2013-2018 31 1.7

Manual Backup and Restore of Redis for PCF

TriggeringaManualBackupBackupsofyourRedisdeploymentwillautomaticallyoccurpertheCronScheduleyousetinyourdeployment.Youcantriggermanualbackupsatanytimebyfollowingthestepsbelow.ThebackupartifactswillbesenttothedestinationconfiguredinOpsManagerforautomaticbackups.

Followthesesteps tologintoyourOpsManagerinstallationandtargettheRedistiledeployment.

IdentifytheVMwhichholdsyourinstancebyrunning bosh vms .

Forthe shared-vm planthiswillbethejobnamecontaining cf-redis-broker .Running manual-backup willbackupalloftheshared-vminstancesandthebrokerstateinthe statefile.json file.Forthe dedicated-vm planthiswillbethejobnamecontaining dedicated-node .Running manual-backup willbackuptheRedisdump.rdbfileforthatdedicated-vminstance.Youcanidentifytheexactnodeforyour dedicated-vm serviceinstancebycomparingtheIPAddressfromyourapplicationbindings.

Anexampleoutputfrom boshvms :

TargetthemanifestofyourdeployedRediswith bosh deployment PATH-TO-MANIFEST.yml .Ifyoudonothavethisfile,youcandownloaditbyrunning bosh download manifest DEPLOYMENT-NAME .

bosh ssh intothenodeyouwishtobackup(orthe cf-redis-broker nodeina shared-vm plan).

Onceyouhaveconnectedtothenode,amanualbackupcanbetriggeredwiththesesteps:

1. Switchtorootusing sudo -i .

2. Run /var/vcap/jobs/service-backup/bin/manual-backup

Notes

Triggeringamanualbackupofalargedump.rdbcouldtakesufficientlylongthatyourSSHconnectionwilltimeout.Ensurethatyouhavegivenyourselfenoughofatimeouttocompletethebackup.

MakingYourOwnBackupsItispossibletocreateabackupofaRedisinstancebyhand,bypassingtheautomatedbackuptoolaltogether.

Persistenceisenabledontheseplansthroughtheuseof RDB files,usingthefollowingRedisconfigrules:

save9001save30010save6010000

Shared-VMPlanYoucaneithertakethelatestRDBfileheldondisk,whichisgeneratedbytheabovetherules,ortriggerarecentupdatebyusingtheredis-cli totriggeraBGSAVE .Credentialstologintothe redis-cli canbeobtainedfrom VCAP_SERVICES foryourboundapplication.

©CopyrightPivotalSoftwareInc,2013-2018 32 1.7

The redis-cli islocatedin /var/vcap/packages/redis/bin/redis-cli .

Onthisplan,the BGSAVE commandisaliasedtoarandomstring.ThiscanbeobtainedfromOpsManagerinthecredentialstab.

StepstoBackup1. bosh ssh intoyourdesirednode.SeetheabovesectiononidentifyingthecorrectVM.

2. Changetorootusing sudo -i .

3. Copythecontentsofthe /var/vcap/store/cf-redis-broker directorytoa.zipor.tarfile.

4. Backupthefolder/compressedfiletoyourchosenlocation.

The /var/vcap/store/cf-redis-broker hassub-directoriesforeachinstancecreatedofthisplan.Thebackupfileforeachinstanceiscalled dump.rdb .

Forexample,herearetwoinstances:

root@66358f3e-3428-46df-9bb3-9acc7770b188:/var/vcap/store/cf-redis-broker#find-typef|xargsls-1./redis-data/3124f373-e9e2-44e1-ad12-a8865d8978b0/db/dump.rdb./redis-data/3124f373-e9e2-44e1-ad12-a8865d8978b0/redis.conf./redis-data/3124f373-e9e2-44e1-ad12-a8865d8978b0/redis-server.pid./redis-data/62333bf9-f023-4566-b233-6686f26b8f4d/db/dump.rdb./redis-data/62333bf9-f023-4566-b233-6686f26b8f4d/redis.conf./redis-data/62333bf9-f023-4566-b233-6686f26b8f4d/redis-server.pid./statefile.json

Dedicated-VMPlanYoucaneithertakethelatestRDBfileondisk,asgeneratedbytheaboverules,ortriggeramorerecentRDBfilebyexecutingtheBGSAVE commandusingthe redis-cli .Credentialscanbeobtainedfromthe VCAP_SERVICES fromyourboundapplication.The redis-cli canbefoundin/var/vcap/packages/redis/bin/redis-cli .

StepstoBackupbosh ssh intoyourdesirednode.SeetheabovesectiononidentifyingthecorrectVM.

Changetorootusing sudo -i .

Copythecontentsofthe /var/vcap/store/redis directorytoa.zipor.tarfile.

Backupthefolder/compressedfiletoyourchosenlocation.

Thebackupfilewillbenamed dump.rdb .

RestoreRedisInstancefromaBackup

ToaLocalSystemYoucanchoosetorestoretheRDBfiletoalocalRedisinstance.

Thestepstodothisdependonyourconfigurationandsetup.RefertotheRedisdocumentation formoredetails.

ToPivotalCloudFoundryYoucanalsorestoreyourbackupfiletoanotherinstanceofthe RedisforPCF tile.

Prerequisites

©CopyrightPivotalSoftwareInc,2013-2018 33 1.7

Sameresourceconfigurationastheinstancefromwhichyoubackedup.

Ensurethatthepersistentdiskislargeenoughttoaccommodatethetemporaryfilesusedduringtherestoreprocess.Itshouldbe3.5x the amount ofRAM in the VM.

Torestoreyourbackupfiletoanotherinstanceofa RedisforPCF tileserviceinstance:

1. Createanewinstanceoftheplanthatyouwishtorestoreto.

2. IdentifytheVMwhichtheinstanceofyourplanislocatedonbyfollowingthestepsfromtheManual Backups sectionabove.Ifyouarerestoringaninstanceof shared-vm ,thisVMisthebrokerVM.

3. bosh ssh intotheidentifiedVM.ThisisthebrokerVMifrestoringa shared-vm instance.

RedisforPCF version1.7andlaterprovidesascripttoautomaticallyrestoredatainanewlyprovisionedRedisinstance.

Preparation1. TransferyourbackupRDBfiletoalocalpathontheVM( PATH-TO-RDB-BACKUP-ON-VM hastobeunder /var/vcap/store .

2. ToverifythattheRDBfilehasn’tbeencorrupted,run md5sum PATH-TO-RDB-BACKUP-ON-VM andcompareitagainstthecontentsofthe .md5 filenamedafterthebackupfile.Thevaluesshouldbethesame.The .md5 fileislocatedinthesamebucketastheoriginalbackupfile.

3. Switchtorootuser sudo su

Dedicated-VMPlanTherestorescriptwillrestorethedataforthespecifieddedicated-vminstance.

Execution1. Run /var/vcap/jobs/redis-backups/bin/restore --sourceRDB PATH-TO-RDB-BACKUP-ON-VM .

2. Tailthescriptlogsat /var/vcap/sys/log/redis-backups/redis-backups.log toseeprogress.Whenthedatarestorehasbeensuccessfullycompleted,youwillseethemessage Redis data restore completed successfully .

Debugging

Thedatarestorescriptrunsthestepslistedbelow.Itlogsitsprocessalongthewayandprovideshelpfulmessagesincaseoffailure.

Thescriptlogsat /var/vcap/sys/log/redis-backups/redis-backups.log .Ifastephasfailed,resolvethereasonthatcausedittofailandexecutethefailedstepandeverynextstepmanually.Youcanretrieve {instance_password}

throughthebindingtoyourserviceinstance: cfservice-key{instance_name}{key_name}

1. StopAll

Run monit stop all

2. WaitForStop

Waitformonitservicestoenterthe not monitored state,youcanwatchthiswith watch monit summary

3. DeleteExistingPersistenceFiles

CleanupexistingRedisdatafiles:rm -f /var/vcap/store/redis/appendonly.aof

rm -f /var/vcap/store/redis/dump.rdb

4. CopyBackupFileWithCorrectPermissions

RestoreyourRedisbackupfileto /var/vcap/store/redis/dump.rdb andcorrecttheownerandpermissionswithchown vcap:vcap /var/vcap/store/redis/dump.rdb && chmod 660 /var/vcap/store/redis/dump.rdb

5. SetAppendOnly

Edit the template Redis config file with vim$(find/var/vcap/data/jobs/-nameredis.conf)`andmakethefollowinglinechanges:

©CopyrightPivotalSoftwareInc,2013-2018 34 1.7

appendonly yes -> appendonly no

6. StartAll

Run monit start all

7. WaitForStart

Waitformonitservicestoenterthe running state,youcanwatchthiswith watch monit summary

8. RewriteAOF

Run /var/vcap/packages/redis/bin/redis-cli -a {instance_password} BGREWRITEAOF

9. RewriteAOF

Run watch "/var/vcap/packages/redis/bin/redis-cli -a {instance_password} INFO | grep aof_rewrite_in_progress" untilaof_rewrite_in_progress is 0

10. StopAll

Run monit stop all

11. WaitForStop

Waitformonitservicestoenterthe not monitored state,youcanwatchthiswith watch monit summary

12. ChownToUserAndGroup

Setcorrectowneron appendonly.aof byrunning chown vcap:vcap /var/vcap/store/redis/appendonly.aof

13. SetAppendOnly

EditthetemplateRedisconfigfilewith vim $(find /var/vcap/data/jobs/ -name redis.conf) andmakethefollowinglinechanges:appendonly no -> appendonly yes

14. StartAll

Run monit start all

Shared-VMPlanTherestorescriptwillrestorethedataforthespecifiedshared-vminstance.

Execution1. Retrieve {instance_guid} byrunning: cf service {instance_name} --guid

2. Run /var/vcap/jobs/redis-backups/bin/restore --sourceRDB {path-to-rdb-backup-on-vm} --sharedVmGuid {instance_guid} .

3. Tailthescriptlogsat /var/vcap/sys/log/redis-backups/redis-backups.log toseeprogress.Whenthedatarestorehasbeensuccessfullycompleted,youwillseethemessage Redis data restore completed successfully .

Debugging

Thedatarestorescriptrunsthestepslistedbelow.Itlogsitsprocessalongthewayandprovideshelpfulmessagesincaseoffailure.

Thescriptlogsat /var/vcap/sys/log/redis-backups/redis-backups.log .Ifastephasfailed,resolvethereasonthatcausedittofailandexecutethefailedstepandeverynextstepmanually.Youcanretrieve {instance_password}

and {port} throughthebindingtoyourserviceinstance: cfservice-key{instance_name}{key_name}

1. StopAll

Run monit stop all

2. WaitForStop

Waitformonitservicestoenterthe not monitored state,youcanwatchthiswith watch monit summary

3. SetConfigCommand

EditthetemplateRedisconfigfilewith vim /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/redis.conf andcommentout

©CopyrightPivotalSoftwareInc,2013-2018 35 1.7

theline:rename-command CONFIG "configalias" -> #rename-command CONFIG "configalias"

4. SetRewriteCommand

EditthetemplateRedisconfigfilewith vim /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/redis.conf andcommentouttheline:

rename-command BGREWRITEAOF "" -> #rename-command BGREWRITEAOF ""

5. DeleteExistingPersistenceFiles

CleanupexistingRedisdatafilesiftheyexist:rm -f /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/db/appendonly.aof

rm -f /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/db/dump.rdb

6. CopyBackupFileWithCorrectPermissions

RestoreyourRedisbackupfileto /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/db/dump.rdb andcorrecttheownerandpermissionswithchown vcap:vcap /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/db/dump.rdb && chmod 660 /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/db/dump.rdb

7. SetAppendOnly

EditthetemplateRedisconfigfilewith vim /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/redis.conf andmakethefollowinglinechanges:

appendonly yes -> appendonly no

8. StartAll

Run monit start all

9. WaitForStart

Waitformonitservicestoenterthe running state,youcanwatchthiswith watch monit summary

10. RewriteAOF

Run /var/vcap/packages/redis/bin/redis-cli -a {instance_password} BGREWRITEAOF

11. RewriteAOF

Run watch "/var/vcap/packages/redis/bin/redis-cli -a {instance_password} INFO | grep aof_rewrite_in_progress" untilaof_rewrite_in_progress is 0

12. StopAll

Run monit stop all

13. WaitForStop

Waitformonitservicestoenterthe not monitored state,youcanwatchthiswith watch monit summary

14. ChownToUserAndGroup

Setcorrectowneron appendonly.aof byrunning chown vcap:vcap /var/vcap/store/redis/appendonly.aof

15. SetAppendOnly

EditthetemplateRedisconfigfilewith vim /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/redis.conf andmakethefollowinglinechanges:

appendonly no -> appendonly yes

16. SetConfigCommand

EditthetemplateRedisconfigfilewith vim /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/redis.conf anduncommenttheline: #rename-command CONFIG "configalias" -> rename-command CONFIG "configalias"

17. SetRewriteCommand

EditthetemplateRedisconfigfilewith vim /var/vcap/store/cf-redis-broker/redis-data/{instance_guid}/redis.conf anduncommenttheline: #rename-command BGREWRITEAOF "" -> rename-command BGREWRITEAOF ""

18. StartAll

Run monit start all

©CopyrightPivotalSoftwareInc,2013-2018 36 1.7

RecoveringRedisInstancesIntheeventofarecoveryofCloudFoundry,itispossibletorecoverboundRedisinstancestohealthystatesthatareinsyncwithCloudFoundry.Thereareafewcaveatstobeingabletorecoverpreviousinstancestatefullythatdependonyourplan.

Shared-VMPlanCaveatsYouneedabackedupRDBRedisdumpfile-thiswouldbestoredinyourS3bucketsifyouhavebackupsconfigured

Youneedabackedup /var/vcap/store/cf-redis-broker/redis-data directoryfromtheservicebrokernode(youdonotneedtobackupand*.aof or *.rdb filesfromsubdirectoriesifyouhavebackupsconfigured)

Dedicated-VMPlanCaveatsYouneedabackedupRDBRedisdumpfile-thiswouldbestoredinyourS3bucketsifyouhavebackupsconfigured

Youneedabackedup /var/vcap/store/redis/statefile.json fromtheservicebrokernode

NoteThisprocedureassumesthatarecoveryofserviceinformationandservicekeysassignedtoinstancesarerestoredwitharestoreofCloudFoundry.

RecoveryProcedureAfterredeployingRedis,takethefollowingsteps.

Shared-VMPlan1. bosh ssh intotheservicebrokernodeofyourRedisdeployment

2. Run monit stop all && pkill redis-server

3. Waitformonitservicestoenterthe not monitored state,youcanwatchthiswith watch monit summary

4. Confirmnorunninginstancesof redis-server with ps aux | grep redis-server

5. Copythebackedup redis-data directoryinto /var/vcap/store/cf-redis-broker

6. Followtheinstructionshereforyourplan,skippingthefirstfourstepsdescribedhere,forrestoringyourbackedupRedisdata

7. YourRedisinstanceisnowrecovered

Dedicated-VMPlan1. bosh ssh intotheservicebrokernodeofyourRedisdeployment

2. Run monit stop all

3. Waitformonitservicestoenterthe not monitored state,youcanwatchthiswith watch monit summary

4. Copythebackedup /var/vcap/store/cf-redis-broker/statefile.json andensureownershipandpermissionsarecorrectwithchown vcap:vcap /var/vcap/store/redis/dump.rdb && chmod 660 /var/vcap/store/redis/dump.rdb

5. Followtheinstructionshereforyourplan,skippingthefirstthreestepsdescribedhere,forrestoringyourbackedupRedisdata

6. YourRedisinstanceisnowrecovered

©CopyrightPivotalSoftwareInc,2013-2018 37 1.7

©CopyrightPivotalSoftwareInc,2013-2018 38 1.7

Monitoring Redis for PCFThePCFFirehoseemitsRedismetrics.

ConfiguringSecureCommunicationRedisforPCFv1.7.2letstheoperatorturnon/offTLScommunicationsformetrics,viaa Usenon-securecommunicationformetrics checkboxonthemetricsconfigurationpageinOpsManager.ConfigurethischeckboxfordifferentversionsofPCFasfollows:

PCF v1.8:SelectthischeckboxtosendmetricstotheFirehose.

PCF v1.9:ClearthischeckboxtosendmetricstotheFirehosesecurely,orselectittosendmetricsinsecurely.

PCF v1.10 and later:ClearthischeckboxtosendmetricstotheFirehoseandavoiderrors.

Settingthischeckboxincorrectlycancausea Cannotgeneratemanifest...unknownproperty"cf_etcd_client_cert"

error:

PollingIntervalThemetricspollingintervaldefaultsto30seconds.ThiscanbechangedbynavigatingtotheMetricsconfigurationpageandenteringanewvalueinMetrics polling interval (min: 10).

Third-partymonitoringtoolscanconsumeRedismetricstomonitorRedisperformanceandhealth.ForanexampleDatadogconfigurationthatdisplayssomeofthesignificantmetricsoutlinedbelow,seetheCFRedisexampledashboard .Pivotaldoesnotendorseorprovidesupportforanythirdpartysolution.

ThefollowingexampleshowsthenumberofavailableinstancesfortheDedicated-VMplanmetric:

©CopyrightPivotalSoftwareInc,2013-2018 39 1.7

origin:"p-redis"eventType:ValueMetrictimestamp:1480084323333475533deployment:"cf-redis"job:"cf-redis-broker"index:"3be5f4b9-cdf3-45c4-a3b2-19d923d63a01"ip:"10.0.1.49"valueMetric:<name:"/p-redis/service-broker/dedicated_vm_plan/available_instances"value:4unit:"">

RedisMetricsRedisemitsanumberofmetricsthatcanbeusedtomonitorthehealthandperformanceofyourRedisdeployment.

keyspace_hits

Description Numberofsuccessfullookupsofkeysinthemaindictionary.“/p-redis/info/stats/keyspace_hits”

Significance Inconjunctionwith keyspace_misses ,itcanbeusedtocalculatethehitratio.

Notes Asuccessfullookupisalookuponakeythatexists.

keyspace_misses

Description Numberofunsuccessfullookupsofkeysinthemaindictionary.“/p-redis/info/stats/keyspace_misses”

Significance Inconjunctionwith keyspace_hits ,itcanbeusedtocalculatethehitratio.

Notes Anunsuccessfullookupisalookuponakeythatdoesnotexist.

used_memory

Description NumberofbytesallocatedbyRedis.“/p-redis/info/memory/used_memory”

Significance Growsasthenumberofunsavedkeysincreases.

maxmemory

Description MaximumnumberofbytesavailableinRedis.“/p-redis/info/memory/maxmemory”

Significance IndicatesthemaxmemoryavailableinRedis.

blocked_clients

Description Numberofconnectedclientspendingonablockingcall.“/p-redis/info/clients/blocked_clients”

Significance Canbeusedasanindicatortodetectdeadlocks.

connected_clients

Description NumberofclientsconnectedtotheRedisinstance.“/p-redis/info/clients/connected_clients”

rdb_changes_since_last_save

Description Numberofkeyscurrentlyinmemory.“/p-redis/info/persistence/rdb_changes_since_last_save”

Significance Memoryusagegrowsinproportiontothenumberofkeysinmemory.IftheRedisinstanceisstoppedungracefully,thesechangesmaybelost.

Notes Performinga BGSAVE writesthesekeystodiskandfreesupmemory.

©CopyrightPivotalSoftwareInc,2013-2018 40 1.7

total_commands_processed

Description TotalnumberofcommandsprocessedbyRedis.“/p-redis/info/stats/total_commands_processed”

Significance Acrudeindicatorofactivity.Canbeusedinconjunctionwith uptime_in_seconds .

mem_fragmentation_ratio

Description RatioofmemoryallocatedbytheoperatingsystemtothememoryrequestedbyRedis.“/p-redis/info/memory/mem_fragmentation_ratio”

Significance Aratioinexcessof1.5indicatesexcessivefragmentation,withyourRedisinstanceconsuming150%ofthephysicalmemoryitrequested..

total_instances

Description Totalnumberof dedicated-vm instancesofRedis.“/p-redis/service-broker/dedicated_vm_plan/total_instances”

Significance Usedinconjunctionwith available_instances ,providesinformationaboutusedinstances.

available_instances

Description Numberofavailable dedicated-vm instancesofRedis.“/p-redis/service-broker/dedicated_vm_plan/available_instances”

Significance Ifzero,nomoreinstancesareavailable.

total_instances

Description Totalnumberof shared-vm instancesofRedis.“/p-redis/service-broker/shared_vm_plan/total_instances”

Significance Usedinconjunctionwith available_instances ,providesinformationaboutusedinstances.

available_instances

Description Numberofavailable shared-vm instancesofRedis.“/p-redis/service-broker/shared_vm_plan/available_instances”

Significance Ifzero,nomoreinstancesareavailable.

OtherMetricsRedisalsoexposesthefollowingmetrics.formoreinformation,seetheRedisdocumentation .

arch_bits

uptime_in_seconds

uptime_in_days

hz

lru_clock

client_longest_output_list

client_biggest_input_buf

used_memory_rss

used_memory_peak

used_memory_lua

©CopyrightPivotalSoftwareInc,2013-2018 41 1.7

mem_fragmentation_ratio

loading

rdb_bgsave_in_progress

rdb_last_save_time

rdb_last_bgsave_time_sec

rdb_current_bgsave_time_sec

aof_rewrite_in_progress

aof_rewrite_scheduled

aof_last_rewrite_time_sec

aof_current_rewrite_time_sec

total_connections_received

total_commands_processed

instantaneous_ops_per_sec

total_net_input_bytes

total_net_output_bytes

instantaneous_input_kbps

instantaneous_output_kbps

rejected_connections

sync_full

sync_partial_ok

sync_partial_err

expired_keys

evicted_keys

keyspace_hits

keyspace_misses

pubsub_channels

pubsub_patterns

latest_fork_usec

migrate_cached_sockets

connected_slaves

master_repl_offset

repl_backlog_active

repl_backlog_size

repl_backlog_first_byte_offset

repl_backlog_histlen

used_cpu_sys

used_cpu_user

used_cpu_sys_children

used_cpu_user_children

cluster_enabled

rdb_last_bgsave_status

aof_last_bgrewrite_status

aof_last_write_status

©CopyrightPivotalSoftwareInc,2013-2018 42 1.7

Troubleshooting Redis for PCFThistopicliststroubleshootinginformationrelevanttoRedisforPCF.

TroubleshootingGuidesforPCFGeneraltroubleshootingguidesforPivotalCloudFoundry:

PCF1.8

PCF1.7

PCF1.6

KnowledgeBaseArticlesPivotalKnowledgeBase articlesspecificallyaboutRedisforPCF:

Can’tredeployPCFRedisifshared-vmpersistentdiskfull

Issuewithupgradingtile

Issuewithdeployfailing

RedisInstanceAliveafterSuccessfulDe-provisioning

PCFRedisdedicatedinstancefailstopersisttodisk

RediserrorwhensavingchangesafterabacktoAWSS3:Error:AccessDeniedforbucket’

OtherIssues

ErrorCannot generate manifest for product Redis: Error in (( .properties.metrics_disable_etcd_tls.value? .properties.null_string.value : ..cf.properties.cf_etcd_client_cert.cert_pem )): unknownproperty "cf_etcd_client_cert" (Product "Redis" / Job: nil)

Cause YouareusingPCF1.10anddidnotuntickthe`Usenon-securecommunicationformetrics`checkboxonthemetricsconfigurationpageinOpsManager.

Solution Pleaseuntickthecheckboxandredeploy.Seehere formoreinformation.

Error Failed to target Cloud Foundry

Cause YourPivotalCloudFoundryisunresponsive

Solution ExaminethedetailederrormessageinthelogsandcheckthePCFTroubleshootingGuide foradvice

Error Failed to bind Redis service instance to test app

Cause Yourdeployment’sbrokerhasnotbeenregisteredwithPivotalCloudFoundry

Solution Examinethebroker-registrarinstallationstepoutputandtroubleshootanyproblems.

UsefulDebuggingInformationIfyouencounteranissue,hereisalistofusefulinformationtogather,especiallybeforeyouperformanydestructiveoperationssuchascfpurge-service-offerings or boshdelete

deployment.

PCFRedisversion

PreviousPCFRedisversionifupgrading

OpsManagerversion,andpreviousifupgradingOpsManager

IaaSdescription

©CopyrightPivotalSoftwareInc,2013-2018 43 1.7

FromOpsManager:Theinstallationlogs

Acopyofallfilesin /var/tempest/workspaces/default/deployments

ForallVMs,unlessspecifiedotherwise:Copyof /var/vcap/sys/log (particularlythebroker)

Ifunabletogetlogsfromdisk,logsfromaforwardedendpoint

monit summary

Full ps aux -Hasmonitdoneitsjob?

ps aux | grep redis-serve[r] -AreRedisinstancesrunning?

df -h -diskusage

free -m -memoryusage

cf m

tree /var/vcap/store/cf-redis-broker/redis-data (brokeronly)

Copyof /var/vcap/store/cf-redis-broker/statefile.json (brokeronly)

©CopyrightPivotalSoftwareInc,2013-2018 44 1.7

For App Developers

RedisConfigurationRedisisconfiguredwithamaxmemory-policyofno-eviction.Thispolicymeansthattheoncememoryisfull,theservicewillnotevictanykeysandnowriteoperationswillbepossibleuntilmemorybecomesavailable.PersistenceisconfiguredforbothRDBandAOF.Thedefaultmaximumnumberofconnections,maxclients,issetat10000butthisnumberisadjustedbyRedisaccordingtothenumberoffilehandlesavailable.Replicationandeventnotificationarenotconfigured.

ServicePlansPCFRedisoffersDedicatedVMandSharedVMplans.Thememoryallocatedtotheplansisdeterminedbytheoperatoratdeploytime.Formoreinformationontheplansseethearchitectureandrecommendedusagepages.

UsingRedisforPCFInstructionsforcreating,bindingto,anddeletinganinstanceofthededicated-VMorshared-VMplanarehere.

GettingStarted

UsingPCFRediswithSpringSpringCloudConnectors canconnecttoPCFRedis.SpringCloudCloudFoundryconnectors willautomaticallyconnecttoPCFRedis.

PCFDevPCFDevisasmallfootprintversionofPCFthat’ssmallenoughtorunonalocaldevelopermachine.Moreinfoherehttps://pivotal.io/pcf-dev .

RedisExampleAppSamplerubycodethatusesPCFcanbefoundhere https://github.com/pivotal-cf/cf-redis-example-app .

RedisTolearnmoreaboutRedisitself,visitredis.io .

©CopyrightPivotalSoftwareInc,2013-2018 45 1.7

Using Redis for PCFRedisforPCFcanbeusedbothviaPivotalAppsManagerandtheCLI,bothmethodsareoutlinedbelow.AnexampleapplicationhasalsobeencreatedtohelpapplicationdevelopersgetstartedwithRedisforPCF,andcanbedownloadedhere .

SeeRedisforPCFRecommendedUsageforrecommendationsregardingRedisforPCFserviceplans,andmemoryallocation.

CreatingaRedisServiceInstanceThefollowingproceduredescribeshowtocreateaRedisserviceinstanceinthePivotalCloudFoundryElasticRuntimeenvironment.

AvailablePlansBeforecreatingaRedisinstance,itisworthbeingawareofthetwoavailableplans:

Plan Name Suitable for Tenancy Model perInstance

HighlyAvailable

BackupFunctionality

Shared-VM Lighterworkloadsthatdonotrequirededicatedresources

SharedVM No Yes

Dedicated-VM

Increasedworkloadsthatrequirededicatedresources DedicatedVM No Yes

UsingPivotalAppsManager1. FromwithinPivotalAppsManager,selectMarketplacefromtheleftnavigationmenuunderSpaces.TheServicesMarketplacedisplays.

2. SelectRedisfromthedisplayedtilesandclicktoviewtheavailableplans .

3. ClickontheappropriateSelect this planbuttontoselecttherequiredRedis Service Plan.

4. IntheInstanceNamefield,enteranamethatwillidentifythisspecificRedisserviceinstance.

5. FromtheAddtoSpacedrop-downlist,selectthespacewhereyouorotheruserswilldeploytheapplicationsthatwillbindtotheservice.

6. ClicktheAddbutton.

UsingtheCLI1. Run cfmarketplace toviewtheavailableserviceplans:

$cfmarketplace

Gettingservicesfrommarketplaceinorgsystem/spaceapps-managerasadmin...OK

serviceplansdescriptionp-redisshared-vm,dedicated-vmRedisservicetoprovideakey-valuestore

TIP:Use'cfmarketplace-sSERVICE'toviewdescriptionsofindividualplansofagivenservice.

2. Run cfcreateservice tocreatetheserviceplan.IncludetheserviceplannameaslistedintheServicesMarkeplaceandadescriptivenameyouwanttousefortheservice:

$cfcreate-servicep-redisSERVICE-PLAN-NAMESERVICE-INSTANCE-NAME

Forexample:

$cfcreate-servicep-redisshared-vmredis

©CopyrightPivotalSoftwareInc,2013-2018 46 1.7

BindinganApplicationtotheRedisServiceThefollowingproceduresdescribehowtobindaRedisserviceinstancetoyourPivotalCloudFoundryapplication.ThiscanbedoneviathePivotalAppsManagerorUsingthePivotalCloudFoundryCLI.

UsingPivotalAppsManager1. Selecttheapplicationthatyouwishtobindtotheservice.Apagedisplaysshowingthealreadyboundservicesandinstancesforthisapplication.

2. ClickBind.Alistofavailableservicesdisplays.

3. ClicktheBindbuttonfortheRedisserviceyouwanttobindtothisapplication.

4. Startorrestageyourappfromthecommandline:

$cfrestageAPPLICATION-NAME

UsingtheCLI1. Run cfservices toviewrunningserviceinstances.

$cfservices

Gettingservicesinorgsystem/spaceapps-managerasadmin...OK

nameserviceplanboundappslastoperationmy-redis-instancep-redisshared-vmcreatesucceeded

2. Run cfbind-service tobindtheapplicationtotheserviceinstance.

$cfbind-serviceAPPLICATION-NAMESERVICE-INSTANCE-NAME

Forexample:

$cfbind-servicemy-applicationredis

3. Run cfrestage torestageyourapplication.

$cfrestageAPPLICATION-NAME

EntriesintheVCAP_SERVICESEnvironmentVariableApplicationsrunninginCloudFoundrygainaccesstotheboundserviceinstancesviaanenvironmentvariablecredentialshashcalledVCAP_SERVICES.Anexamplehashisshowbelow:

©CopyrightPivotalSoftwareInc,2013-2018 47 1.7

{"p-redis":[{"credentials":{"host":"10.0.0.11","password":"<redacted>","port":6379},"label":"p-redis","name":"redis","plan":"dedicated-vm","provider":null,"syslog_drain_url":null,"tags":["pivotal","redis"],"volume_mounts":[]}]}

Youcansearchforyourservicebyits name ,givenwhencreatingtheserviceinstance,ordynamicallyviathe tags or label properties.

DeletingaRedisInstanceWhenyoudeleteaRedisserviceinstance,allapplicationsthatareboundtothatserviceareautomaticallyunboundandanydataintheserviceinstanceiscleared.

UsingPivotalAppsManager1. LocatetherowunderServicesthatcontainstheserviceinstanceyouwanttodeleteandclickDelete.

2. Ifyouhadapplicationsthatwereboundtothisservice,youmayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffect.

$cfrestageAPPLICATION-NAME

UsingtheCLI1. Run cfdelete-service andincludetheserviceinstancenamethatyouwouldliketodelete.Enter y whenpromptedtoconfirm.

$cfdelete-serviceSERVICE-INSTANCE-NAME

Forexample:

$cfdelete-servicemy-redis-instance

Reallydeletetheservicemy-redis-instance?>yDeletingservicemy-redis-instanceinorgsystem/spaceapps-managerasadmin...OK

2. Ifyouhadapplicationsthatwereboundtothisservice,youmayneedtorestageorre-pushyourapplicationfortheapplicationchangestotakeeffect.

$cfrestageAPPLICATION-NAME

©CopyrightPivotalSoftwareInc,2013-2018 48 1.7

Sample Redis ConfigurationThefollowingisa redis.conf filefromaDedicated-VMplaninstance:

daemonizeyespidfile/var/vcap/sys/run/redis.pidport6379tcp-backlog511timeout0tcp-keepalive0loglevelnoticelogfile/var/vcap/sys/log/redis/redis.logsyslog-enabledyessyslog-identredis-serversyslog-facilitylocal0databases16save9001save30010save6010000stop-writes-on-bgsave-erroryesrdbcompressionyesrdbchecksumyesdbfilenamedump.rdbdir/var/vcap/store/redisslave-serve-stale-datayesslave-read-onlyyesrepl-diskless-syncnorepl-diskless-sync-delay5repl-ping-slave-period10repl-timeout60repl-disable-tcp-nodelaynoslave-priority100maxmemory-policynoevictionappendonlyyesappendfilenameappendonly.aofappendfsynceverysecno-appendfsync-on-rewritenoauto-aof-rewrite-percentage100auto-aof-rewrite-min-size64mbaof-load-truncatedyeslua-time-limit5000slowlog-log-slower-than10000slowlog-max-len128latency-monitor-threshold0notify-keyspace-events""hash-max-ziplist-entries512hash-max-ziplist-value64list-max-ziplist-entries512list-max-ziplist-value64set-max-intset-entries512zset-max-ziplist-entries128zset-max-ziplist-value64hll-sparse-max-bytes3000activerehashingyesclient-output-buffer-limitnormal000client-output-buffer-limitslave256mb64mb60client-output-buffer-limitpubsub32mb8mb60hz10aof-rewrite-incremental-fsyncyesrename-commandCONFIG"A-B-Ab1AZec_-AaC1A2bAbB22a_a1Baa"rename-commandSAVE"SAVE"rename-commandBGSAVE"BGSAVE"rename-commandDEBUG""rename-commandSHUTDOWN""rename-commandSLAVEOF""rename-commandSYNC""requirepass1a1a2bb0-0ccc-222a-444b-1e1e1e1e2222maxmemory1775550873

©CopyrightPivotalSoftwareInc,2013-2018 49 1.7