如何使用pg_dump连接到我的RDS实例?
这是实例的端点:
<long public dns thing>:5432
所以我运行这个命令:
pg_dump -h <long public dns thing> -p 5432 -f dump.sql
并得到这样的结论:
pg_dump: [archiver (db)] connection to database "brendan" failed:
could not connect to server: Connection refused
Is the server running on host "<long public dns thing>"
(<IP address>) and accepting TCP/IP connections on port 5432?
以下是亚马逊的故障排除建议:
Cannot Connect to Amazon RDS PostgreSQL DB Instance
The most common problem when attempting to connect to a PostgreSQL DB instance is that the security group assigned to the DB instance has incorrect access rules. By default, DB instances do not allow access; access is granted through a security group. To grant access, you must create your own security group with specific ingress and egress rules for your situation. For more information about creating a security group for your DB instance, see Create a Security Group.
The most common error is could not connect to server: Connection timed out. If you receive this error, check that the host name is the DB instance endpoint and that the port number is correct. Check that the security group assigned to the DB instance has the necessary rules to allow access through your local firewall.个
有没有办法从pg_dump指定我的安全组?如果是这样,我是否必须像ssh‘ing时需要ssh密钥那样获取该文件的本地副本?
甚至try 远程使用pg_dump都是错误的吗?我应该只try ssh到实例上,还是做一些完全不同的事情呢?