Creating and managing Redis instances

This page describes how to use the Google Cloud Platform Console and the Cloud SDK to create and manage Cloud Memorystore for Redis instances.

Creating Redis instances

To create a new instance:

Console

  1. Go to the Cloud Memorystore page in the GCP Console.
    Cloud Memorystore
  2. Click Create Instance.
    Memorystore UI
  3. On the Create Instance page, select your desired configurations for your new instance.
    • Give your instance an Instance ID and, if desired, a Name. The Instance ID must be lowercase and unique in its region.
    • Choose Basic or Standard tier. For more information about tiers, see Redis Tier Capabilities.
    • Choose a version from the Redis version dropdown menu. For new instances, the recommended version is 4.0 (beta).
    • Using the slider, select an Instance capacity between 1 and 300 GiBs.
    • Choose a Region and a Zone for your instance. To access your Redis instance using a regional resource, such as a Compute Engine VM instance, make sure to create them both in the same region.
    • Select the default network or one of your available VPC networks.
    • To manually select an IP address range, click Show advanced options and enter a range in the field. This range can't overlap with any other Redis instances on the same network.
    • To add Redis configurations, click Show advanced options and then click Add item. For more information about available configurations, see Configuring Redis Instances.
  4. Click Create.

Gcloud

Enter the following command, replacing VARIABLES with appropriate values:

gcloud redis instances create INSTANCE_ID --size=SIZE --region=REGION_ID --zone=ZONE \
    --redis-version=VERSION

For example:

gcloud redis instances create myinstance --size=5 --region=us-central1 \
    --zone=us-central1-a --redis-version=redis_3_2

Instance creation requirements

Instance IDs must begin with a lowercase letter, and may only include lowercase letters, hyphens, and numbers, with no spaces.

To access your Redis instance using a regional resource, such as a Compute Engine VM instance, make sure to create them both in the same region.

Optional flags

Redis version

To choose one of the two available OSS Redis versions for Cloud Memorystore for Redis, use the --redis-version flag with one of the following values:

  • redis_3_2 (default)
  • redis_4_0 (beta)

For example:

gcloud beta redis instances create myinstance --size=5 --region=us-central1 \
    --zone=us-central1-a --redis-version=redis_4_0
Networking

To create the instance using a VPC network other than the default, add the --network flag with the name of your VPC. If you want to manually select an IP address range for your instance, add the --reserved-ip-range flag and supply an IP address range that doesn't overlap with the range of any existing Redis instances. For more information about selecting a valid range, see Selecting an IP Address Range.

Standard tier

To create a Standard Tier instance, add --tier=STANDARD to the create command. The following command creates a Standard Tier instance:

gcloud redis instances create INSTANCE_ID --size=SIZE --region=REGION_ID \
    --zone=ZONE --tier=STANDARD --version=VERSION

For example:

gcloud redis instances create myinstance3 --size=5 --region=us-central1 \
    --zone=us-central1-a --tier=STANDARD --redis-version=redis_3_2

For more information about using gcloud with Cloud Memorystore for Redis, see the Cloud SDK reference page.

Your instance is created. If you select an IP range manually and instance creation fails, see Selecting an IP Address Range for troubleshooting.

Viewing instance information

To view an instance's information:

Console

  1. Go to the Cloud Memorystore page in the Google Cloud Platform Console.
    Cloud Memorystore
  2. Click the Instance ID of the instance to view its information.

  3. Click the Edit button to see all details about an instance, including configuration details and other advanced settings that aren't shown on the Instance details page.

Gcloud

To view the list of all instances in a region, enter the following command, replacing VARIABLES with appropriate values:

gcloud redis instances list --region=REGION_ID

To view the details of an instance, enter the following command:

gcloud redis instances describe INSTANCE_ID --region=REGION_ID

Editing instances

To edit an instance:

Console

  1. Go to the Cloud Memorystore page in the Google Cloud Platform Console.
    Cloud Memorystore
  2. Click the Instance ID of the instance you'd like to edit.
  3. Update the instance’s Name, or Display Name, or change its Redis configurations.
  4. Click Save.

While your updates are being made, a swirling circle appears next to your instance on the Cloud Memorystore home page. When the updates are finished, the circle becomes a green checkmark.

Gcloud

You can update the following properties after creating an instance:

  • Display name
  • Redis configuration
  • Labels
  • Size (For more information on scaling, see Scaling Instances.)

For example, enter the following command to update the display name of an instance, replacing VARIABLES with appropriate values:

gcloud redis instances update INSTANCE_ID --region=REGION_ID --display-name=NEW_DISPLAY_NAME

For more details on how to set configuration parameters, see Configuring Redis Instances.

Deleting instances

To delete an instance:

Console

  1. Go to the Cloud Memorystore page in the Google Cloud Platform Console.
    Cloud Memorystore
  2. To delete an instance, click its Instance ID.
  3. Click the Delete button.
  4. To confirm deletion, enter the instance's ID.
  5. Click delete again.

While the instance is being deleted,

Gcloud

To delete an instance, enter the following command, replacing VARIABLES with appropriate values:

gcloud redis instances delete INSTANCE_ID --region=REGION_ID

After the instance is deleted, it's removed from the list of instances on the Cloud Memorystore homepage.

Kunde den här sidan hjälpa dig? Berätta:

Skicka feedback om ...

Google Cloud Memorystore for Redis