Install and Configure PostgreSQL

Hi,

I have created installed and configured postgres as required. but still, it shows the task as a failure. Please find the attached snapshot.

I am able to login with the given user to the required DB with md5 authentication.

The error states “postgresql package is not installed on DB Server”

What am I missing?

Hi,
How did you installed the postgres server ?

I added the PostgreSQL repository and then installed it using yum.

Hi @dipjyoty

We didn’t find any required steps been performed by you in your answer. Did you mistakenly click on Finish button before doing the required steps ? Please note that any changes made after clicking on Finish are not considered in original answer.

Hi @Inderpreet

I am very sure I did perform everything before clicking the finish button.

You can see in this screenshot that the failed task timer had just elapsed 50 seconds and I am logged in with the user kodekloud_aim on the DB kodekloud_db8 with MD5 authentication.


Same issue here!!

@dipjyoty @nohier-hassan

Weird issue for both of you. We have marked this task as Pending for you both. Please try again.

1 Like

thank you so much for responding so fast
keep the Amazing job you are doing :smiley: :smiley:

Thank you @Inderpreet :slight_smile:


gave this error this time :sweat_smile:
@Inderpreet

@nohier-hassan

This is marked as Success for you. We will investigate further what exactly issue is. Thanks for your patience.

@Inderpreet
Thank you :grin: :grin:

I have installed and configured task and was able to login to DB via user but task was failed with below

Task Status - Failed

postgres service is not up and running on DB Server

root@stdb01 ~]# vi /var/lib/pgsql/12/data/pg_hba.conf
[root@stdb01 ~]# systemctl restart postgresql-12
[root@stdb01 ~]# systemctl restart postgresql-12
[root@stdb01 ~]# psql kodekloud_db4 -U kodekloud_pop
Password for user kodekloud_pop:
psql (12.2)
Type “help” for help.

kodekloud_db4=> thor@jump_host /$ ssh peter@stdb01
peter@stdb01’s password:
Last login: Sun Mar 22 09:42:05 2020 from jump_host.linuxpostgresql_db_net
[peter@stdb01 ~]$ sudo su -
[sudo] password for peter:
Last login: Sun Mar 22 09:42:14 UTC 2020 on pts/0
[root@stdb01 ~]# systemctl status postgres-12
Unit postgres-12.service could not be found.
[root@stdb01 ~]# systemctl status postgresql-12
● postgresql-12.service - PostgreSQL 12 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2020-03-22 10:08:37 UTC; 4min 21s ago
Docs: PostgreSQL: Documentation: 12: PostgreSQL 12.16 Documentation
Process: 491 ExecStartPre=/usr/pgsql-12/bin/postgresql-12-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 496 (postmaster)
CGroup: /docker/5ca52fb7e8d716f1f449a597af2de3bdc8272d9926e3dd067c381ac1a8a952bf/system.slice/postgresql-12.service
├─496 /usr/pgsql-12/bin/postmaster -D /var/lib/pgsql/12/data/
├─497 postgres: logger
├─499 postgres: checkpointer
├─500 postgres: background writer
├─501 postgres: walwriter
├─502 postgres: autovacuum launcher
├─503 postgres: stats collector
└─504 postgres: logical replication launcher

Mar 22 10:08:37 stdb01 systemd[1]: Starting PostgreSQL 12 database server…
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.333 UTC [496] LOG: starting PostgreSQL 12.2 on x86_6…64-bit
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.334 UTC [496] LOG: listening on IPv4 address "127.0…t 5432
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.334 UTC [496] LOG: could not bind IPv6 address “::1”…ddress
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.334 UTC [496] HINT: Is another postmaster already ru…retry.
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.335 UTC [496] LOG: listening on Unix socket “/var/ru…5432”
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.337 UTC [496] LOG: listening on Unix socket “/tmp/.s…5432”
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.346 UTC [496] LOG: redirecting log output to logging…rocess
Mar 22 10:08:37 stdb01 postmaster[496]: 2020-03-22 10:08:37.346 UTC [496] HINT: Future log output will appear in…“log”.
Mar 22 10:08:37 stdb01 systemd[1]: Started PostgreSQL 12 d

@Inderpreet
I attempted the question again, this time got error “the service is not up and running”.

Hi @Inderpreet any update on this?

Hi @dipjyoty @vivek.karakandy

Task is marked Success for you guys. Thanks for your patience.

We figured out the issue with validation and its fixed now.

Hi, @Inderpreet thanks for the update, however it still shows the task as failed in my profile.

@dipjyoty Please check now.

@Inderpreet it’s reflecting now. Thank you so much :slight_smile: