Wählen Sie im Drop-down-Menü Lesereplikate konfigurieren die gewünschte Anzahl an Lesereplikaten aus.
Kehren Sie zur Anleitung Redis-Instanz in einem VPC-Netzwerk erstellen zurück, um weitere Anleitungen zu anderen Memorystore-Konfigurationen zu erhalten, oder klicken Sie auf die Schaltfläche Erstellen.
gcloud
Geben Sie den folgenden Befehl ein. Ersetzen Sie dabei variables durch die entsprechenden Werte:
Klicken Sie im Abschnitt Konfiguration neben Lesereplikate auf AKTIVIEREN.
(Optional) Benutzerdefinierten IP-Bereich angeben
Wenn Ihre Instanz den Verbindungsmodus für direktes Peering verwendet, können Sie einen bestimmten CIDR-Bereich mit einer Blockgröße von mindestens /28 eingeben, sofern er sich nicht mit anderen vorhandenen Bereichen überschneidet.
Sie könnten beispielsweise 10.100.0.0/28 eingeben.
Wenn Ihre Instanz den Verbindungsmodus für den Zugriff auf private Dienste verwendet, können Sie im Drop-down-Menü einen vorhandenen zugewiesenen Bereich der Größe /28 auswählen. Eine Anleitung zum Zuweisen eines IP-Adressbereichs, der im Drop-down-Menü angezeigt wird, finden Sie unter IP-Zuweisung erstellen.
Klicken Sie auf Lesereplikate aktivieren.
gcloud
auf die gewünschte Anzahl von Lesereplikaten.
Geben Sie den folgenden Befehl ein, um Lesereplikate für Ihre Instanz zu aktivieren. Ersetzen Sie dabei variables durch die entsprechenden Werte.
size ist die Größe jedes Redis-Knotens in der Instanz, einschließlich des primären Knotens. Wenn Sie beispielsweise ein Lesereplikat mit sechs Knoten (einschließlich des primären Knotens) mit --size=10 haben, beträgt die Instanzgröße insgesamt 60 GiB.
Verbindung zu einer Instanz über den Lese-Endpunkt herstellen
Lesereplikatinformationen für Ihre Instanz aufrufen
Führen Sie den folgenden Befehl aus, um Informationen zu Lesereplikaten für Ihre Instanz zu erhalten. Ersetzen Sie dabei variables durch die entsprechenden Werte:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-19 (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."]]