Stabilire una connessione di accesso privato ai servizi
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina spiega come stabilire una connessione di accesso privato ai servizi per una rete. Qualsiasi rete su cui esegui il provisioning di un'istanza Memorystore for Memcached deve avere una connessione di accesso privato ai servizi. In caso contrario, non puoi selezionare questa rete quando crei un'istanza Memorystore per Memcached. Per ulteriori dettagli, consulta Networking.
Ti consigliamo che il team di networking o l'amministratore di networking della tua organizzazione gestisca questi passaggi per configurare una connessione di accesso privato ai servizi prima di consentire agli sviluppatori di applicazioni di eseguire il provisioning delle istanze Memcached.
Se sei uno sviluppatore di applicazioni, in genere è il team di networking a gestire la creazione di una connessione di accesso privato ai servizi. Per maggiori dettagli, vedi Comunicare i requisiti di rete.
Esistono tre modi per configurare una connessione di accesso privato ai servizi.
Gcloud (consigliato)
Stabilisce una connessione di accesso privato ai servizi prima del processo di creazione dell'istanza Memcached.
Console: rete VPC
Stabilisce la connessione prima della procedura di creazione dell'istanza Memcached.
Console: Memcached
Stabilisce la connessione durante la procedura di creazione dell'istanza Memcached.
Memorystore sceglie automaticamente un intervallo CIDR per te, quindi non devi specificarlo. Tuttavia, puoi impostare la lunghezza del prefisso CIDR.
Per questo esempio, la durata è impostata su 24. Questo valore deve essere almeno 24, ma puoi impostarlo su una lunghezza del prefisso inferiore, ad esempio 23. In questo modo viene creato un intervallo di indirizzi IP più ampio.
Verifica se è stata stabilita una connessione di accesso privato ai servizi per la tua rete.
Se la connessione è già stata stabilita, consulta Creare istanze Memcached per istruzioni su come creare un'istanza Memcached.
Segui i passaggi descritti in Creare istanze Memcached until you see a panel that says, Private service connection required.
Fai clic sul pulsante Configura connessione nel riquadro Connessione
a servizi privati. Si aprirà un riquadro scorrevole per configurare l'accesso ai servizi privati.
Abilita l'API Service Networking.
Assegna un intervallo IP utilizzando uno dei seguenti metodi:
Seleziona un intervallo IP esistente.
Alloca un nuovo intervallo IP.
Inserisci un nome per l'intervallo.
Inserisci un intervallo CIDR valido con una dimensione del blocco di /24. Ad esempio:
10.0.0.0/24.
Utilizza un intervallo IP allocato automaticamente.
[[["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-10 UTC."],[],[],null,["# Establish a private services access connection\n\nThis page explains how to establish a private services access connection for a\nnetwork. Any network on which you provision a Memorystore for Memcached instance must\nhave a private services access connection. Otherwise, you cannot select that\nnetwork when creating a Memorystore for Memcached instance. See [Networking](/memorystore/docs/memcached/networking)\nfor more details.\n\nWe recommend that your organization's networking team / networking admin manage\nthese steps for setting up a private services access connection before allowing\napplication developers to provision Memcached instances.\n\nIf you are an application developer, usually your networking team should manage\nestablishing a private services access connection. For more details, see [Communicating networking requirements](/memorystore/docs/memcached/networking#communicating_networking_requirements).\n\nThere are three ways to set up a private services access connection.\n\n1. **Gcloud** (Recommended)\n\n - Establishes a private services access connection before the Memcached instance creation process.\n2. **Console: VPC network**\n\n - Establishes the connection before the Memcached instance creation process.\n3. **Console: Memcached**\n\n - Establishes the connection during the Memcached instance creation process.\n\n### gcloud\n\n1. Enable the Service Networking API:\n\n [Enable the Service Networking API](https://console.cloud.google.com/apis/library/servicenetworking.googleapis.com)\n\n2. [Check to see](/memorystore/docs/memcached/verifying-connection) if\n a private service access connection has been established for your network.\n\n - If the connection has already been established, see [Creating Memcached instances](/memorystore/docs/memcached/creating-managing-instances#creating_memcached_instances) for instructions on how to create a Memcached instance.\n3. Open a terminal window.\n\n4. Set your default project by running the following command, replacing\n \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate values:\n\n ```\n gcloud config set core/project project-id\n ```\n5. Reserve an IP address range in your network by running the following command:\n\n ```\n gcloud compute addresses create reserved-range-name --global --prefix-length=24 --description=description --network=vpc-network --purpose=vpc_peering\n ```\n - Memorystore chooses a CIDR range for you automatically so you\n don't have to specify it. However, you can set the CIDR prefix length.\n For this example, the length is set to `24`. This value must be at\n least `24`, but you can set it to any smaller prefix length, such as\n `23`. This creates a larger IP address range.\n\n - For information on managing private services access, see [Configuring private services access](/vpc/docs/configure-private-services-access).\n\n6. Create a [private connection](/vpc/docs/configure-private-services-access#creating-connection)\n between your network and the private services access network by running the\n following command:\n\n ```\n gcloud services vpc-peerings connect --service=servicenetworking.googleapis.com --ranges=reserved-range-name --network=vpc-network --project=project-id\n ```\n\n### Console: VPC network\n\n1. Enable the Service Networking API:\n\n [Enable the Service Networking API](https://console.cloud.google.com/apis/library/servicenetworking.googleapis.com)\n\n2. [Check to see](/memorystore/docs/memcached/verifying-connection) if\n a private service access connection has been established for your network.\n\n - If the connection has already been established, see [Creating Memcached instances](/memorystore/docs/memcached/creating-managing-instances#creating_memcached_instances) for instructions on how to create a Memcached instance.\n3. Go to the VPC Networks page in the Google Cloud console.\n\n [Go to the VPC networks page](https://console.cloud.google.com/networking/networks/list?) \n\n4. Click the name of your network. Usually it is named \"default\".\n\n5. Click **Private service connection**.\n\n6. Click **Allocate IP ranges for services**.\n\n7. Click **Allocate IP range**.\n\n - Enter a name for your range, such as \"private-services-access-range\".\n - Enter a description for your range, such as \"Range of IP addresses to be used for the Private services access connection\".\n - Select **Automatic** if you want Google to choose your range for you.\n 1. Enter a CIDR prefix of `/24` or less. For example, `/23` is an acceptable prefix.\n - Select **Custom** if you want to choose the range yourself.\n 1. Enter your desired range with a CIDR prefix of `/24` or less.\n - Click **Allocate**.\n8. Click **Private connections to services**.\n\n9. Click the **Create connection** button.\n\n10. Under the **Assigned allocation** dropdown, select the range you just\n created in the steps above.\n\n11. Click **Ok**.\n\n12. Click **Connect**.\n\n13. Refresh the page to see your new connection listed under the **Private\n connections to services** tab.\n\n### Console: Memcached\n\n1. Enable the Service Networking API:\n\n [Enable the Service Networking API](https://console.cloud.google.com/apis/library/servicenetworking.googleapis.com)\n\n2. [Check to see](/memorystore/docs/memcached/verifying-connection) if\n a private service access connection has been established for your network.\n\n - If the connection has already been established, see [Creating Memcached instances](/memorystore/docs/memcached/creating-managing-instances#creating_memcached_instances) for instructions on how to create a Memcached instance.\n3. Follow the steps at [Creating Memcached instances](/memorystore/docs/memcached/creating-managing-instances#creating_memcached_instances)\n until you see a panel that says, **Private service connection required**.\n\n | **Note:** you do not need to complete the instance creation steps in order to establish a private services access connection. You can establish the connection for your network, and abandon the instance creation process, if you wish.\n4. Click the **Set Up Connection** button in the **Private service\n connection** panel. Doing so opens a slide out panel for setting up\n private services access.\n\n5. Enable the Service Networking API.\n\n6. Allocate an IP range using one of the following methods:\n\n - Select an existing IP range.\n - Allocate a new IP range.\n - Enter a **name** for your range.\n - Enter a valid CIDR range with a block size of `/24`. For example: `10.0.0.0/24`.\n - Use an automatically allocated IP range.\n7. Click the **Create Connection** button.\n\nWhat's next\n-----------\n\n- [Create a Memcached instance](/memorystore/docs/memcached/creating-managing-instances).\n- [Connect to a Memcached instance](/memorystore/docs/memcached/connecting-memcached-instance)."]]