This page describes how to create a new Cloud Memorystore for Redis instance, connect to it, and then delete it.
Before you begin
Sign in to your Google Account.
If you don't already have one, sign up for a new account.
Select or create a GCP project.
Make sure that billing is enabled for your Google Cloud Platform project. Learn how to enable billing.
Creating a Redis instance
- Go to the Cloud Memorystore page in the Google Cloud Platform Console.
If the Cloud Memorystore page is unavailable, enable or re-enable the Memorystore for Redis API.
Enable the API
- Click Create Instance.
- On the Create an instance page, select the configurations for your new instance.
- Choose Basic Tier, which creates a standalone instance.
- Your instance's Name can be anything, but your Instance ID must be lowercase and unique in its region.
- Select Redis version 4.0.
- Instance capacity can range from 1 to 300 GiBs. Choose 20 GiBs.
- Select the default network for your instance.
Your instance is created.
After the instance is created, click the instance ID to view the instance details page.
- Make a note of the
IP addressand the
- Make a note of the
Connecting to the Redis instance from a Compute Engine VM instance
You can connect to the Redis instance from any Compute Engine VM instance located within the same project, region and network as the Redis instance.
Follow the instructions at Quickstart Using a Linux VM to create and connect to a Compute Engine VM instance. Make sure that you create your Compute Engine VM instance in the same region as your Redis instance. If you used a Debian 8 image to create your VM instance as described in the quickstart, install
sudo apt-get install telnet
From the terminal, telnet to the IP address of the Redis instance, substituting your own instance's IP address and port number.
telnet 10.0.0.27 6379 Trying 10.0.0.27… Connected to 10.0.0.27
In the telnet session, enter some Redis commands:
PING +PONG SET HELLO WORLD +OK GET HELLO $5 WORLD
You can also use the Redis client to issue commands to the Redis instance. For more information on how to use the Redis client, see the Redis Quick Start Guide.
To avoid incurring charges to your Google Cloud Platform account for the resources used in this quickstart:
- Go to the Cloud Memorystore page in the GCP Console.
- Click the instance ID of the instance you want to delete.
- Click the Delete button.
- In the prompt that appears, enter the instance's name.
- Click Delete.