predix cloud cache · 2020-05-22 · overview of predix cloud cache. predix cloud cache is a fully...
TRANSCRIPT
Predix Cloud Cache
© 2020 General Electric Company
Contents
Chapter 1: Overview 1Overview of Predix Cloud Cache 2
Predix Cloud Cache Architecture 2
Chapter 2: Configuring Predix Cloud Cache Service 3Configure Predix Cloud Cache Service 4
Create Predix Cloud Cache Service Instance 4
Bind the Cloud Foundry Application to the Predix Cloud Cache Service Instance 6
Update Predix Cloud Cache Service Instance 7
Unbind the Predix Cloud Cache Service Instance from the Cloud Foundry Application 7
Delete Predix Cloud Cache Service Instance 8
Chapter 3: Using Predix Cloud Cache Service 9Connect to Predix Cloud Cache Clusters using Redis and Golang 10
Connect to Predix Cloud Cache Clusters using Redis and Java 12
Chapter 4: Backup and Restore 14About Backing Up and Restoring Cached Data 15
Chapter 5: Migrating to New Subscription Plan 16About New Subscription Plans 17
Migrate to a New Subscription Plan 17
Chapter 6: Security 18About Predix Cloud Cache Security 19
Chapter 7: Reference 20Performance Benchmarking 21
ii Predix Cloud Cache
Chapter 8: Release Notes 22Second Quarter of 2020 23
iii
Copyright GE Digital© 2020 General Electric Company.
GE, the GE Monogram, and Predix are either registered trademarks or trademarks of General ElectricCompany. All other trademarks are the property of their respective owners.
This document may contain Confidential/Proprietary information of General Electric Company and/or itssuppliers or vendors. Distribution or reproduction is prohibited without permission.
THIS DOCUMENT AND ITS CONTENTS ARE PROVIDED "AS IS," WITH NO REPRESENTATION ORWARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TOWARRANTIES OF DESIGN, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. ALL OTHERLIABILITY ARISING FROM RELIANCE UPON ANY INFORMATION CONTAINED HEREIN IS EXPRESSLYDISCLAIMED.
Access to and use of the software described in this document is conditioned on acceptance of the EndUser License Agreement and compliance with its terms.
iv © 2020 General Electric Company
Chapter
1OverviewTopics:
• Overview of Predix Cloud Cache• Predix Cloud Cache
Architecture
© 2020 General Electric Company 1
Overview of Predix Cloud CachePredix Cloud Cache is a fully managed in-memory data store and cache service. It improves theperformance of web applications by retrieving information from managed in-memory caches, instead ofrelying entirely on slower disk-based databases. Predix Cloud Cache is backed by Amazon ElastiCache andhelps you overcome the challenges, such as slow processing queries, scaling costs, simplified data access,and so on, faced while building distributed applications that require low latency and scalability. PredixCloud Cache V2.0 supports the Redis (version 4.0 and higher) in-memory caching engine.
Predix Cloud Cache ArchitectureThe following architecture diagram provides a high-level information on how a user application interactswith an Amazon ElastiCache (Redis) instance using the Predix Cloud Cache service.
The Predix Cloud Cache Broker facilitates the interaction between the user application and the AmazonElastiCache service, and manages the lifecycle of the service instance. When the Predix Cloud Cacheinstance is created for the user, the user application interacts with the Amazon ElastiCache (Redis)instance through the host URL for the Predix Cloud Cache instance.
2 © 2020 General Electric Company
Chapter
2Configuring Predix Cloud Cache ServiceTopics:
• Configure Predix Cloud CacheService
• Create Predix Cloud CacheService Instance
• Bind the Cloud FoundryApplication to the Predix CloudCache Service Instance
• Update Predix Cloud CacheService Instance
• Unbind the Predix Cloud CacheService Instance from the CloudFoundry Application
• Delete Predix Cloud CacheService Instance
© 2020 General Electric Company 3
Configure Predix Cloud Cache Service
About This Task
You must create a service instance, and then bind the Cloud Foundry (CF) application to that instance toset up the Predix Cloud Cache service.
Procedure
1. Create the Predix Cloud Cache service instance.2. Bind the CF application to the Predix Cloud Cache service instance.
Create Predix Cloud Cache Service Instance
About This Task
You can create the Predix Cloud Cache service instance with the default parameters, or with customizedRedis engine version and cluster configuration parameters.
Procedure
1. In the Cloud Foundry Command Line Interface, run the following command to access the list of PredixCloud 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 newsubscription plans.
2. Depending on whether you want to use the default or customized parameters, perform one of thefollowing tasks:
• Create the instance with the default parameters.• Create the instance with customized parameters.
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 theplaceholder text with an appropriate value before running the command.
• By default, the Predix Cloud Cache service supports Redis version 4.0.10.
4 © 2020 General Electric Company
Example: The following command will create a service instance named MyDb based on the PredixCloud Cache plan named Dedicated-2node-6gb:
cf create-service predix-cloud-cache-r2.0 Dedicated-2node-6gb MyDb
Next Steps
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 clusterconfiguration parameters. You can add the updated parameter values in a <custom-config>.jsonfile, 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 acommand, 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 AmazonElastiCache 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 PredixCloud Cache plan named Dedicated-2node-6gb, and the value of the parameter namedactivedefrag 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"}]}'
© 2020 General Electric Company 5
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.
Next Steps
Bind the CF application to the Predix Cloud Cache service instance.
Bind the Cloud Foundry Application to the Predix Cloud CacheService 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 itwith an appropriate value before running the command.
Example: The following command will bind the CF application named MyApp to the service instancenamed MyDb:
cf bind-service MyApp MyDb3. 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 },
6 © 2020 General Electric Company
Update Predix Cloud Cache Service Instance
About This Task
You can update the Predix Cloud Cache service instance by updating the parameter values of theinstance. However, you cannot modify the values of the following parameters and attributes of the serviceinstance:
• 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 themodified parameter values during the update service call. The content of the <config>.json file mustbe 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 acommand, 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 ofthe 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 CloudFoundry Application
About This Task
You can unbind the Predix Cloud Cache service instance to dissociate it from the Cloud Foundry (CF)application.
© 2020 General Electric Company 7
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 itwith an appropriate value before running the command.
Example: The following command will unbind the service instance named MyDb from the CFapplication 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 itwith an appropriate value before running the command.
Example: The following command will delete the service instance named MyDb:
cf delete-service MyDb
8 © 2020 General Electric Company
Chapter
3Using Predix Cloud Cache ServiceTopics:
• Connect to Predix Cloud CacheClusters using Redis andGolang
• Connect to Predix Cloud CacheClusters using Redis and Java
© 2020 General Electric Company 9
Connect to Predix Cloud Cache Clusters using Redis and Golang
Before You Begin
• Download the Redis client from the Golang Library for Redis that you want to use for connecting thePredix Cloud Cache clusters to the applications.
• Ensure that the Redis client supports Transport Level Security (TLS) and is set to nil.
About This Task
The Predix Cloud Cache clusters are enabled with at-rest and in-transit encryptions. To access data fromPredix Cloud Cache enabled with these encryptions, you can use a Redis client that is supported with TLS.Using the Redis client with TLS, you can secure the connections between the Predix Cloud Cache clustersand the user applications.
Code Example for Connecting to Predix Cloud Cache Clusters using Redis andGolang
The following code example connects the Predix Cloud Cache clusters to the userapplications using Redis and Golang.
package main
import ("crypto/tls""fmt""log""net/http""os"
"github.com/go-redis/redis")
func main() {
var port stringport = os.Getenv("PORT")if port == "" {port = "8080"}client := newClient()
err := ping(client)if err != nil {fmt.Println(err)}err = set(client)if err != nil {fmt.Println(err)}
err = get(client)if err != nil {fmt.Println(err)}
10 © 2020 General Electric Company
fmt.Println("Starting Test HTTP Server.........")err = http.ListenAndServe(":"+port, nil)if err != nil {log.Fatal(err)}
}
//return redis client
func newClient() *redis.Client {client := redis.NewClient(&redis.Options{Addr: "host:port",Password: "password", // no password set -TLSConfig: &tls.Config{}, //for at transit encryption})
return client}
// ping tests connectivity for redis (PONG should be returned)func ping(client *redis.Client) error {fmt.Println("executing Ping Pong....")pong, err := client.Ping().Result()if err != nil {return err}fmt.Println(pong, err)// Output: PONG <nil>fmt.Println("PING PONG operation is done")return nil}
// set executes the redis Set commandfunc set(client *redis.Client) error {err := client.Set("key", "value", 0).Err()if err != nil {return err}return nil}
func get(client *redis.Client) error {val, err := client.Get("key").Result()if err != nil {return (err)}fmt.Println("key", val)
val2, err := client.Get("key2").Result()if err == redis.Nil {fmt.Println("key2 does not exist")} else if err != nil {panic(err)} else {fmt.Println("key2", val2)}// Output: key value// key2 does not exist
© 2020 General Electric Company 11
return nil}
func helloHandler(w http.ResponseWriter, r *http.Request) {fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])}
Connect to Predix Cloud Cache Clusters using Redis and Java
Before You Begin
• Ensure that Java is installed and configured in your system.• Ensure that a Java Redis client (for example, Jedis) is installed for connecting the Predix Cloud Cache
clusters to the applications.• In the project directory, modify the pom.xml file as follows to include the Java Redis client (for
example, Jedis) as a Mavcen dependency.
<dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>3.0.1</version> </dependency>
About This Task
The Predix Cloud Cache clusters are enabled with at-rest and in-transit encryptions. To access data fromPredix Cloud Cache enabled with these encryptions, you can use a Java Redis client that is supported withTLS. Using Jedis, you can secure the connections between the Predix Cloud Cache clusters and the userapplications.
Code Example for Connecting to Predix Cloud Cache Clusters using Redis andJava
The following code example connects the Predix Cloud Cache clusters to the userapplications using Redis and Java.
...
import redis.clients.jedis.Jedis;
public class CloudCacheSample {
public static String HOST_URL = <Value of host from VCAP_SERVICES environment Variable>;public static String PASSWORD = <Value of password from VCAP_SERVICES environment Variable>;public static int PORT = 6379; ...
public void redisSample() {
12 © 2020 General Electric Company
/* prefix 'rediss://' instructs jedis to open a SSL/TLS connection */
URI jedisHostURI = URI.create("rediss://"+HOST_URL+":"+PORT); System.out.println("URI: "+jedisHostURI);
/* Creating new jedis client for connecting with redis instance */ Jedis jedisClient = new Jedis(jedisHostURI); jedisClient.auth(PASSWORD); System.out.println("Connection Made Successfully");
/* Pinging Instance to verify its healthy */ System.out.println("Server is running: " + jedisClient.ping());
/* Reading and writing to redis instance*/ jedisClient.lpush("SampleKey", "Sample Data1"); jedisClient.lpush("SampleKey", "Sample Data2"); List<String> list = jedisClient.lrange("SampleKey", 0, 1); for(int i=0; i<list.size(); i++) { System.out.println("Item Value: "+list.get(i)); }
/* Closing and exiting gracefully */ jedisClient.disconnect(); jedisClient.close(); }
...
}
© 2020 General Electric Company 13
Chapter
4Backup and RestoreTopics:
• About Backing Up andRestoring Cached Data
14 © 2020 General Electric Company
About Backing Up and Restoring Cached DataThe Predix Cloud Cache clusters use Amazon ElastiCache to create a backup of cached data. The clustersare enabled to create automated backups that are retained for a maximum of seven days. If you want torestore your data for a cluster, you must contact GE Digital Customer Support.
For more information on how to back up data using Amazon ElastiCache, refer to the Amazon ElastiCachedocumentation.
© 2020 General Electric Company 15
Chapter
5Migrating to New Subscription PlanTopics:
• About New Subscription Plans• Migrate to a New Subscription
Plan
16 © 2020 General Electric Company
About New Subscription PlansGE Digital has introduced a new set of Predix Cloud Cache plans for subscription. The old Predix CloudCache plans will be deprecated by September 30, 2020. Therefore, as per the latest security guidelines,you must migrate to a new plan by September 30, 2020. In Predix Cloud Cache V2.0, all new serviceinstances must be created using the new plans. For more information on the Predix Cloud Cache plansavailable for subscription, visit the Predix website.
Important: To use the predix-cloud-cache service in the Cloud Foundry (CF) marketplace, you cansubscribe to the old Predix Cloud Cache plans (namely 2-3GB, 2-6GB, and 2-28GB) through CF CommandLine Interface till September 30, 2020. However, the old Predix Cloud Cache plans will be available forsubscription using the predix.io console till May 15, 2020.
Migrate to a New Subscription Plan
About This Task
Predix Cloud Cache V2.0 enables at-rest and in-transit encryptions, and Redis authentication for all theservice instances.
Procedure
1. Verify your Redis client library supports Redis version 4.0.10 and higher.2. Verify your Redis client supports Secure Sockets Layer (SSL)/Transport Layer Security (TLS).3. Update the code to enable the SSL/TLS handshake and Redis authentication.
© 2020 General Electric Company 17
Chapter
6SecurityTopics:
• About Predix Cloud CacheSecurity
18 © 2020 General Electric Company
About Predix Cloud Cache SecurityThe Predix Cloud Cache service supports basic authentication using a unique user name and password foreach service instance. After binding the service to the Clound Foundry (CF) application, you can obtain theuser name and password from the VCAP_SERVICES environment variable.
Additionally, at the Infrastructure as a Service (IaaS) level, all the Predix Cloud Cache instances areprovisioned within private subnets and are not accessible directly over the internet. You can only access itthrough applications on the CF platform.
© 2020 General Electric Company 19
Chapter
7ReferenceTopics:
• Performance Benchmarking
20 © 2020 General Electric Company
Performance BenchmarkingThe Predix Cloud Cache V2.0 service uses the Redis benchmarking tool to evaluate the performance ofthe Redis instances.
Example: Performance Benchmarking for Subscription Plans
The following tables list the results of the performance benchmarking that is performed on a Redisinstance for each subscription plan.
Table 1: Scenario 1: Number of Parallel Connections: 50
Plan Number ofRequests
Size of Request SET Rate (per sec) LPUSH Rate (persec)
GET Rate (per sec)
Dedicated-2nod
e-6gb
100000 3 bytes 93371 86957 92764
1000000 3 bytes 94065 87108 93906
10000000 3 bytes 93939 85977 93603
Dedicated-2nod
e-12gb
100000 3 bytes 113507 53191 116959
1000000 3 bytes 117633 94251 115088
10000000 3 bytes 114879 93694 113845
Dedicated-2nod
e-26gb
100000 3 bytes 87336 121951 87566
1000000 3 bytes 86670 115607 87199
10000000 3 bytes 87072 110988 87517
Table 2: Scenario 2: Number of Parallel Connections: 1020
Plan Number ofRequests
Size of Request SET Rate (per sec) LPUSH Rate (persec)
GET Rate (per sec)
Dedicated-2nod
e-6gb
100000 3 bytes 93458 98039 99010
1000000 3 bytes 103199 102145 104384
10000000 3 bytes 102638 101348 102365
Dedicated-2nod
e-12gb
100000 3 bytes 100000 100000 95238
1000000 3 bytes 100200 95420 104932
10000000 3 bytes 101854 104145 106815
Dedicated-2nod
e-26gb
100000 3 bytes 96154 91743 99010
1000000 3 bytes 102987 101937 104384
10000000 3 bytes 104123 103520 102365
© 2020 General Electric Company 21
Chapter
8Release NotesTopics:
• Second Quarter of 2020
22 © 2020 General Electric Company
Second Quarter of 2020
V2.0This topic provides a list of product changes released for this service in this version.
Table 3: Enhancements and New Features
The following enhancements and new features have been added.
Description Tracking ID
The following enhancements have been made to the Predix Cloud Cache service in this version:
• Predix Cloud Cache now supports only Redis V4.0 and higher for new service instances with
default version being Redis 4.0.
• Predix Cloud Cache now supports user-defined configuration for the Predix Cloud Cache
broker. This enhancement provides you full control over the broker configuration. In addition
to this, you can upgrade the existing instances to support user-defined configuration.
• GE Digital has introduced a new set of Predix Cloud Cache plans for subscription. For more
information on these plans, visit the Predix website.
• Predix Cloud Cache now supports at-rest and in-transit encryptions for all new instances.
Additionally, the new subscription plans are based upon latest generation Amazon EC2 M5
instances for improved security and performance.
F52192
Table 4: Obsolete Features
The following features are no longer available.
Description Tracking ID
The existing Predix Cloud Cache subscription plans (namely, 2-3GB, 2-6GB, 2-28GB) will no longer
be available after September 30, 2020. You must migrate to a new subscription plan before
September 30, 2020. For more information on the subscription plans, visit the Predix website.
Important: To use the predix-cloud-cache service in the Cloud Foundry (CF)
marketplace, you can subscribe to the old Predix Cloud Cache plans (namely 2-3GB, 2-6GB, and
2-28GB) through CF Command Line Interface till September 30, 2020. However, the old Predix
Cloud Cache plans will be available for subscription using the predix.io console till May 15, 2020.
NA
© 2020 General Electric Company 23