Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Memorystore pour Memcached accepte un sous-ensemble de paramètres de configuration Memcached natifs que vous pouvez modifier. Vous devez utiliser les mêmes configurations pour tous les nœuds de votre cluster. Cette page décrit comment effectuer les opérations suivantes :
Afficher la configuration des instances
Modifier la configuration des instances en :
préparant les modifications de configuration de l'instance de préproduction ;
mettant à jour les modifications apportées à la configuration des nœuds.
Dans Memorystore pour Memcached, vous devez d'abord mettre à jour les configurations, puis appliquer les modifications aux nœuds de votre cluster. L'application d'une mise à jour des paramètres à un nœud entraîne un vidage complet du cache sur ce nœud.
La possibilité d'appliquer des mises à jour de paramètres à des nœuds individuels offre l'avantage de pouvoir déployer les modifications nœud par nœud. Votre instance peut ainsi rester en ligne et fonctionnelle pendant la mise à jour des configurations.
Cliquez sur l'ID de l'instance pour afficher la page Détails de l'instance.
Affichez vos paramètres dans la section Configuration.
gcloud
Pour afficher les paramètres de configuration à l'aide de la Google Cloud CLI, saisissez la commande describe pour l'instance en remplaçant variables par les valeurs appropriées:
Pour obtenir la liste des paramètres de configuration modifiables et leurs valeurs par défaut, consultez la section Paramètres de configuration Memcached.
La commande update de Memorystore pour Memcached ne permet pas d'exécuter simultanément l'option --parameters avec d'autres options.
Configurer des paramètres à l'aide de gcloud lors de la création d'une instance
Pour définir les paramètres de configuration lors de la création, saisissez la commande suivante en remplaçant les variables par les valeurs appropriées :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (UTC)."],[],[],null,["# Configure a Memcached instance\n\nMemorystore for Memcached supports a subset of [native Memcached configuration parameters](https://manpages.debian.org/unstable/memcached/memcached.1.en.html)\nthat you can modify. You should use the same configurations for all nodes in\nyour cluster. This page describes how to:\n\n- View instance configurations.\n- Modify instance configurations by:\n - Staging instance configuration changes.\n - Updating node configuration changes.\n\nMemorystore for Memcached requires you to update the configurations first, and then\napply the changes to the nodes in your cluster. Applying a parameter update to\na node causes a full cache flush on that node.\n\nThe advantage to being able to apply parameter updates to individual nodes is\nthat you can roll out changes on a node-by-node basis. Doing so keeps your\ninstance online and functional while you update configurations.\n\nFor a full list of the modifiable and unmodifiable parameters, see [Memcached configuration parameters](/memorystore/docs/memcached/memcached-configs).\n\nViewing configurations\n----------------------\n\n### Console\n\n1. Go to the **Memorystore for Memcached** page in the Google Cloud console. \n [Memorystore for Memcached](https://console.cloud.google.com/memorystore/memcached/instances)\n2. Click the ID of the instance to view the **Instance details** page.\n3. View your settings in the **Configuration** section.\n\n### Gcloud\n\nTo view configuration parameters using the Google Cloud CLI, enter\nthe `describe` command for the instance replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e\nwith appropriate values: \n\n```\ngcloud memcache instances describe instance-id --region=region\n```\n| **Note:** You won't see configuration parameters when running `describe` unless you have changed a configuration from its default value.\n\nFor a list of modifiable configuration parameters and their default values,\nsee [Memcached configuration parameters.](/memorystore/docs/memcached/memcached-configs)\n\nModifying configuration parameters\n----------------------------------\n\n### Console\n\n1. Go to the **Memorystore for Memcached** page in the Google Cloud console. \n [Memorystore for Memcached](https://console.cloud.google.com/memorystore/memcached/instances)\n2. Click the ID of the instance.\n3. Click **Edit Configuration**.\n4. Adjust the value of any parameter that you want to change.\n5. Click the **Continue** button to stage the configuration updates.\n6. Select a node, and click **Update Selected Nodes** one at a time for\n each node, or in batches of nodes.\n\n | **Note:** Updating node configurations one at a time, or in batches, helps you avoid instance unavailability and reduces data loss.\n\n### Gcloud\n\n1. Update the configuration parameters by running the following command:\n\n ```\n gcloud memcache instances update instance-id --region=region --parameters=parameter=value,parameter=value\n ```\n2. List and take note of all node IDs for your instance by running the\n following command:\n\n ```\n gcloud memcache instances describe instance-id --region=region --format=\"value(memcacheNodes.nodeId.list())\"\n ```\n3. Apply the parameters one by one, or in batches, to nodes in your cluster\n by running the following command:\n\n **Note:** Updating node configurations one at a time, or in batches, helps you avoid instance unavailability and reduces data loss. \n\n ```\n gcloud memcache instances apply-parameters instance-id --region=region --node-ids=node-1-id,node-2-id\n ```\n\n Alternatively, you can apply the parameters for all nodes at once by\n using the following command, but we don't recommend it: \n\n ```\n gcloud memcache instances apply-parameters instance-id --region=region --apply-all\n ```\n\nYou cannot simultaneously run the`--parameters` flag with any other flags\nwhen using the Memorystore for Memcached `update` command.\n\nConfiguring parameters using gcloud during instance creation\n------------------------------------------------------------\n\nTo set configuration parameters during creation, enter the following command\nreplacing variables with appropriate values: \n\n```\ngcloud memcache instances create instance-name --size=size --region=region --parameters=parameter=value,parameter=value\n```\n\nYou can simultaneously run the `--parameters` flag with all other flags when\nusing the Memorystore for Memcached `create` command.\n\nClearing configuration parameters to default values using the Google Cloud console\n----------------------------------------------------------------------------------\n\n1. Go to the **Memorystore for Memcached** page in the Google Cloud console. \n [Memorystore for Memcached](https://console.cloud.google.com/memorystore/memcached/instances)\n2. Click the ID of the instance.\n3. Click **Edit Configuration**.\n4. Delete the value of any parameter that you want to reset to default, and leave the field blank.\n5. Click the **Continue** button to stage the configuration updates.\n6. Select a node, and click **Update Selected Nodes** one at a time for each\n node, or in batches of nodes.\n\n | **Note:** Updating node configurations one at a time, or in batches, helps you avoid instance unavailability and reduces data loss.\n\nWhat's next\n-----------\n\n- Review the available [Memcached configurations](/memorystore/docs/memcached/memcached-configs).\n- Learn how to [scale your Memcached instances](/memorystore/docs/memcached/scaling-instances)."]]