yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

yum -y updaterebootConfirm the list of enabled repositories.
sudo yum repolistCheck to see if PostgreSQL 14 packages are available on the repository.
yum search postgresql14Now Install Postgresql-14 on both master/slave servers.
yum -y install postgresql14 postgresql14-server
/usr/pgsql-14/bin/postgresql-14-setup initdbStart the PostgreSQL database service.
systemctl start postgresql-14Check the service status to confirm it is running.
systemctl status postgresql-14Enable the service to start when the system is reboted.
systemctl enable postgresql-14Update the PostgreSQL admin user password.
su - postgrespsql -c "alter user postgres with password 'StrongDBPassword'"