Cara Install PostgreSQL Di Linux Centos 7

Dalam kesempatan kali ini saya akan membuat sebuah artikel tentang Cara Install PostgreSQL Di Linux Centos 7. Untuk melakukan installasi PostgreSQL berikut tahapan - tahapan nya yang harus di lakukan.

1. Tambahkan PosgteSQL Yum Repository kedalam Linux Centos 7 

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

Untuk melihat Repository yang telah kita tambahkan kita bisa mengeceknya dengan menjalankan syntak berikut ini.

$ rpm -qi pgdg-redhat-repo
Name        : pgdg-redhat-repo
Version     : 42.0
Release     : 4
Architecture: noarch
Install Date: Thu 19 Sep 2019 06:34:53 PM UTC
Group       : System Environment/Base
Size        : 6915
License     : PostgreSQL
Signature   : DSA/SHA1, Wed 17 Apr 2019 04:12:42 AM UTC, Key ID 1f16d2e1442df0f8
Source RPM  : pgdg-redhat-repo-42.0-4.src.rpm
Build Date  : Wed 17 Apr 2019 04:12:41 AM UTC
Build Host  : koji-centos7-x86-64-pgbuild
Relocations : (not relocatable)
Vendor      : PostgreSQL Global Development Group
URL         : https://yum.postgresql.org
Summary     : PostgreSQL PGDG RPMs- Yum Repository Configuration for Red Hat / CentOS / Scientific Linux
Description :
This package contains yum configuration for Red Hat Enterprise Linux, CentOS
 and Scientific Linux. and also the GPG key for PGDG RPMs.

Disable PostgreSQL yang telah buildin dengan Centos

sudo dnf -qy module disable postgresql

Tahapan selanjutnya install posgreSQL client dan Server

sudo yum -y install epel-release yum-utils
sudo yum-config-manager --enable pgdg12
sudo yum install postgresql12-server postgresql12

Initialize dan jalankan service database

sudo /usr/pgsql-12/bin/postgresql-12-setup initdb

Start dan enable Postresql

sudo systemctl enable --now postgresql-12

Cek Status PostgreSQL

$ systemctl status postgresql-12

SELESAI

Related Articles

Comments