Nella sezione Configurazione, accanto a Replica di lettura,
fai clic su ATTIVA.
(Facoltativo) Specifica un intervallo IP personalizzato
Se la tua istanza utilizza la modalità di connessione peering diretto,
puoi inserire un intervallo CIDR specifico con una dimensione del blocco di almeno /28,
a condizione che non si sovrapponga ad altri intervalli esistenti.
Ad esempio, potresti inserire 10.100.0.0/28.
Se la tua istanza utilizza la modalità di connessione di accesso privato ai servizi,
puoi scegliere un intervallo allocato esistente di dimensioni /28 dal
menu a discesa. Per istruzioni su come allocare un intervallo di indirizzi IP
visualizzabile dal menu a discesa, consulta
Creazione di un'allocazione IP.
Fai clic su Abilita repliche di lettura.
gcloud
Per abilitare le repliche di lettura per la tua istanza, inserisci il seguente comando,
sostituendo variables con i valori appropriati.
size è la dimensione di ogni nodo Redis nella tua istanza, incluso
il nodo primario. Ad esempio, se hai un'istanza con replica di lettura abilitata
con sei nodi (incluso il nodo primario) con --size=10, la dimensione totale
dell'istanza è 60 GiB.
Connessione all'istanza utilizzando l'endpoint di lettura
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[],[],null,["# Manage read replicas\n\nThis page provides instructions for enabling and managing [read replicas](/memorystore/docs/redis/read-replicas).\n\nCreating a Redis instance with read replicas\n--------------------------------------------\n\n### Console\n\n| **Note:** Once you create and instance with read replicas, read replicas can't be disabled for that instance.\n\n1. Go to the **Memorystore for Redis** page in the Google Cloud console.\n\n [Memorystore for Redis](https://console.cloud.google.com/memorystore/redis/instances?)\n2. Click **Create Instance**.\n\n3. Follow the instructions at [Creating a Redis instance on a VPC network](/memorystore/docs/redis/create-manage-instances#creating_a_redis_instance_on_a_vpc_network),\n but return to these instructions when selecting **Tier**.\n\n4. Choose **Standard** tier.\n\n5. Under the **Configure read replicas** dropdown, select your desired number\n of read replicas.\n\n6. Return to the [Creating a Redis instance on a VPC network](/memorystore/docs/redis/create-manage-instances#creating_a_redis_instance_on_a_vpc_network)\n instructions for additional guidance on other Memorystore\n configurations, or click the **Create** button.\n\n### gcloud\n\n| **Note:** Once you create and instance with read replicas, read replicas can't be disabled for that instance.\n\nEnter the following command, replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate\nvalues: \n\n```\ngcloud redis instances create instance-id --size=size --region=region-id --replica-count=count --read-replicas-mode=read-replicas-enabled --tier=standard\n```\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ecount\u003c/var\u003e is a value from 1 to 5. This sets the number of read replicas.\n\nEnabling read replicas on existing Redis instances\n--------------------------------------------------\n\n### Console\n\n| **Important:**\n| - Enabling [read replicas](/memorystore/docs/redis/read-replicas) on an existing Redis instance is an exclusive operation, meaning you cannot perform other [update operation](/sdk/gcloud/reference/redis/instances/update) instance modifications as a part of the same operation that enables read replicas.\n| - After enabling read replicas, [scale the node count](/memorystore/docs/redis/managing-read-replicas#adding_or_removing_replica_nodes_from_your_redis_instance) to your desired number of read replicas.\n\n1. Go to the **Memorystore for Redis** page in the Google Cloud console.\n\n [Memorystore for Redis](https://console.cloud.google.com/memorystore/redis/instances?)\n2. Click the ID of the instance.\n\n3. Under the **Configuration** section, next to **Read Replicas** ,\n click **ENABLE**.\n\n4. **(Optional)** Specify a custom IP range\n\n - If your instance uses the direct peering [connection mode](/memorystore/docs/redis/networking#connection_modes),\n you can enter a specific CIDR range with a block size of at least `/28`,\n as long as it doesn't overlap with any other existing ranges.\n For example, you could enter `10.100.0.0/28`.\n\n - If your instance uses the private services access [connection mode](/memorystore/docs/redis/networking#connection_modes),\n you can choose an existing allocated range of size `/28` from the\n dropdown menu. For instructions on allocating an IP address range\n viewable from the dropdown menu, see\n [Creating an IP allocation](/vpc/docs/configure-private-services-access#procedure).\n\n5. Click **Enable Read Replicas**.\n\n### gcloud\n\n| **Important:** Enabling [read replicas](/memorystore/docs/redis/read-replicas) on an existing Redis instance is an exclusive operation, meaning you cannot perform other [update operation](/sdk/gcloud/reference/redis/instances/update) instance modifications as a part of the same operation that enables read replicas. \n|\n| After enabling read replicas, [scale the node count](/memorystore/docs/redis/managing-read-replicas#adding_or_removing_replica_nodes_from_your_redis_instance) to your desired number of read replicas.\n\nTo enable read replicas for your instance, enter the following command,\nreplacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate values. \n\n```\ngcloud redis instances update INSTANCE_ID --read-replicas-mode=READ_REPLICAS_ENABLED --secondary-ip-range=SECONDARY_RANGE\n```\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e is the ID of the instance for which you're enabling read replicas.\n- \u003cvar translate=\"no\"\u003eSECONDARY_RANGE\u003c/var\u003e is one of the following options:\n - `auto`. `auto` is supported for both networking connection modes.\n - If your instance uses the [direct peering connection mode](/memorystore/docs/redis/networking#direct_peering) you must provide a [valid CIDR IP address range](/memorystore/docs/redis/networking#supported_and_unsupported_networks) of size `/28`. For example, `--secondary-ip-range=10.100.0.0/28`.\n - If your instance uses the [private services access connection mode](/memorystore/docs/redis/networking#private_services_access) you must provide the name of an [allocated range](/vpc/docs/configure-private-services-access#procedure) of size `/28`. For example, `--secondary-ip-range=my-secondary-range-memorystore`.\n\nScaling read replica enabled instances\n--------------------------------------\n\n#### Adding or removing replica nodes from your Redis instance\n\n### Console\n\n1. Go to the Memorystore for Redis page in the Google Cloud console. \n [Memorystore for Redis](https://console.cloud.google.com/memorystore/redis/instances?)\n2. Click the Instance ID of the instance to which you want to add/remove replica nodes.\n3. Click **Edit**.\n4. Under **Configure read replicas**, enter your desired number of replicas.\n5. Click **Save**.\n\n### gcloud\n\nEnter the following command, replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate\nvalues: \n\n```\ngcloud redis instances update instance-id --region=region-id --replica-count=count\n```\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ecount\u003c/var\u003e is a value from 1 to 5. This sets the number of read replicas.\n\n#### Scaling the size of Redis nodes\n\n### Console\n\n1. Go to the Memorystore for Redis page in the Google Cloud console. \n [Memorystore for Redis](https://console.cloud.google.com/memorystore/redis/instances?)\n2. Click the Instance ID of the instance you want to resize.\n3. Click **Edit**.\n4. Under **Capacity**, enter a new size in the field to update the instance's capacity.\n5. Click **Save**.\n\n### gcloud\n\nEnter the following command, replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate\nvalues: \n\n```\ngcloud redis instances update instance-id --region=region-id --size=size\n```\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003esize\u003c/var\u003e is the size of each Redis node in your instance, including the primary node. For example, if you have a read replica enabled instance with six nodes (including the primary node) with `--size=10`, your total instance size is 60 GiB.\n\nConnecting to your instance using the read endpoint\n---------------------------------------------------\n\nFor instructions on using the read endpoint to connect to your instance, see\n[Connecting to a Redis instance using the read endpoint](/memorystore/docs/redis/connecting-redis-instance#connecting_to_a_redis_instance_using_the_read_endpoint).\n\nViewing read replica information for your instance\n--------------------------------------------------\n\nTo find information about read replicas for your instance, run the following\ncommand replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate values: \n\n```\ngcloud redis instances describe instance-id --region=region-id\n```\n\nIn the metadata output from the previous command:\n\n- `readEndpoint:` shows the read endpoint IP address.\n- `readEndpointPort` shows the read endpoint port number.\n- `readReplicasMode` shows if read replicas have been enabled.\n- `readReplicaCount` shows the number of replicas the instance has.\n- `nodes:` displays each replica node ID, and the region where each replica node is located."]]