在两个EC2实例之间同步postgresql数据库

时间:2015-01-06 13:31:20

标签: amazon-web-services amazon-ec2

在旨在成为奴隶postgresql数据库的EC2实例上运行(虚构的IP地址)时:

ubuntu@ip-127-31-71-50:/var/lib/postgresql/9.3$ sudo -u postgres pg_basebackup -h 54.419.311.274 -D /var/lib/postgresql/9.3/main -U rep -v -P -x

回复是:

pg_basebackup: could not connect to server: could not connect to server: Connection refused
    Is the server running on host "54.419.311.274" and accepting
    TCP/IP connections on port 5432?

在non_AWS实例上成功运行此命令后,我想知道AWS下需要哪些配置才能使其正常运行。 用户postgres作为

存在于主服务器上
sudo su postgres

允许通过其主要用户编辑postgre。

主EC2实例上的postgresql.conf

listen_addresses = 'localhost,54.419.311.274,54.86.79.188'

我错过了什么?

0 个答案:

没有答案