LATEST VERSION: 1.1 - CHANGELOG
Redis for PCF v1.10

Installing Redis for PCF

Page last updated:

Download and Install the Tile

To add Redis for Pivotal Cloud Foundry (PCF) to Ops Manager, follow the procedure for adding PCF Ops Manager tiles:

  1. Download the product file from Pivotal Network. Select the latest release from the Releases: drop-down menu.
  2. Upload the product file to your Ops Manager installation.
  3. Click Add next to the uploaded product description in the Available Products view to add this product to your staging area.
  4. (Optional) Click the newly added tile to configure your possible service plans, syslog draining, and backups.
  5. Click Apply Changes to install the service.

See the network configuration section for guidance on the ports and ranges used in the Redis service.

Configure Redis for PCF Service Plans

Select the Redis tile in the Ops Manager Installation Dashboard to display the configuration page, and allocate resources to Redis service plans.

config overview

On-Demand Service

  1. Create a service network. From an IAAS perspective, creation of a service network is identical to any other network previously created for tiles on Ops Manager. The only change is that the Operator needs to mark the network as a “Service Network” in Ops Manager to instruct Ops Manager to not perform IP management in that network. If you wish to use Redis for PCF without the On-Demand service, you will still need to create an empty service network to install the tile.
  2. Click On-Demand Service Settings, and then enter the Maximum service instances across all on-demand plans. The maximum number of instances you set for all your cache plans combined cannot exceed this number.

    settings

    Review the guidance to understand the resource implications for on-demand instances. See Resource Usage Planning for On-Demand plans.
  3. Enable the Allow outbound internet access from service instances checkbox. This checkbox must be ticked to allow external log forwarding, sending backup artifacts to external destinations, and communicating with an external BOSH blob store.
  4. Click Cache Plan 1, 2, or 3 to configure it.

    You can configure up to three cache plans with appropriate memory and disk sizes for your use case(s). Resource configuration options may vary on different IAASs.

    The default names of the three cache plans provided reflect that instances of these plans are intended to be used for different cache sizes, as follows:

    • cache-small: A Redis instance deployed to a dedicated VM, suggested to be configured with ~1 GB of memory and >3.5 GB of persistent disk
    • cache-medium: A Redis instance deployed to a dedicated VM, suggested to be configured with ~2 GB of memory and >10 GB of persistent disk
    • cache-large: A Redis instance deployed to a dedicated VM, suggested to be configured with ~4 GB of memory and >14 GB of persistent disk

    on demand config Configure the following settings for your cache plan(s). Any pre-populated default settings have been pre-configured according to the memory/disk size of each plan.

    Field Description
    Plan Select Active or Passive. An inactive plan does not need any further configuration.
    Plan Name Enter a name that will appear in the service catalog.
    Plan Description Enter a description that will appear in the service catalog. Specify details that will be relevant to app developers.
    Plan Quota App developers can create instances until this quota is reached.
    CF Service Access Select a service access level. This setting does not modify the permissions that have been previously set, and allows for manual access to be configured from the CLI.
    AZ to deploy Redis instances of this plan This is the AZ in which to deploy the Redis instances from the plan. This must be one of the AZs of the service network (configured in the Ops Manager Director tile).
    Server VM type Select the VM type. Pivotal recommends that the persistent disk should be at least 3.5x the VM memory.
    Server Disk type Select the disk type. Pivotal recommends that the persistent disk should be at least 3.5x the VM memory.
    Redis Client Timeout Redis Client Timeout refers to the server timeout for an idle client specified in seconds. The default setting is 3600. Adjust this setting as needed.
    Redis TCP Keepalive Redis TCP Keepalive refers to the interval (in seconds) at which TCP ACKS are sent to clients. The default setting is 60. Adjust this setting as needed.
    Max Clients Max Clients refers to the maximum number of clients that can be connected at any one time. Per plan, the default setting is 1000 for small, 5000 for medium and 10000 for large. Adjust this setting as needed.
    Lua Scripting Enable or disable Lua Scripting as needed. Pivotal recommends that Lua Scripting be disabled.

  5. Click the Save button.

Updating On-Demand Service Plans

Operators can update certain settings after the plans have been created. If the Operator updates the VM size, disk size, or the Redis configuration settings (enabling Lua Scripting, max-clients, timeout and TCP keep-alive), these settings will be implemented in all instances that are already created.

Operators should not downsize the VMs or disk size as this can cause data loss in pre-existing instances. Additionally, Operators cannot make a plan that was previously active, inactive, until all instances of that plan have been deleted.

Removing On-Demand Service Plans

