Postgres 10 Installation on Oracle Linux 6.
7
================================================
[Link]
yum install -y [Link]
[Link]
yum install -y [Link]
[Link]
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/[Link].d
[root@dns [Link].d]# ll
total 16
-rw-r--r--. 1 root root 957 Nov 5 2012 [Link]
-rw-r--r--. 1 root root 1056 Nov 5 2012 [Link]
-rw-r--r--. 1 root root 4949 Mar 12 2018 [Link]
>>
[root@dns Desktop]# yum install -y
[Link]
[Link]
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
[Link]
| 6.5 kB 00:00
Examining /var/tmp/yum-root-K4UEFH/[Link]: pgdg-redhat-
[Link]
Marking /var/tmp/yum-root-K4UEFH/[Link] to be installed
Could not get metalink [Link]
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 [Link] 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-
[Link] 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 : [Link]
1/1
Verifying : [Link]
1/1
Installed:
[Link] 0:42.0-11
Complete!
===================================================================================
================================================================================
=< Above command creates a file named as "[Link]"
[root@dns [Link].d]# ll
total 28
-rw-r--r--. 1 root root 957 Nov 5 2012 [Link]
-rw-r--r--. 1 root root 1056 Nov 5 2012 [Link]
-rw-r--r--. 1 root root 9154 Apr 27 16:10 [Link]
-rw-r--r--. 1 root root 4949 Mar 12 2018 [Link]
=============
[root@dns Desktop]# yum install -y postgresql10-server
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
[Link]
repodata/[Link]: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata ([Link]) 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
[Link]
repodata/[Link]: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata ([Link]) for repository: pgdg11.
Please verify its path and try again
===================================================================================
===============================================================================
===> FYI : Change all string from https to http on [Link] 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 [Link]
Importing GPG key 0x442DF0F8:
Userid : PostgreSQL RPM Building Project <pgsqlrpms-hackers@[Link]>
Package: [Link] (@/[Link])
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 ? [Link] /usr/pgsql-10/bin/postmaster -D
/var/lib/pgsql/10/data
root 7062 6285 0 10:21 pts/0 [Link] grep postmaster
[root@dns Desktop]# ps -ef | grep postgres
postgres 7048 1 0 10:21 ? [Link] /usr/pgsql-10/bin/postmaster -D
/var/lib/pgsql/10/data
postgres 7050 7048 0 10:21 ? [Link] postgres: logger process
postgres 7052 7048 0 10:21 ? [Link] postgres: checkpointer process
postgres 7053 7048 0 10:21 ? [Link] postgres: writer process
postgres 7054 7048 0 10:21 ? [Link] postgres: wal writer process
postgres 7055 7048 0 10:21 ? [Link] postgres: autovacuum launcher
process
postgres 7056 7048 0 10:21 ? [Link] postgres: stats collector process
postgres 7057 7048 0 10:21 ? [Link] postgres: bgworker: logical
replication launcher
root 7065 6285 0 10:22 pts/0 [Link] 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 [Link]:25 [Link]:* LISTEN
5525/master
tcp 0 0 [Link]:953 [Link]:* LISTEN
4679/named-sdb
tcp 0 0 [Link]:51877 [Link]:* LISTEN
4705/[Link]
tcp 0 0 [Link]:111 [Link]:* LISTEN
4576/rpcbind
tcp 0 0 [Link]:53 [Link]:* LISTEN
4679/named-sdb
tcp 0 0 [Link]:53 [Link]:* LISTEN
4679/named-sdb
tcp 0 0 [Link]:22 [Link]:* LISTEN
5401/sshd
tcp 0 0 [Link]:631 [Link]:* LISTEN
4888/cupsd
tcp 0 0 [Link]:5432 [Link]:* LISTEN
7048/postmaster
tcp 0 0 [Link] :::* LISTEN
5525/master
tcp 0 0 [Link] :::* LISTEN
4679/named-sdb
tcp 0 0 :::30397 :::* LISTEN
4705/[Link]
tcp 0 0 :::111 :::* LISTEN
4576/rpcbind
tcp 0 0 [Link] :::* LISTEN
4679/named-sdb
tcp 0 0 :::22 :::* LISTEN
5401/sshd
tcp 0 0 [Link] :::* LISTEN
4888/cupsd
tcp 0 0 [Link] :::* 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 [Link]
-rw-------. 1 postgres postgres 22984 Sep 24 10:20 [Link]
-rw-------. 1 postgres postgres 57 Sep 24 10:21 [Link]
-rw-------. 1 postgres postgres 103 Sep 24 10:21 [Link]
[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