0% found this document useful (0 votes)
46 views

Postgres 10 Ins

The document provides instructions for installing Postgres 10 on Oracle Linux 6.7. It details downloading the Postgres yum repository, installing the postgresql10-server package and its dependencies, initializing the database with initdb, starting the postgresql-10 service and verifying it is running by checking the process list.

Uploaded by

mnsamysuresh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Postgres 10 Ins

The document provides instructions for installing Postgres 10 on Oracle Linux 6.7. It details downloading the Postgres yum repository, installing the postgresql10-server package and its dependencies, initializing the database with initdb, starting the postgresql-10 service and verifying it is running by checking the process list.

Uploaded by

mnsamysuresh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Postgres 10 Installation on Oracle Linux 6.

7
================================================

https://www.postgresql.org/download/linux/redhat/

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/


pgdg-redhat-repo-latest.noarch.rpm
yum install -y http://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/
pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql10-server
service postgresql-10 initdb
chkconfig postgresql-10 on
service postgresql-10 start

[root@dns ~]# cat /etc/redhat-release


Red Hat Enterprise Linux Server release 6.7 (Santiago)

[root@dns Desktop]# cd /etc/yum.repos.d


[root@dns yum.repos.d]# ll
total 16
-rw-r--r--. 1 root root 957 Nov 5 2012 epel.repo
-rw-r--r--. 1 root root 1056 Nov 5 2012 epel-testing.repo
-rw-r--r--. 1 root root 4949 Mar 12 2018 public-yum-ol6.repo

>>

[root@dns Desktop]# yum install -y


http://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-
latest.noarch.rpm
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
pgdg-redhat-repo-latest.noarch.rpm
| 6.5 kB 00:00
Examining /var/tmp/yum-root-K4UEFH/pgdg-redhat-repo-latest.noarch.rpm: pgdg-redhat-
repo-42.0-11.noarch
Marking /var/tmp/yum-root-K4UEFH/pgdg-redhat-repo-latest.noarch.rpm to be installed
Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-
6&arch=x86_64 error was
14: problem making ssl connection
public_ol6_UEKR3_latest
| 2.5 kB 00:00
public_ol6_latest
| 2.7 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package pgdg-redhat-repo.noarch 0:42.0-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
=======================================
Package Arch Version Repository
Size
===================================================================================
=======================================
Installing:
pgdg-redhat-repo noarch 42.0-11 /pgdg-
redhat-repo-latest.noarch 11 k

Transaction Summary
===================================================================================
=======================================
Install 1 Package(s)

Total size: 11 k
Installed size: 11 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : pgdg-redhat-repo-42.0-11.noarch
1/1
Verifying : pgdg-redhat-repo-42.0-11.noarch
1/1

Installed:
pgdg-redhat-repo.noarch 0:42.0-11

Complete!

===================================================================================
================================================================================

=< Above command creates a file named as "pgdg-redhat-all.repo"

[root@dns yum.repos.d]# ll
total 28
-rw-r--r--. 1 root root 957 Nov 5 2012 epel.repo
-rw-r--r--. 1 root root 1056 Nov 5 2012 epel-testing.repo
-rw-r--r--. 1 root root 9154 Apr 27 16:10 pgdg-redhat-all.repo
-rw-r--r--. 1 root root 4949 Mar 12 2018 public-yum-ol6.repo

=============

[root@dns Desktop]# yum install -y postgresql10-server


Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-6Server-x86_64/
repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: pgdg-
common. Please verify its path and try again

>>

[root@dns Desktop]# yum install -y postgresql10-server


Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
pgdg-common
| 2.9 kB 00:00
pgdg-common/primary_db
| 81 kB 00:00
pgdg10
| 3.7 kB 00:00
pgdg10/primary_db
| 174 kB 00:00
https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6Server-x86_64/
repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: pgdg11.
Please verify its path and try again

===================================================================================
===============================================================================

===> FYI : Change all string from https to http on pgdg-redhat-all.repo file .....

>>

