Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connectivity issue with AWS DMS with Postgresql on RDS

I have 2 Aws RDS instances,(Run on Postgresql). Both are on Different accounts and different regions. I want to set up data replication between them, using AWS DMS. I tried doing VPC peering. I saw the following video to enable VPC peering :-

https://www.youtube.com/watch?v=KmCEFGDTb8U

The Problem:- When I try creating the AWS DMS service, I add the Hostname, Username and Password, etc for the source(Which exists on the other account), and when I hit Test Connection, I get the following error.

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to connect Network error has occurred, Application-Detailed-Message: RetCode: SQL_ERROR SqlState: 08001 NativeError: 101 Message: [unixODBC]timeout expired ODBC general error.

To my surprise, I get a similar error when I hit the Test Connection for the Target RDS instance, which is in the same account. i.e.:-

Test Endpoint failed: Application-Status: 1020912, Application-Message: Cannot connect to ODBC provider Network error has occurred, Application-Detailed-Message: RetCode: SQL_ERROR SqlState: 08001 NativeError: 101 Message: [unixODBC]timeout expired ODBC general error.

Google suggests that we are having some sort of Firewall, but looking at the NACLs I can see we allow 0.0.0.0/0 for both the VPC's.

like image 282
user124665 Avatar asked Oct 17 '18 16:10

user124665


People also ask

What is DMS in Postgres?

Using DMS to migrate data from PostgreSQL to PostgreSQL AWS DMS can migrate data, for example, from a source PostgreSQL database that is on premises to a target Amazon RDS for PostgreSQL or Aurora PostgreSQL instance. Core or basic PostgreSQL data types most often migrate successfully.

Does DMS migrate primary key?

In FULL LOB or LIMITED LOB mode, AWS DMS doesn't support replication of primary keys that are LOB data types. DMS initially migrates a row with a LOB column as null, then later updates the LOB column. So, when the primary key is created on a LOB column, the initial insert fails since the primary key can't be null.

Does AWS DMS require VPN?

Starting today, you can privately connect your Amazon Virtual Private Cloud (VPC) to AWS Database Migration Service (DMS) without requiring an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection.


1 Answers

If you're attempting to access the private IP ranges in one IP from another IP, in addition to creating the VPC Peering connections, you'll have to:

  • create route table entries in both VPCs to route traffic to the remote VPC's IP range(s) through the Peering Connection,
  • allow connections within the security groups, both from the source CIDR range in the destination security group, and, if you're filtering outgoing connections from the source, also in it's outbound rules. Note that you can't use Security Group Id to allow this traffic because it doesn't apply to cross region peering;
  • allow the connection in the underyling software ( probably allowed by default ),
  • allow the network ACL to pass the traffic ( you've verified that's also allowed by default)

Since you're seeing timeouts, I'd suspect the security group rules. But, it could also be a bad route.

like image 52
Daniel Farrell Avatar answered Oct 23 '22 11:10

Daniel Farrell