Selecting an IP Address Range for Your Redis Instance
Each Cloud Memorystore for Redis instance has an assigned IP address range. This range is either automatically chosen or specified manually when creating an instance. If you want to specify the range yourself, two conditions must be met:
- The range must be a valid RFC 1918 private IP range.
- The range can't overlap with any existing subnets from the authorized network or other Redis instances.
If you want to specify your own range, you'll need to know which ranges are unavailable in your project. To find out all IP address ranges that are unavailable:
- Go to the VPC Networks page in the Google Cloud Console.
- In the list of VPC networks, find the network that you want to authorize.
- Make note of all IP address ranges assigned to subnets in that network. The IP address range you choose for the Redis instance must not overlap with any of these ranges.
Enter the command to list all instances in the project. Make note of all the IP address ranges assigned to each of the Redis instances. This is listed in the
gcloud redis instances list
A reserved IP address block of size /28 or /29 is sufficient for instances in Basic and Standard Tiers.
Recreating a deleted Cloud Memorystore service account
If the Cloud Memorystore for Redis service account gets deleted, you might get one of the following error messages when you attempt to create a new Cloud Memorystore instance:
Error message 1:
Required 'compute.networks.get' permission for 'projects/project-id/global/networks/default'
- project-id is your project-id.
Error message 2:
A required IAM policy might be missing. Please run this command:"gcloud projects add-iam-policy-binding <YOUR-PROJECT-ID> --member='serviceAccount:service-<YOUR-PROJECT-NUMBER>@cloud-redis.iam.gserviceaccount.com' --role='roles/redis.serviceAgent'" and try again. com.google.apps.framework.request.StatusException: <eye3 title='FAILED_PRECONDITION'/> generic::FAILED_PRECONDITION: A required IAM policy might be missing. Please run this command:"gcloud projects add-iam-policy-binding <YOUR-PROJECT-ID> --member='serviceAccount:service-<YOUR-PROJECT-NUMBER>@cloud-redis.iam.gserviceaccount.com' --role='roles/redis.serviceAgent'" and try again.
The format of the Cloud Memorystore for Redis service account is:
If the service account is deleted, you will not be able to create any new instances until you recreate the service account for your project.
To recreate the service account, run the following command replacing the variables with the appropriate values:
gcloud projects add-iam-policy-binding project-id --member='serviceAccount:firstname.lastname@example.org' --role='roles/redis.serviceAgent'
Troubleshooting import and export issues
This section outlines some common issues you may run into when using import and export for Cloud Memorystore for Redis.
Import and export buttons are disabled in the Cloud Console
Issue: the user logged into the console does not have the
redis.instances.export permissions required to
import and/or export RDB files.
Solution: grant the permissions to the user, and refresh the instance details page.
The import operation completed but the data was not restored
If an import operation completes but the data is not restored, first check either the Cloud Console or the command line for an error message, and resolve any issues described by the error message.
If there is a failure during the import process, the instance is recovered using an empty RDB file. You can attempt to restore the data by importing the same RDB file again, or using a different RDB file.
The import failed because the RDB file was too big
If you received the error message "Import RDB file gs://bucket/object.rdb size exceeds max memory 10GB", you should scale up your instance and retry the import. You can also try to import a smaller RDB file into your instance.
gcloud command-line tool issues
If you run into an issue where a
gcloud tool command is unavailable,
or if the command behaves differently from how it is documented, try updating
the gcloud SDK:
gcloud components update