The cloud migration feature of ApsaraDB RDS for PostgreSQL allows you to migrate the
data of a self-managed PostgreSQL instance from an Elastic Compute Service (ECS) instance
or 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 access to the port of the self-managed PostgreSQL instance before
a cloud migration.
Procedure
Note 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.
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.
Note You can also disable the firewall of the server before a cloud migration. In this
case, you do not need to configure the firewall.