[root@dns Desktop]# yum install -y postgresql10-server


Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
pgdg-common
| 2.9 kB 00:00
pgdg10
| 3.7 kB 00:00
pgdg11
| 3.6 kB 00:00
pgdg11/primary_db
| 168 kB 00:04
pgdg12
| 3.6 kB 00:00
pgdg12/primary_db
| 142 kB 00:04
pgdg95
| 3.7 kB 00:00
pgdg95/primary_db
| 172 kB 00:04
pgdg96
| 3.7 kB 00:00
pgdg96/primary_db
| 185 kB 00:07
Resolving Dependencies
--> Running transaction check
---> Package postgresql10-server.x86_64 0:10.14-1PGDG.rhel6 will be installed
--> Processing Dependency: postgresql10-libs(x86-64) = 10.14-1PGDG.rhel6 for
package: postgresql10-server-10.14-1PGDG.rhel6.x86_64
--> Processing Dependency: postgresql10(x86-64) = 10.14-1PGDG.rhel6 for package:
postgresql10-server-10.14-1PGDG.rhel6.x86_64
--> Running transaction check
---> Package postgresql10.x86_64 0:10.14-1PGDG.rhel6 will be installed
---> Package postgresql10-libs.x86_64 0:10.14-1PGDG.rhel6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
=======================================
Package Arch Version
Repository Size
===================================================================================
=======================================
Installing:
postgresql10-server x86_64 10.14-1PGDG.rhel6
pgdg10 5.1 M
Installing for dependencies:
postgresql10 x86_64 10.14-1PGDG.rhel6
pgdg10 1.7 M
postgresql10-libs x86_64 10.14-1PGDG.rhel6
pgdg10 328 k

Transaction Summary
===================================================================================
=======================================
Install 3 Package(s)

Total download size: 7.0 M


Installed size: 27 M
Downloading Packages:
(1/3): postgresql10-10.14-1PGDG.rhel6.x86_64.rpm
| 1.7 MB 00:59
(2/3): postgresql10-libs-10.14-1PGDG.rhel6.x86_64.rpm
| 328 kB 00:15
(3/3): postgresql10-server-10.14-1PGDG.rhel6.x86_64.rpm
| 5.1 MB 03:29
-----------------------------------------------------------------------------------
---------------------------------------

Total
25 kB/s | 7.0 MB 04:45
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : PostgreSQL RPM Building Project <[email protected]>
Package: pgdg-redhat-repo-42.0-11.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : postgresql10-libs-10.14-1PGDG.rhel6.x86_64
1/3
Installing : postgresql10-10.14-1PGDG.rhel6.x86_64
2/3
Installing : postgresql10-server-10.14-1PGDG.rhel6.x86_64
3/3
Verifying : postgresql10-10.14-1PGDG.rhel6.x86_64
1/3
Verifying : postgresql10-server-10.14-1PGDG.rhel6.x86_64
2/3
Verifying : postgresql10-libs-10.14-1PGDG.rhel6.x86_64
3/3

Installed:
postgresql10-server.x86_64 0:10.14-1PGDG.rhel6

Dependency Installed:
postgresql10.x86_64 0:10.14-1PGDG.rhel6 postgresql10-
libs.x86_64 0:10.14-1PGDG.rhel6

Complete!

===================================================================================
========================================================================

[root@dns Desktop]# service postgresql-10 initdb


Initializing database: [ OK ]

[root@dns Desktop]# chkconfig postgresql-10 on

[root@dns Desktop]# service postgresql-10 start


Starting postgresql-10 service: [ OK ]

===================================================================================
========================================================================

[root@dns Desktop]# ps -ef | grep postmaster


postgres 7048 1 0 10:21 ? 00:00:00 /usr/pgsql-10/bin/postmaster -D
/var/lib/pgsql/10/data
root 7062 6285 0 10:21 pts/0 00:00:00 grep postmaster

[root@dns Desktop]# ps -ef | grep postgres


postgres 7048 1 0 10:21 ? 00:00:00 /usr/pgsql-10/bin/postmaster -D
/var/lib/pgsql/10/data
postgres 7050 7048 0 10:21 ? 00:00:00 postgres: logger process

postgres 7052 7048 0 10:21 ? 00:00:00 postgres: checkpointer process

postgres 7053 7048 0 10:21 ? 00:00:00 postgres: writer process

postgres 7054 7048 0 10:21 ? 00:00:00 postgres: wal writer process

postgres 7055 7048 0 10:21 ? 00:00:00 postgres: autovacuum launcher


process
postgres 7056 7048 0 10:21 ? 00:00:00 postgres: stats collector process

