Difference between revisions of "Talk:Postgresql"
From SME Server
Jump to navigationJump to searchm |
Unnilennium (talk | contribs) m (Unnilennium moved page Talk:Postgres to Talk:Postgresql) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | ===Koozali SME v10 and manual install with systemd=== | |
− | : | + | |
+ | {{Note box| There is now a contrib for Koozali SME Server v10 - See above for [[Postgres#How_to_install_Postgresql_13|easy installation]]}} | ||
+ | |||
+ | This is for reference with PostGresql12 and manual installation: | ||
+ | |||
+ | db yum_repositories set postgresql12 repository \ | ||
+ | BaseURL https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-7Server-\$basearch/ \ | ||
+ | EnableGroups no \ | ||
+ | GPGCheck yes \ | ||
+ | Name "Postgresql-12" \ | ||
+ | GPGKey https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-12 \ | ||
+ | Visible no \ | ||
+ | status disabled | ||
+ | |||
+ | Update yum | ||
+ | signal-event yum-modify | ||
+ | |||
+ | |||
+ | Install the rpms | ||
+ | yum --enablerepo=postgresql12 install postgresql12-server postgresql12-contrib | ||
+ | |||
+ | Set a config key for SME to recognise the service: | ||
+ | config set postgresql-12 service status enabled access private | ||
+ | |||
+ | We will need a file: | ||
+ | |||
+ | mkdir -p /usr/lib/systemd/system/postgresql-12.service.d | ||
+ | nano /usr/lib/systemd/system/postgresql-12.service.d/50koozali.conf | ||
+ | |||
+ | Add something like this: | ||
+ | |||
+ | [Unit] | ||
+ | After=network.target network.service wan.service | ||
+ | [Install] | ||
+ | WantedBy=sme-server.target | ||
+ | |||
+ | Reconfigure and reboot: | ||
+ | signal-event post-upgrade;signal-event reboot | ||
+ | |||
+ | The service will show as failed at this point. | ||
+ | systemctl status postgresql-12 | ||
+ | |||
+ | So we need to init the DB: | ||
+ | /usr/pgsql-12/bin/postgresql-12-setup initdb | ||
+ | |||
+ | Then start it: | ||
+ | systemctl start postgresql-12 | ||
+ | |||
+ | And now we can see it running. | ||
+ | |||
+ | We can check some of the defaults: | ||
+ | |||
+ | grep '^[[:blank:]]*[^[:blank:]#;]' /var/lib/pgsql/12/data/pg_hba.conf | ||
+ | grep '^[[:blank:]]*[^[:blank:]#;]' /var/lib/pgsql/12/data/postgresql.conf |
Latest revision as of 02:32, 29 May 2022
Koozali SME v10 and manual install with systemd
This is for reference with PostGresql12 and manual installation:
db yum_repositories set postgresql12 repository \ BaseURL https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-7Server-\$basearch/ \ EnableGroups no \ GPGCheck yes \ Name "Postgresql-12" \ GPGKey https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-12 \ Visible no \ status disabled
Update yum
signal-event yum-modify
Install the rpms
yum --enablerepo=postgresql12 install postgresql12-server postgresql12-contrib
Set a config key for SME to recognise the service:
config set postgresql-12 service status enabled access private
We will need a file:
mkdir -p /usr/lib/systemd/system/postgresql-12.service.d nano /usr/lib/systemd/system/postgresql-12.service.d/50koozali.conf
Add something like this:
[Unit] After=network.target network.service wan.service [Install] WantedBy=sme-server.target
Reconfigure and reboot:
signal-event post-upgrade;signal-event reboot
The service will show as failed at this point.
systemctl status postgresql-12
So we need to init the DB:
/usr/pgsql-12/bin/postgresql-12-setup initdb
Then start it:
systemctl start postgresql-12
And now we can see it running.
We can check some of the defaults:
grep '^blank:*[^[:blank:]#;]' /var/lib/pgsql/12/data/pg_hba.conf grep '^blank:*[^[:blank:]#;]' /var/lib/pgsql/12/data/postgresql.conf