docs icon indicating copy to clipboard operation
docs copied to clipboard

Incorrect Postgres instructions for RHEL 8

Open coltoneshaw opened this issue 3 years ago • 14 comments
trafficstars

On the page https://github.com/mattermost/docs/blob/master/source/install/install-rhel-8.rst it lists how to install postgres for RHEL 8, but most of the instructions appear to not be correct when trying.

Step 1

[ec2-user@ip-172-31-48-205 /]$ sudo postgresql-setup initdb
sudo: postgresql-setup: command not found
[ec2-user@ip-172-31-48-205 /]$

Step 2

[ec2-user@ip-172-31-48-205 /]$ sudo systemctl enable postgresql
Failed to enable unit: Unit file postgresql.service does not exist.
[ec2-user@ip-172-31-48-205 /]$

Step 3

[ec2-user@ip-172-31-48-205 /]$ sudo systemctl start postgresql
Failed to start postgresql.service: Unit postgresql.service not found.
[ec2-user@ip-172-31-48-205 /]$ sudo systemctl start postgresql-15
[ec2-user@ip-172-31-48-205 /]$

Step 13

[ec2-user@ip-172-31-48-205 /]$ ls /etc/postgresql
ls: cannot access '/etc/postgresql': No such file or directory
[ec2-user@ip-172-31-48-205 /]$

Step 14

[ec2-user@ip-172-31-48-205 /]$ sudo ls /var/lib/pgsql/data/pg_hba.conf
ls: cannot access '/var/lib/pgsql/data/pg_hba.conf': No such file or directory
[ec2-user@ip-172-31-48-205 /]$

It looks like postgres gets installed into a versioned folder, so /var/lib/pgsql/data/pg_hba.conf is /var/lib/pgsql/15/data/pg_hba.conf.

Going to see what else might be different in here, opening the ticket because I can't submit a PR to adjust at the moment. :/

coltoneshaw avatar Oct 26 '22 14:10 coltoneshaw

Thanks, @coltoneshaw! Docs is in the process of archiving these instructions in favour of providing package-based deployment and upgrade instructions by platform.

The multi-step details provided in this and similar pages will be simplified greatly with the package-based approach.

CC @nab-77 for visibility

cwarnermm avatar Oct 26 '22 14:10 cwarnermm

@cwarnermm That's what I figured as well! Will the package installer also install / setup the database of the customers choice?

coltoneshaw avatar Oct 26 '22 14:10 coltoneshaw

Great question, @coltoneshaw, that @nab-77 can elaborate on further. The product documentation provides database configuration details as they apply to a Mattermost deployment or upgrade.

cwarnermm avatar Oct 26 '22 14:10 cwarnermm

@cwarnermm - So my feedback is on that database config details. They appear to be incorrect for postgres on RHEL 8 specifically. I haven't tested other versions.

coltoneshaw avatar Oct 26 '22 14:10 coltoneshaw

Understood. Here's a preview of where the docs are headed: http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/5885/deploy/install-database.html

cwarnermm avatar Oct 26 '22 14:10 cwarnermm

Does a rhel version of those docs exist? The ones in the link are specific for ubuntu.

Ex: /etc/postgresql/{version}/main/pg_hba.conf is the ubuntu path. /var/lib/pgsql/{version}/data/pg_hba.conf is the RHEL path.

coltoneshaw avatar Oct 26 '22 14:10 coltoneshaw

That's the next phase of this effort: developing database configuration guidance that:

  • isn't comprehensive database installation instructions
  • is applicable to platforms we support
  • clearly details the Mattermost-specific database effort needed

cwarnermm avatar Oct 26 '22 14:10 cwarnermm

Additional feedback captured while discussing further with @coltoneshaw:

  • current draft database steps in PR-5885 are Ubuntu-specific
  • RHEL details will differ
  • ensure that critical-path steps for all supported platforms are included
  • OS-specific details may need to be called out as well

cwarnermm avatar Oct 26 '22 15:10 cwarnermm

Package variance rather than RHEL + package version. We need to investigate if Red Hat have chosen the new path as the upgrade is breaking (seen this many times, much to end users frustration).

Need to check this against Ubuntu to determine if this is a pqsql v15 or RHEL+pgsql15 issue.

nab-77 avatar Oct 26 '22 16:10 nab-77

We need to investigate if Red Hat have chosen the new path as the upgrade is breaking (seen this many times, much to end users frustration).

On RHEL 8 all versions of Postgres i've tested are installed to the same path.

coltoneshaw avatar Oct 26 '22 16:10 coltoneshaw

Need to check this against Ubuntu to determine if this is a pqsql v15

The pathing that i pointed out above for RHEL has been in ubuntu in a similar form for a while. Just a different location. ex: /etc/postgresql/{version}/data

coltoneshaw avatar Oct 26 '22 16:10 coltoneshaw

[ec2-user@ip-172-31-48-205 /]$ sudo systemctl start postgresql
Failed to start postgresql.service: Unit postgresql.service not found.
[ec2-user@ip-172-31-48-205 /]$ sudo systemctl start postgresql-15

This is package/version specific and my point was is this versioning RHEL only or across all supported distros?

nab-77 avatar Oct 26 '22 16:10 nab-77

Ah. I think it comes down to how you install it. Since we no longer tell them how to install it, it's up to how postgres chooses to tell someone, and they differ based on the OS.

On Ubuntu the Postgres docs specifically just use postgresql instead of postgresql-12 for example. Ubuntu postgres docs

Whereas the redhat docs have you specify a version specifically, and have you disable postgresql entirely. RHEL docs

coltoneshaw avatar Oct 26 '22 16:10 coltoneshaw

On Ubuntu the Postgres docs specifically just use postgresql instead of postgresql-12 for example.

This is where symlinks and non-breaking upgrades comes into play. Normally when you see the distro abandon the exsiting paths is down to a breaking change (think python updates where over a period of time two major versions are needed). Is Ubuntu providing pgsql-15 using the existing paths?

Whereas the redhat docs have you specify a version specifically, and have you disable postgresql entirely.

This comes back to my point that this seems to be a pgsql-15 specific change (but this need validation).

Note: if Ubuntu are using existing paths then they are not viewing the update as RHEL does (in terms of breaking change).

This all needs validation but this week is already "spoken for".

nab-77 avatar Oct 26 '22 16:10 nab-77