Instructions assume EL8 (EL7 should not be used for new installs)
- If PostgresSQL12: Download the PostgreSQL 12 RPM's for Red Hat Enterprise Linux or CentOS 8, please use the following command to install
rpm -ivh postgresql12-12.3-5PGDG.rhel8.x86_64.rpm postgresql12-libs-12.3-5PGDG.rhel8.x86_64.rpm libicu-60.3-2.el8_1.x86_64.rpm libpq-13.3-1.el8_4.x86_64.rpm postgresql12-server-12.3-5PGDG.rhel8.x86_64.rpm
Otherwise, install the PosgreSQL server by using yum or downloading directly. See instructions for yum install at: https://wiki.postgresql.org/wiki/YUM_Installation
Or see RPMs at: https://yum.postgresql.org/rpmchart.php (then use the yum tutorial for the initialization of the DB). If needed, PGSQL path change:
Go to custom mount point (eg: /u01) and create a folder pgsqldata with postgres permissions
cd /u01
mkdir pgsqldata
chown postgres:postgres pgsqldata
Then, edit the postgresql service
systemctl edit postgresql-12.service
- Go to the custom mount point that has the majority of the disk space
- copy and paste the following into that file:
[Service]
Environment=PGDATA=/<custom mount point>/pgsqldata
- Once edited, run the following commands:
systemctl daemon-reload
/usr/pgsql-12/bin/postgresql-12-setup initdb
systemctl start postgresql-12.service
systemctl enable postgresql-12.service
- Modify the pg_hba.conf file in /<custom mount point>/pgsqldata/ to define what authentication method should be used from all networks to the PostgreSQL server and modify the localhost authentication method (change from indent to md5 and change from localhost to accept all incoming requests):
From
# IPv4 local connections:
host all all 127.0.0.1/32 ident
to
# IPv4 local connections:
host all all 0.0.0.0/0 md5
- Modify the postgresql.conf (also in /<custom mount point>/pgsqldata/ ) file to allow connections from all hosts by uncommenting the following and adding an * instead of localhost:
listen_addresses = '*' - Restart the PostgreSQL service by typing "service postgresql-12 restart” (or the version that is installed)
- Create an empty database for JetPatch, and a user with full access to it:
su -c "createuser --pwprompt <username>" postgres
su -c "createdb -O <username> <dbname>" postgres
In a production environment, you should also set up TLS-secured communication, and you should consider setting up data replication or snapshot-based backups. Consult the PostgreSQL online manual for these settings.
Comments
0 comments
Please sign in to leave a comment.