Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorial:adm:server_preparation_tmp [2020/07/24 08:14]
fiserp [Database server installation - CentOS8]
tutorial:adm:server_preparation_tmp [2020/07/24 08:29]
fiserp [DB server configuration]
Line 47: Line 47:
 ===== PostgreSQL  ===== ===== PostgreSQL  =====
 <note tip>If you are installing CzechIdM on Microsoft SQL Server, please follow [[tutorial:adm:mssql_database_support|this tutorial]].</note> <note tip>If you are installing CzechIdM on Microsoft SQL Server, please follow [[tutorial:adm:mssql_database_support|this tutorial]].</note>
-We install PostgreSQL 12 database binaries and set database data directory to ''/data'' not ''/var/lib'' which is the default option.+We install PostgreSQL 12 database binaries and change database data directory from ''/var/lib'' to ''/data''.
 ==== Database server installation - CentOS8 ==== ==== Database server installation - CentOS8 ====
   * Software installation on CentOS8(versions can vary):   * Software installation on CentOS8(versions can vary):
Line 77: Line 77:
 </code> </code>
  
-  * In the file ''~/postgres/.bash_profile'' change the variable PGDATA value to:+  * In the file ''/var/lib/pgsql/.bash_profile'' (bash profile for postgres user) change the variable PGDATA to:
  
 <code> <code>
Line 94: Line 94:
  
 <code bash> <code bash>
-/usr/bin/postgresql-setup --initdb --unit postgresql+postgresql-setup --initdb --unit postgresql
 </code> </code>
  
Line 144: Line 144:
 ==== DB server configuration ==== ==== DB server configuration ====
  
-First of all, enable the password authentication.+  * Enable the password authentication.
  
 In the file ''/data/pgsql/12/data/pg_hba.conf'' find lines: In the file ''/data/pgsql/12/data/pg_hba.conf'' find lines:
Line 151: Line 151:
 host    all             all             ::1/128                 ident host    all             all             ::1/128                 ident
 </code> </code>
- +and change the value at the end of each line to ''md5'' like this:
-and change the value at the end of each line into md5 like this:+
 <code> <code>
 host    all             all             127.0.0.1/32            md5 host    all             all             127.0.0.1/32            md5
Line 158: Line 157:
 </code> </code>
  
-Now we can do DB sizing. We presume the system has 3GB dedicated for the db. We can also log the queries logging (those over 200ms). **For particular sizinguse a [[https://pgtune.leopard.in.ua/#/|calculator]]**.+  * Adjust DB instance sizing. 
 +    * In following snippet, we presume the system has 3GB of memory dedicated for the database. **For your deploymentadjust the sizing accordingly. Use a [[https://pgtune.leopard.in.ua/#/|calculator]] if in doubt**
 +    * We also log queries running longer than 200ms.
 In a file ''/data/pgsql/12/data/postgresql.conf'' edit (add those if not exist) lines: In a file ''/data/pgsql/12/data/postgresql.conf'' edit (add those if not exist) lines:
 <code> <code>