This page describes how to configure a MongoDB Atlas source database to work with Datastream using Virtual Private Cloud peering. Note that the described procedure isn't a high availability solution. If the MongoDB node fails the connection profile test, you need to manually run the startup script referenced further in this page on the network address translation (NAT) virtual machine (VM).
Because Virtual Private Cloud peering is non-transitive, you must configure a NAT gateway using a Compute Engine VM to route traffic from Datastream to MongoDB Atlas.
Configure a MongoDB database user
To use Datastream with a MongoDB Atlas instance, you first need to create a database user and grant them access privileges:
- In the MongoDB Atlas dashboard, under Security, click Database access.
- Click New database user and select the password authentication method for your user.
- Enter the username and password for your Datastream user.
- Under Database user privileges, select Grant specific user privileges.
- Under Specific privileges, add the following role:
readAnyDatabase
- Click Add user.
Set up your Virtual Private Cloud network
Identify the Virtual Private Cloud network in your Google Cloud project to peer with both
Datastream and MongoDB Atlas. This page assumes that you use the
default VPC and its subnet, for example the default subnet in the us-central1
region.
- Ensure that the network that you identified doesn't have overlapping IP address ranges with your Datastream or MongoDB Atlas networks.
- Create a private connectivity configuration
to peer Datastream with your Virtual Private Cloud network:
- Make sure that you select VPC peering from the Private connectivity method drop-down.
- Select your
defaultVPC network. - Provide an unused IP address range, for example