How to install postgres in linux using rpm - DBACLASS DBACLASS
How to install postgres in linux using rpm
postgresql configurationintermediate
by PostgreSQL
12 views
How to install postgres in linux using rpm
123456789101112131415161718192021222324252627
total 16128
-rwxr-xr-x 1 root root 698212 Jul 10 12:17 postgresql14-contrib-14.2-1PGDG.rhel7.x86_64.rpm
-rwxr-xr-x 1 root root 1556440 Jul 10 12:17 postgresql14-14.2-1PGDG.rhel7.x86_64.rpm
-rwxr-xr-x 1 root root 273192 Jul 10 12:17 postgresql14-libs-14.2-1PGDG.rhel7.x86_64.rpm
-rwxr-xr-x 1 root root 5783224 Jul 10 12:17 postgresql14-server-14.2-1PGDG.rhel7.x86_64.rpm
[root@]# <span style="color: #993300;"><strong>rpm -ivh postgresql14-libs-14.2-1PGDG.rhel7.x86_64.rpm</strong></span>
warning: postgresql14-libs-14.2-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:postgresql14-libs-14.2-1PGDG.rhel################################# [100%]
[root@ ]# <span style="color: #993300;"><strong>rpm -ivh postgresql14-14.2-1PGDG.rhel7.x86_64.rpm</strong></span>
warning: postgresql14-14.2-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:postgresql14-14.2-1PGDG.rhel7 ################################# [100%]
[root@ ]#<span style="color: #993300;"><strong> rpm -ivh postgresql14-server-14.2-1PGDG.rhel7.x86_64.rpm</strong></span>
warning: postgresql14-server-14.2-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:postgresql14-server-14.2-1PGDG.rh################################# [100%]
[root@]# <span style="color: #993300;"><strong>rpm -ivh postgresql14-contrib-14.2-1PGDG.rhel7.x86_64.rpm</strong></span>
warning: postgresql14-contrib-14.2-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:postgresql14-contrib-14.2-1PGDG.r################################# [100%]123456789101112131415161718192021222324252627282930313233343536
--Create a data directory and log_directory
mkdir -p /oracle/pg_data
mkdir -p /oracle/pg_data/log
--- Initialize the cluster:
[postgres bin]$ <span style="color: #993300;"><strong>/usr/pgsql-14/bin/initdb --pgdata /oracle/pg_data</strong></span>
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /oracle/pg_data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Riyadh
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/pgsql-14/bin/pg_ctl -D /oracle/pg_data -l logfile start12345678910111213141516171819202122232425262728
[postgres@pg_data]$ <span style="color: #993300;"><strong>/usr/pgsql-14/bin/pg_ctl -D /oracle/pg_data -l logfile start</strong></span>
waiting for server to start.... done
server started
[postgres@pg_data]$<span style="color: #993300;"><strong> psql -d postgres -p 5432</strong></span>
psql (14.2)
Type "help" for help.
postgres=# <span style="color: #993300;"><strong>\list</strong></span>
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(3 rows)
postgres=#
vi /oracle/pg_data/postgres.conf
<span style="color: #993300;"><strong>listen_addresses='*'</strong></span>
postgres$ <span style="color: #993300;"><strong>/usr/pgsql-14/bin/pg_ctl stop -D /oracle/pg_data</strong></span>
postgres$ <span style="color: #993300;"><strong>/usr/pgsql-14/bin/pg_ctl start -D /oracle/pg_data</strong></span>Please to add comments
No comments yet. Be the first to comment!