Setup postgresql92 » Historie » Revision 2
« Zurück |
Revision 2/6
(Vergleich)
| Weiter »
Jeremias Keihsler, 12.04.2019 15:26
Install Procedure for PostgreSQL 9.2¶
Requirements¶
To install postgresql you will need the following:- a installed and supported operating system (e.g. CentOS 7.x)
- root-access
- a fast internet connection
Preliminary Note¶
This procedure is based on a documentation supplied byInstall¶
Install postgresql and postgresql-server packages on CentOS 6.x:¶
Configure PostgreSQL 9.2 Database Server¶
Initialize the cluster first with initdb command:
Edit /var/lib/pgsql/data/postgresql.conf file:
Set PostgreSQL server to listen all addresses and Change PostgreSQL port (default is 5432). Add/Uncomment/Edit following lines:
Edit /var/lib/pgsql/data/pg_hba.conf file:
Add (example) your local network with md5 passwords:
...
# Local networks
local all all trust
host all all xx.xx.xx.xx/xx md5
# Example
host all all 10.20.4.0/24 md5
host all mes 0.0.0.0/0 md5
manually start PostgreSQL Server:
automatically start the service at boot time:
you can check the runlevels by
you should get an output like:
Change to postgres user:
Create test database (as postgres user):
Login test database (as postgres user):
Create New “testuser” Role with Superuser and Password:
logout from
psql by \q
configure firewall¶
Open PostgreSQL Port (5432) on Iptables Firewall (as root user again)
add port
5432:tcp
check if settings are ok
You should have following line before COMMIT:
Restart Iptables Firewall:
Usage¶
Test remote connection:
Post Installation Steps¶
DON'T FORGET TO REMOVE testuser BEFORE GOING TO PRODUCTION
DON'T FORGET TO SETUP vacuum BEFORE GOING TO PRODUCTION
maybe with a cron-job
OR
as autovacuum is working by default, let's get some log-entries to see it actually working by changing postgres.conf
you can check the settings of the database by
Von Jeremias Keihsler vor mehr als 7 Jahren aktualisiert · 6 Revisionen