The cloud migration feature of ApsaraDB RDS for PostgreSQL allows you to migrate data from a self-managed PostgreSQL instance that is deployed on an Elastic Compute Service (ECS) instance or in a data center to an ApsaraDB RDS for PostgreSQL instance. This topic describes how to configure the firewall of the server on which a self-managed PostgreSQL instance resides to allow external access to the port of the self-managed PostgreSQL instance before a cloud migration.
Procedure
In this topic, the server on which the self-managed PostgreSQL instance resides runs CentOS. For more information about how to configure the firewall of a server that runs a different operating system, see the related official documentation.
CentOS 7
Connect to the server on which the self-managed PostgreSQL instance resides.
View the ports that are opened.
firewall-cmd --list-ports
Configure the port of the self-managed PostgreSQL instance to allow access to the port.
firewall-cmd --zone=public --add-port=5432/tcp --permanent
Restart the firewall of the server.
firewall-cmd --reload
CentOS 6 or earlier versions
Connect to the server on which the self-managed PostgreSQL instance resides.
View the ports that are opened.
/etc/init.d/iptables status
Open port 5432.
/sbin/iptables -I INPUT -p tcp --dport 85432 -j ACCEPT
Restart the firewall of the server.
service iptables restart
You can also disable the firewall of the server before a cloud migration. In this case, you do not need to configure the firewall.
CentOS 7:
systemctl stop firewalld.service
CentOS 6 or earlier versions:
service iptables stop