Background
Different EDB Postgres AI Clusters have different connection strings. The hostname is generated from the cluster id.
If you want to use the same connection string for the new cluster after a failover, this can be achieved by Azure Private DNS Zones but you can always choose the other tool you prefer.
Goal
I want to connect to the clusters with the fixed host: prod.abctest.com privately
Steps
By following the below steps, after a failover, you can delete the old record set and add a new one with the same name for the new cluster.
Azure | |
Private Endpoint |
Private DNS zone A-record: map connection string to private IP Address |
VPC peering/Vnet-Vnet |
Private DNS zone CNAME: map connection string to private hostname |
Public Access |
DNS Zone CNAME: map connection string to hostname |
Connect via Azure Private Endpoint
Step 1 Create the private endpoint by following EDB Docs - Connecting from Azure (enterprisedb.com).
Step 2 In Step2 Create an Azure Private DNS Zone for the private endpoint,
2.1 create a private DNS zone, name: abctest.com. Add virtual network link accordingly
2.2 Add a record, name is prod, type is A - Address record the address is a private IP address you got from Step 1.
Connect via Azure Vnet Peering or Vnet-Vnet
Step 1 Configure peering by following the doc Virtual network peering or Vnet-Vnet. Now you can connect Cluster via the given host
Step 2 Setup Private DNS zone
2.1 Create a private DNS zone, name: abctest.com. Add client virtual network link
2.2 Add a record, name is prod, type is CNAME, value is the private host
Connect from Internet
Step 1 Setup Public DNS zone, domain name: abctest.com
Step 2 Add a record, name is prod, type is CNAME, value is the host