By: Suriyal
In the tutorial we will learn how to fix the PostgreSQL client’s access and connectivity related issues in Amazon AWS ec2 Ubuntu VM. This will also help if you have installed ODK Aggregate on ec2 instance. We will also cover some access related issues of ODK Aggregate if PstgreSQL is used as database.
(a) I am using PuTTY to connect to the ec2 machine. You can use any method of your choice to connect to ec2 vm.
(b) Once successfully connected your screen will look like the following. Enter the user name, password and press enter (enter ubuntu if using ubuntu machine).
(c) After successful login your screen will look like below
(d) Now go to the desire path (/etc/postgresql/10/main/ ) to perform certain actions. To go to this path ” /etc/postgresql/10/main/ ” just type the following command and press enter as shown in the following image.
cd /etc/postgresql/10/main/
(e) Now we are in the location where postgresql.conf file and pg_hba.conf file exists and we want to edit these two files
sudo vim postgresql.conf
(f) Type the following command and press enter key to open the pg_hba.conf file to edit
Once the pg_hba.conf is opened (as shown in the following image) just press ” i ” from keyboard to activate the insert mode.
(g) Enter the following command to restart the PostgreSQL services
sudo service postgresql restart
(h) Check and add Inbound Rules under the security group of the VM. This setting is just for testing purpose please use the setting as per your requirement.
Now test and check if you are able to connect with the server or db from client.
Thank you for reading this “PostgreSQL Connection Refused or Timeout Expired ” tutorial
Have a great learning experience !
Note : The details provided in this tutorial are for educational or testing purpose only. Use the configuration as suggested by your IT team.
Leave a Reply