Nishadh KA

AWS postgresql remote host connection

2013-11-05


  1. To connect and run PostgreSQL database for istsos in AWS ubuntu 12.04. As per istsos tutorial, specifying localhost in database credentials says the database is inactive and subsequent service creation will end up in error, saying the wrong database the PostgreSQL TCP/IP connection and access credentials has to change.

  2. have to edit sudo nano /etc/postgresql/9.1/main/postgresql.conf file with line listen_addresses ‘localhost’ to listen_addresses ‘*’ and sudo nano /etc/postgresql/9.1/main/pg_hba.conf file line ipv4 section IP address to host all all 0.0.0.0/0 md5 the line #host all all 127.0.0.1/32 md5 has to be uncomment as above.

  3. then PostgreSQL has to be restarted by this comment /etc/init.d/postgresql Restart the aws security group also has to be changed for a credential for port number 5432 with allowable ip address. and the port for PostgreSQL is the AWS instance name given by AWS

based on

  1. https://github.com/snowplow/snowplow/wiki/Setting-up-PostgreSQL
  2. http://hackgeo.com/cloud-computing/amazon-web-services/configuring-postgresql-9-1-and-postgis-2-on-ubuntu-12-04-in-amazon-aws
  3. http://askubuntu.com/questions/50621/cannot-connect-to-postgresql-on-port-5432
  4. http://www.cyberciti.biz/faq/postgresql-remote-access-or-connection/