Install Configure PostgreSQL Task

@mmumshad @Inderpreet @kodekloud-support3
Would you please check my “Install and Configure PostgresSQL” task. I thought I did it correctly and clicked “Finish” I however got status failed. And I don’t know why. I attached you some screenshots.




This is the reason shown on the failed status
"PostgreSQL is not configured correctly, either user ‘kodekloud_pop’ and database ‘kodekloud_db1’ does not exist or user ‘kodekloud_pop’ does not has appropriate permissions on database ‘kodekloud_db1’ on DB Server"

Kind regards
LuHa

Have you initialize the PostgreSQL DB using,
sudo postgresql-setup initdb
If not then you need to first initialize the DB.
Secondly, you need to login Postgresql using
sudo -u postgres psql
After login you need to create the user and database and grant the permission.

Also, you need to just change only one configuration line from /var/lib/pgsql/data/pg_hba.conf
local all all peer to local all all md5

After that you need to restart the postgresql service.

@AkshayT thanks for replying. Yes, I did initialize the database. And did the necessary configuration on the pg_hba.conf file and restarted the service.

Dear @mmumshad @Inderpreet @kodekloud-support3
I am eagerly waiting for your reply. Would you please check my PostgreSQL Task?
kind regards.

You did typo at all. Database name is kodekloud_db1 not kodeKloud_db1 :frowning:

Thanks @player001 for replying. Is that the case and does it really mater? Is name of a database case sensitive? I don’t know that can be, but it will be very pity if I miss it because of it.

i am getting below error while connecting to postgresql.

psql -d kodekloud_db1 -U kodekloud_top -W
Password for user kodekloud_top:
psql: FATAL: Peer authentication failed for user “kodekloud_top”

You have to make a changes in pg_hba.conf file of postgresql. In local connection column, change peer to md5. Don’t change in replication connection.