If you want to remove the On-Demand Service from your tile, do the following:

  1. Go to the Resource Config page on the Redis for PCF tile, and set the Redis On-Demand Broker job instances to 0.

  2. Navigate to the Errands page on the Redis for PCF tile, and set the following errands to off:

    • Register On-demand Redis Broker
    • On-demand Broker Smoke Tests
    • Upgrade all On-demand Redis Service Instances
    • Deregister On-demand Redis Broker
  3. Create an empty service network. For instructions, see this Knowledge Base article.

  4. Go to each of the three Cache Plan pages on the Redis for PCF tile, and set each cache plan to Plan Inactive. For example: cache plan inactive

Shared-VM Plan

  1. Select the Shared-VM Plan tab to configure the memory limit for each Redis instance and the maximum number of instances that can be created. shared vm config

  2. Enter the maximum number of instances and the memory limit for each Redis instance.


    Shared-VM instances run on the Redis Broker. The memory and instance limits for your Shared-VM Redis instances depends on the total memory of your Redis broker.


    When configuring the maximum number of Redis service instances that can be created you need to take into account the maximum memory each redis instance could use in correlation with how much total memory the Redis broker has. Pivotal recommends you only allow up to 45% of your Redis broker’s total memory to be used by all Redis instances. This is due the amount of memory required to support Redis persistence, and run Redis broker & system tasks.


    See below for example cases:

    Redis Broker Total Memory Redis Instance Memory Limit Redis Service Instance Limit
    16 GB 512 MB 14
    16 GB 256 MB 28
    64 GB 512 MB 56


    It is possible to configure a larger Redis Service Instance Limit, if you are confident that the majority of the deployed instances will not be using a large amount of their allocated memory, for example in development or test environments.

    Note: This is not supported, and could cause your server to run out of memory. If this happens your users may not be able to write any further data to any Redis instance.

  3. Click the Save button.

  4. You must disable the On-Demand Service if you do not wish to use it. Please see the directions here.

  5. Select the Resource Config tab to change the allocation of resources for the Redis Broker.
    The Redis Broker server will run all of the Redis instances for your Shared-VM plan. From this screen you may increase or decrease the CPU, RAM, Ephemeral Disk & Persistent Disk made available, as required.

Dedicated-VM Plan

  1. Select the Resource Config tab to change the allocation of resources for the Dedicated Node. dedicated vm config


    By default, 5 dedicated nodes will be created, each capable of running one Redis instance. You can increase or decrease the number of dedicated nodes, the size of the Persistent and Ephemeral Disks, and the CPU and RAM, as required. The default VM size is small; it is important that the operator set the correct VM size to handle anticipated loads. Redis maxmemory is set to 45% of RAM. It is recommended the persistent disk be set to 3.5x the amount of RAM.

  2. Click the Save button.

  3. You must disable the On-Demand Service if you do not wish to use it. Please see the directions here.

Configure Resources for Shared-VM and Dedicated-VM Plans

The following are the default resource and IP requirements for Redis for PCF when using the Shared-VM or Dedicated-VM plans:

Product Resource Instances CPU Ram Ephemeral Persistent Static IP Dynamic IP
Redis Redis Broker 1 2 3072 4096 9216 1 0
Redis Dedicated Node 5 2 1024 4096 4096 1 0
Redis Broker Registrar 1 1 1024 2048 0 0 1
Redis Broker De-Registrar 1 1 1024 2048 0 0 1
Redis Compliation 2 2 1024 4096 0 0 1

Notes:

  • The shared-vm plan is on the Redis Broker resource
  • The dedicated-vm plan is on the Dedicated Node resource

Additional Redis Configurations

The operator can configure further properties per plan beyond memory and disk sizes. Appropriate defaults have been pre-configured according to the memory/disk size of each plan.

Operators can update certain plan settings after the plans have been created. If the Operator updates the VM size, disk size, or the Redis configuration settings (enabling Lua Scripting, max-clients, timeout and TCP keep-alive), these settings will be implemented in all instances already created. Operators should not downsize the VMs or disk size as this can cause data loss in pre-existing instances.

The following table describes properties that operators can update in the configuration page.

Property Default Description
Redis Client Timeout 3600 Server timeout for an idle client specified in seconds (e.g., 3600)
Redis TCP Keepalive 60 The max number of connected clients at the same time
Max Clients 1000/5000/10000 (small/medium/large) The max number of connected clients at the same time
Lua Scripting Enabled Enable/Disable Lua scripting
Plan Quota 20 Maximum number of Redis service instances for this plan, across all orgs and spaces

For settings that app developers can configure, see Customize an On-Demand Service Instance.

Configure Syslog Forwarding

