The Nautilus application development team has shared that they are planning to deploy one newly developed application on Nautilus infra in Stratos DC. The application uses PostgreSQL database, so as a pre-requisite we need to set up PostgreSQL database server as per requirements shared below:
c. Create a database kodekloud_db10 and grant full permissions to user kodekloud_rin on this database.
d. Make appropriate settings to allow all local clients (local socket connections) to connect to the kodekloud_db10 database through kodekloud_rin user using md5 method (Please do not try to encrypt password with md5sum).
e. At the end its good to test the db connection using these new credentials from root user or server's sudo user.
ssh peter@stdb01
sudo su -
yum install postgresql-server postgresql-contrib -y
postgresql-setup initdb
systemctl enable postgresql
sudo systemctl start postgresql
systemctl status postgresql
sudo -u postgres psql postgres
Create user, database, and grant permission
CREATE USER kodekloud_gem WITH PASSWORD 'LQfKeWWxWD';
CREATE DATABASE kodekloud_db10;
GRANT ALL PRIVILEGES ON DATABASE "kodekloud_db10" to kodekloud_gem;
sudo vi /var/lib/pgsql/data/pg_hba.conf
local all all md5
host all all 127.0.0.1/32 md5
sudo vi /var/lib/pgsql/data/postgresql.conf
sudo systemctl restart postgresql
sudo systemctl status postgresql.service
psql -U kodekloud_aim -d kodekloud_db8 -h 127.0.0.1 -W ## Change name according to question
#### for the test on mode postgres u have
## \conninfo
## \l
## \dg+
## \q # to quit
psql -U kodekloud_gem -d kodekloud_db10 -h localhost -W