Overview
In certain migration scenarios it might not be possible to establish direct connectivity between the source and the destination databases. In such cases we recommend using a TCP proxy VM for routing traffic. You can set up a TCP proxy VM with an automated script generated by Database Migration Service.
When you create a migration job, Database Migration Service collects the required information and generates a script that sets up the proxy VM. This script runs several Google Cloud CLI commands that perform the following:
Creates and configures a Compute Engine instance in the same project and VPC as the destination database.
This VM runs a transparent TCP proxy that by default has private and public IPs. The proxy starts serving incoming connections immediately after booting.
Creates a firewall rule to allow connections from the AlloyDB for PostgreSQL destination database to the proxy.
Set up the TCP proxy VM
In the Google Cloud console, when you set up connectivity between the source and destination, perform the following steps:
From the Connectivity method drop-down menu, select Proxy via cloud-hosted VM - TCP.
Specify the following configuration parameters of the Compute Engine instance that will serve as the bastion host:
- Compute Engine VM instance name: The name for the Compute Engine instance.
- Machine type: The Compute Engine machine type, for example
n1-standard-n1
. - Subnetwork: The subnet of the destination VPC.
Click View script to view the generated script.
Run the script on a machine that has access to the Google Cloud project of the destination database.
Make sure that the following settings are updated to accept connections from the outgoing IP address of the TCP proxy:
The replication connections section of the
pg_hba.conf
file (for a self-managed source instance).The security group definitions (for an Amazon RDS/Aurora source instance).
Click Configure & continue.
If your source is within a VPN (in AWS, for example, or your own on-premises VPN), see Configure connectivity using VPNs for more information about configuring the source VPN and Google Cloud VPN to work with each other.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-19 UTC.