Creating and managing Memcached instances

This page describes how to use the Google Cloud Console and the gcloud command-line tool to create and manage Memorystore for Memcached instances.

See Best practices for provisioning Memcached instances for instance creation guidance.

For a list of the permissions you need to create and manage Memcached instances, see Access control and permissions.

Creating Memcached instances

To create a Memcached instance:

Console

  1. Go to the Memorystore for Memcached page in the Cloud Console.
    Memorystore for Memcached

  2. Click the Create Instance button.

  3. On the Create a Memcached instance page, select the configurations for your new instance.

    • Enter an Instance ID using only lowercase letters, numbers, and hyphens. Start with a letter.
      • For example, my-memcached-instance-1.
    • Optionally, enter a Display name for your instance.
    • Choose a region from the Region dropdown.
    • Choose Automatically distribute or a preferred zone from the Zone dropdown.
    • Choose your desired number of Nodes.
    • Choose your desired Memory per node.
    • Choose your desired Cores per node.
    • Select your desired Authorized network.

  4. Click Create.

gcloud

  1. Set the default project in which to create a Memcached instance. Enter the following command, replacing highlighted-variables with appropriate values:

    gcloud config set core/project project-id
    
  2. Create a Memcached instance:

    gcloud beta memcache instances create myinstance --node-count=number-of-nodes --node-cpu=number-of-cpus --node-memory=memory-per-node --region=region --zones=zone(s)
    

    Where:

    • number-of-nodes is your desired node count.
    • number-of-cpus is your desired vCPU count.
      • Acceptable values: 1 or 2-32 (even values only).
      • Each vCPU requires 0.9GB of node memory, and supports up to 8GB of node memory.
    • memory-per-node is your desired memory for each node.

      • Minimum: 1 GB or (0.9GB * vCPUs per node), whichever is greater.
      • Maximum: 256 GB.
    • region is the region in which to create the nodes.

    • zone(s) are the zones in which to create the nodes.

      • Exclude the --zones flag to automatically distribute nodes among zones.

    For example:

    gcloud beta memcache instances create myinstance --node-count=3 --node-cpu=2 --node-memory=2GB --region=us-central1 --zones=us-central1-a,us-central1-b,us-central1-c
    

Viewing instance information

To view an instance's information:

Console

  1. Go to the Memorystore for Memcached page in the Cloud Console.
    Memorystore for Memcached

  2. Click the Instance ID to view its information.

gcloud

  1. To view the list of all Memcached instances in a region, enter the following command:

    gcloud beta memcache instances list --region=region-id
    
  2. To view the details of an instance, enter the following command:

    gcloud beta memcache instances describe instance_id --region=region_id
    

Editing instances

To edit an instance:

Console

  1. Go to the Memorystore for Memcached page in the Cloud Console.
    Memorystore for Memcached

  2. Click on the Instance ID of the instance you'd like to edit.

  3. Click the Edit button.

    1. From the Edit Memcached instance page you can change an instance's:

  4. Click the Save button.

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

gcloud

You can update the following properties after creating an instance:

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

gcloud beta memcache instances update instance-id --region=region-id --display-name=name --labels=key=value

Deleting instances

To delete an instance:

Console

  1. Go to the Memorystore for Memcached page in the Cloud Console.
    Memorystore for Memcached

  2. Click the instance ID.

  3. Click the Delete button.

  4. Confirm that you want to delete the instance by entering the instance ID, and clicking the Delete button.

gcloud

  1. To delete an instance enter the following command:

    gcloud beta memcache instances delete instance-id --region=region-id
    

What's next