postgres 7057 7048 0 10:21 ? 00:00:00 postgres: bgworker: logical


replication launcher
root 7065 6285 0 10:22 pts/0 00:00:00 grep postgres

===================================================================================
========================================================================

[root@dns Desktop]# netstat -nltp


Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
5525/master
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
4679/named-sdb
tcp 0 0 0.0.0.0:51877 0.0.0.0:* LISTEN
4705/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
4576/rpcbind
tcp 0 0 192.168.56.40:53 0.0.0.0:* LISTEN
4679/named-sdb
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
4679/named-sdb
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
5401/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
4888/cupsd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
7048/postmaster
tcp 0 0 ::1:25 :::* LISTEN
5525/master
tcp 0 0 ::1:953 :::* LISTEN
4679/named-sdb
tcp 0 0 :::30397 :::* LISTEN
4705/rpc.statd
tcp 0 0 :::111 :::* LISTEN
4576/rpcbind
tcp 0 0 ::1:53 :::* LISTEN
4679/named-sdb
tcp 0 0 :::22 :::* LISTEN
5401/sshd
tcp 0 0 ::1:631 :::* LISTEN
4888/cupsd
tcp 0 0 ::1:5432 :::* LISTEN
7048/postmaster

===================================================================================
===================================================================

# pwd
/var/lib/pgsql/10/data

[root@dns data]# ll
total 128
drwx------. 5 postgres postgres 4096 Sep 24 10:20 base
-rw-------. 1 postgres postgres 30 Sep 24 10:30 current_logfiles
drwx------. 2 postgres postgres 4096 Sep 24 10:31 global
drwx------. 2 postgres postgres 4096 Sep 24 10:21 log
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_commit_ts
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_dynshmem
-rw-------. 1 postgres postgres 4270 Sep 24 10:29 pg_hba.conf
-rw-------. 1 postgres postgres 1636 Sep 24 10:20 pg_ident.conf
drwx------. 4 postgres postgres 4096 Sep 24 10:26 pg_logical
drwx------. 4 postgres postgres 4096 Sep 24 10:20 pg_multixact
drwx------. 2 postgres postgres 4096 Sep 24 10:21 pg_notify
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_replslot
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_serial
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_snapshots
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_stat
drwx------. 2 postgres postgres 4096 Sep 24 10:42 pg_stat_tmp
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_subtrans
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_tblspc
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_twophase
-rw-------. 1 postgres postgres 3 Sep 24 10:20 PG_VERSION
drwx------. 3 postgres postgres 4096 Sep 24 10:20 pg_wal
drwx------. 2 postgres postgres 4096 Sep 24 10:20 pg_xact
-rw-------. 1 postgres postgres 88 Sep 24 10:20 postgresql.auto.conf
-rw-------. 1 postgres postgres 22984 Sep 24 10:20 postgresql.conf
-rw-------. 1 postgres postgres 57 Sep 24 10:21 postmaster.opts
-rw-------. 1 postgres postgres 103 Sep 24 10:21 postmaster.pid

[root@dns Desktop]# psql -U postgres


psql: FATAL: Peer authentication failed for user "postgres"

[root@dns data]# vi pg_hba.conf

>> Edit Section (TRUST was PEER)


-----------------------------------

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only


local all all trust
# IPv4 local connections:

-----------------------------------------------------------------------------------
-----------------------------------------

[root@dns data]# service postgresql-10 reload

[root@dns Desktop]# psql -U postgres


psql (8.4.20, server 10.14)
WARNING: psql version 8.4, server version 10.0.
Some psql features might not work.
Type "help" for help.

postgres=# select version ();


version

-----------------------------------------------------------------------------------
-----------------------
PostgreSQL 10.14 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red
Hat 4.4.7-23), 64-bit
(1 row)

postgres-# \du
List of roles
Role name | Attributes | Member of

----------------------+--------------
+--------------------------------------------------------------
pg_monitor | Cannot login |
{pg_read_all_settings,pg_read_all_stats,pg_stat_scan_tables}
pg_read_all_settings | Cannot login | {}
pg_read_all_stats | Cannot login | {}
pg_signal_backend | Cannot login | {}
pg_stat_scan_tables | Cannot login | {}
postgres | Superuser | {}
: Create role
: Create DB
Regards,
Sham G

You might also like