Configuring Predix Cloud Cache Service

Create Predix Cloud Cache Service Instance

About This Task

You can create the Predix Cloud Cache service instance with the default parameters, or with customized Redis engine version and cluster configuration parameters.

Procedure

  1. In the Cloud Foundry Command Line Interface, run the following command to access the list of Predix Cloud Cache plans that are available for subscription:
    cf m -s predix-cloud-cache-r2.0
    Note: For more information on the Predix Cloud Cache plans, refer to the documentation on the new subscription plans.
  2. Depending on whether you want to use the default or customized parameters, perform one of the following tasks:

Create Service Instance with Default Parameters

Procedure

  1. Access the Cloud Foundry (CF) Command Line Interface.
  2. Run the following command to create the Predix Cloud Cache service instance:
    cf create-service predix-cloud-cache-r2.0 <predix_cloud_cache_plan_name> <service_instance_name>
    Note:
    • The angle brackets (< >) in the command indicate placeholder text. You must replace the placeholder text with an appropriate value before running the command.
    • By default, the Predix Cloud Cache service supports Redis version 4.0.10.
    Example: The following command will create a service instance named MyDb based on the Predix Cloud Cache plan named Dedicated-2node-6gb:
    cf create-service predix-cloud-cache-r2.0 Dedicated-2node-6gb MyDb

What To Do Next

Bind the CF application to the Predix Cloud Cache service instance.

Create Service Instance with Customized Parameters

About This Task

You can create the Predix Cloud Cache service instance with customized Redis engine version and cluster configuration parameters. You can add the updated parameter values in a <custom-config>.json file, and then use this file to pass the customized values during the create service call. The content of the <custom-config>.json file must be in the following format:
{
     "CreateReplicationGroup": {
      "EngineVersion": "<SampleEngineVersion>"
      },
    "ParameterNameValues": [{
    "ParameterName": "<SampleName>",
   "ParameterValue": "<SampleValue>"
    }]
}
Important:
  • In this task, angle brackets (< >) indicate placeholder text. If such placeholder text is part of a command, you must replace it with an appropriate value before running the command.
  • For more information on the parameters that are supported by your Redis engine, refer to the Amazon ElastiCache documentation.

Procedure

  1. Access the Cloud Foundry (CF) Command Line Interface.
  2. Run one of the following commands to create the Predix Cloud Cache service instance:
    • cf create-service predix-cloud-cache-r2.0 <predix_cloud_cache_plan_name> <service_instance_name> -c <custom-config>.json
    • cf create-service predix-cloud-cache-r2.0 <predix_cloud_cache_plan_name> <service_instance_name> -c <content_of_<custom-config>.json>
    Example: The following command will create a service instance named MyDb based on the Predix Cloud Cache plan named Dedicated-2node-6gb, and the value of the parameter named activedefrag will be set to yes:
    cf create-service predix-cloud-cache-r2.0 Dedicated-2node-6gb MyDb -c ‘{  "CreateReplicationGroup": { "EngineVersion": "5.0.0"  }, "ParameterNameValues": [{
    "ParameterName": "activedefrag","ParameterValue": "yes"}]}'
    Note:
    • The Predix Cloud Cache service supports Redis version 4.0.10 and higher.
    • You can specify a maximum of 10 customized parameters in a create request.

What To Do Next

Bind the CF application to the Predix Cloud Cache service instance.

Bind the Cloud Foundry Application to the Predix Cloud Cache Service Instance

Procedure

  1. Access the Cloud Foundry (CF) Command Line Interface.
  2. Run the following command to bind the CF application to the Predix Cloud Cache service instance:
    cf bind-service <application_name> <service_instance_name>
    Important: The angle brackets (< >) in the command indicate placeholder text. You must replace it with an appropriate value before running the command.
    Example: The following command will bind the CF application named MyApp to the service instance named MyDb:
    cf bind-service MyApp MyDb
  3. Run the following command to access the list of all environment variables of the CF application:
    cf env <application_name>
  4. In the list of environment variables, verify the parameter values defined for the service instance are correctly appearing for the VCAP_SERVICES variable.
    Example:
    "VCAP_SERVICES": {
      "predix-cloud-cache-r2.0": [
       {
        "credentials": {
         "custom_parameters": {
          "ParameterNameValues": [
           {
            "ParameterName": "active-defrag-cycle-max",
            "ParameterValue": "50"
           }
          ]
         },
         "engineversion": "4.0.10",
         "host": "sample.cache.amazonaws.com",
         "password": "samplepassword",
         "port": 6379
        },

Update Predix Cloud Cache Service Instance

About This Task

You can update the Predix Cloud Cache service instance by updating the parameter values of the instance. However, you cannot modify the values of the following parameters and attributes of the service instance:
  • Version of the Redis engine
  • Parameters that need a reboot of the cluster after modification
  • Parameters that cannot be modified in Amazon ElastiCache Redis. For more information on the supported parameters, refer to the Amazon ElastiCache documentation.
You can add the updated parameter values in a <config>.json file, and then use this file to pass the modified parameter values during the update service call. The content of the <config>.json file must be in the following format:
{
        "ParameterNameValues": [{
       "ParameterName": "<parameter_name>",
       "ParameterValue": "<parameter_value>"
             }]
}
Important: In this task, angle brackets (< >) indicate placeholder text. If such placeholder text is part of a command, you must replace it with an appropriate value before running the command.

Procedure

  1. Access the Cloud Foundry Command Line Interface.
  2. Run one of the following commands to create the Predix Cloud Cache service instance:
    • cf update-service <service_instance_name> -c ’<config>.json’
    • cf update-service <service_instance_name> -c ’<content_of_<config>.json>’
    Example: The following command will update the value of the parameter named activedefrag of the service instance named MyDb to yes:
    cf update-service MyDb -c '{ "ParameterNameValues": [{"ParameterName": "activedefrag", "ParameterValue": "yes" }]}'
    Note: You can update a maximum of 10 parameters in an update request.

Unbind the Predix Cloud Cache Service Instance from the Cloud Foundry Application

About This Task

You can unbind the Predix Cloud Cache service instance to dissociate it from the Cloud Foundry (CF) application.

Procedure

  1. Access the CF Command Line Interface.
  2. Run the following command to unbind the Predix Cloud Cache service instance from the CF application:
    cf unbind-service <application_name> <service_instance_name>
    Important: The angle brackets (< >) in the command indicate placeholder text. You must replace it with an appropriate value before running the command.
    Example: The following command will unbind the service instance named MyDb from the CF application named MyApp:
    cf unbind-service MyApp MyDb

Delete Predix Cloud Cache Service Instance

Procedure

  1. Access the Cloud Foundry Command Line Interface.
  2. Run the following command to delete the Predix Cloud Cache service instance:
    cf delete-service <service_instance_name>
    Important: The angle brackets (< >) in the command indicate placeholder text. You must replace it with an appropriate value before running the command.
    Example: The following command will delete the service instance named MyDb:
    cf delete-service MyDb