Documentation - Redise Cloud Private

open all | close all

Quick Setup of Redise Cloud Private (RCP)

The steps for creating a simple Redise Cloud Private (RCP) deployment are as follows:

  1. Sign up for an RCP account
  2. Create a dedicated AWS account for RCP
  3. Create a new RCP subscription
  4. Create a new database definition
  5. Set up Amazon Virtual Private Cloud (VPC) Peering
  6. Connect to your database

Step #1 – Sign up for Redise Cloud Private account

If you do not already have one, sign up for a Redise Cloud Private account.
If you already have an account, sign in to Redise Cloud Private.

Step #2 – Create an AWS account for RCP to use

RCP requires a dedicated AWS account to perform operations in your VPC on your behalf. Inside of that account, create an AWS user in IAM specifically for Redise Cloud Private use, per “Creating an AWS user for Redise Cloud Private.”

Step #3 – Create a new RCP subscription

Add a new subscription to your account, if you do not already have one. If you do have an existing RCP subscription, then proceed to Step 4.

For a new subscription, you will need to provide the following:

  1. A subscription name
  2. The cloud region you want your databases to be created in AWS
  3. The AWS user created above in Step #2. For this user, please supply the following details:
    1. AWS_ACCESS_KEY_ID – RCP user’s AWS access key
    2. AWS_SECRET_ACCESS_KEY – RCP user’s AWS secret key
    3. AWS Console User – RCP AWS console user
    4. AWS Console password – RCP console user’s password
    5. IAM Users sign-in link – This is the link you use to log into the AWS console (e.g. https://ACCOUNT-ID-WITHOUT-HYPENS.signin.aws.amazon.com/console)
  4. Please provide the required Deployment CIDR – this is an IPv4 subnet, in CIDR notation, that you would like RCP to use. For a minimal three node deployment, you can specify 10.0.1.0/27.

Once your selections are made, click “Continue” to finalize your subscription. RCP will authenticate the credentials with AWS, then proceed to the next step.

Step #4 – Create the database definition

Next, define the databases to provision. Each row in the table represents a group of databases that share the same specification.

To start with a single database, provide the following details:

  • Dataset size – The estimated size of your data. You can specify 1GB for a small database.
  • Throughput – The estimated total throughput you expect from your database. You can specify 10,000 ops/sec to start with a small deployment.

Optionally, you can specify a data persistence policy for your database and enter the quantity of databases to create multiple databases on your RCP subscription with the provided settings.

Once selections are made, save the entered row by clicking on the save button. You can add more rows by clicking on the plus button.

Once done with all databases, click on “Continue“.

Behind the scenes, RCP is performing a few operations based on your inputs:

  • Calculating the necessary resources
  • Crafting a plan for an optimized cloud infrastructure based on those calculations

Note: Plan creation may take a little time base on a few factors, e.g. your inputs, AWS response times, etc.

Once planning is complete, please review the presented subscription and database information. Either select an existing payment method or click on the “+” button to add a new payment method.

Select the “Continue” button to create the subscription and deploy the database(s). The subscription will display a “Pending” status and may take ten to fifteen minutes to construct the infrastructure using the generated optimization plan. You will receive an email once your databases are ready to use.

Step #5 – Setup Amazon Virtual Private Cloud (VPC) peering

In order for your application to be able to connect to your newly created databases, you must first create VPC peering between your application and the new RCP VPCs.

To find out your RCP VPC details, go to Subscriptions in the menu and then click on the relevant subscription name. Use that information to set up the VPC Peering.

You can refer to the AWS Documentation to guide you through the process.

Once the peering was established please define the relevant routing groups on your application account and RCP account.

Step #6 – Connect to your database

Using the menu, navigate to the Databases page. Select one of the databases and select the Configuration tab and look for the database endpoint.

Using Telnet

As a quick smoke test, telnet to your assigned endpoint and port. Then enter the Redis PING command. You should see something like this:

# telnet redis-19836.c9.us-east-1-2.ec2.cloud.redislabs.com 19836
Trying 54.89.217.184...
Connected to redis-19836.c9.us-east-1-2.ec2.cloud.redislabs.com.
Escape character is '^]'.
AUTH my_redis_password
PING
+PONG

Note: We recommend loading the redis-cli command-line utility for future use as you will use it for other things.

Using redis-cli

$ redis-cli -h redis-19836.c9.us-east-1-2.ec2.cloud.redislabs.com \
-p 19836 -a astrongpassword
redis-19836.c9.us-east-1-2.ec2.cloud.redislabs.com:19836> PING
PONG

You can get redis-cli and other command-line Redis tools through your favorite package manager or by installing Redis locally.

Using Python

Once you have tested the connection to your Redis database, you can start reading and writing data. The following code snippet writes the value bar to the Redis key “foo”, reads it back, and then prints it. This snippet is written in Python, but you can use your favorite language (for examples in other languages, go here).

You first need to install the Redis client library for Python if you do not have it already.

$ sudo pip install redis

Next copy and paste this into a file named “example_redis.py“:
#import the library
import redis
# Create connection object
r = redis.Redis(
host='pub-redis-10382.us-west-2-1.1.ec2.garantiadata.com', port=10382)
# set a value for the foo object
r.set('foo', 'bar')
# retrieve and print the value for the foo object
print(r.get('foo'))

Now run the code:

$ python example_redis.py
bar

With that simple test complete, if you have existing code or an app that uses Redis, just change the host, port, password and SSL certificates and you are done.

More Information

  1. Data Persistence with Redise Cloud Private
  2. Securing Your Redise Cloud Private Database
  3. Creating Databases
  4. Redise Cloud Database Backups
  5. Monitoring Redise Cloud Private Performance.