Pivotal recommends that operators configure syslog forwarding to a remote destination. Forwarding your system logs to a remote destination enables:

  • Viewing logs from every VM in the Redis for PCF deployment in one place
  • Effective troubleshooting when logs are lost on the source VM
  • Setting up alerts for important error logs to monitor the deployment

Follow these steps to configure syslog forwarding:

  1. Click the Redis for PCF tile to display the configuration page, and then click the Syslog tab on the sidebar navigation.


    syslog configuration

  2. Select either the Yes without encryption or the Yes with TLS encryption radio button.

    Note: To use syslog for on-demand instances you must enable outbound internet access in the On-Demand Service Settings tab.

  3. Enter the Syslog address and port, and select the transport protocol of your remote destination. You can only use TCP if you are using TLS encryption.

    The information required for these fields is provided by your remote destination. Address should be something such as logs.papertrailapp.com, and the port will be a number such as 41635.

  4. Select the format for your logs. RFC5424 is the suggested format.

    For instances of the Redis on-demand plan, all logs follow RFC5424 format. Instances of the Dedicated-VM and Shared-VM plans allow for the Operator to select their log format to be either their legacy format or RFC5424. PCF is moving toward all syslogs consistently using RFC5424 format.

  5. If you selected Yes with TLS encryption, complete these fields:

    • Permitted Peer refers to the remote syslog destination. It allows each VM to establish an encrypted tunnel with the remote syslog destination. The Permitted Peer is either the accepted fingerprint (SHA1) or name of the remote peer, for example *.example.com.
    • TLS CA certificate refers to the trusted certificate authorities for the remote syslog destination. Large certificate chains (> 8kb) are not supported.
  6. Click Save.

Networks, Security, and Assigning AZs

Network Configuration

Pivotal recommends that each type of Redis for PCF service run in its own network. For example, run a Redis for PCF on-demand service on a separate network from a Redis for PCF shared-VM service.

The following ports and ranges are used in this service:

Port Protocol Direction and Network Reason
8300
8301
TCP
TCP and UDP
Inbound to CloudFoundry network, outbound from service broker and service instance networks* Communication between the CF consul_server and consul_agents on Redis deployment; used for metrics
4001 TCP Inbound to CloudFoundry network, outbound from service broker and service instance networks* Used by the Redis metron_agent to forward metrics to the CloudFoundry etcd server
12350 TCP Outbound from CloudFoundry to the cf-redis-broker service broker network (Only if using a cf-redis-broker) Access to the cf-redis-broker from the cloud controllers.
12345 TCP Outbound from CloudFoundry to the on-demand service broker network (Only if using an On-Demand service) For access to the on-demand service broker from the cloud controllers
6379 TCP Outbound from CloudFoundry to any service instance networks (dedicated-node and on-demand) Access to all dedicated nodes and on-demand nodes from the Diego Cell and Diego Brain network(s)
32768-61000 TCP Outbound from CloudFoundry to the cf-redis-broker service broker network From the Diego Cell and Diego Brain network(s) to the service broker VM. This is only required for the shared service plan.
80 or 443
(Typically)
http or https
respectively
Outbound from any service instance networks Access to the backup blobstore
8443
25555
TCP Outbound from any on-demand service broker network to the bosh director network For the on-demand service, the on-demand service broker needs to talk to bosh director

* Typically the service broker network and service instance network(s) are the same.

Application Security Groups

To allow this service to have network access you must create Application Security Groups (ASGs). Ensure your security group allows access to the Redis Service Broker VM and Dedicated VMs configured in your deployment. You can obtain the IP addresses for these VMs in Ops Manager under the Resource Config section for the Redis tile.

Note: Without ASGs, this service is unusable.

Application Container Network Connections

Application containers that use instances of the Redis service require the following outbound network connections:

Destination Ports Protocol Reason
ASSIGNED_NETWORK 32768-61000 tcp Enable application to access shared vm service instance
ASSIGNED_NETWORK 6379 tcp Enable application to access dedicated vm service instance

Create an ASG called redis-app-containers with the above configuration and bind it to the appropriate space or, to give all started apps access, bind to the default-running ASG set and restart your apps. Example:

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

Assigning AZs

As of Redis for PCF 1.9, you can assign multiple AZs to Redis jobs, however this will not guarantee high availability.

For more information, see About Multiple AZs in Redis for PCF.

AZ Assignment Diagram

Validating Installation

Smoke tests are run as part of Redis for PCF installation to validate that the install succeeded. Smoke tests are described here.

Uninstalling Redis for PCF

To uninstall Redis for PCF, do the following:

  1. In the PCF Ops Manager Installation dashboard, click the trash can icon in the lower right hand corner of the Redis for PCF tile.
  2. Confirm deletion of the product, and then click Apply Changes.
Create a pull request or raise an issue on the source for this page in GitHub