Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:adm:server_preparation_tmp [2020/03/10 15:08] urbanl [TODO] |
tutorial:adm:server_preparation_tmp [2020/03/11 13:07] urbanl [DB server configuration -!CHANGED] |
||
---|---|---|---|
Line 58: | Line 58: | ||
screen dnsutils sysstat lsof haveged nmap tcpdump traceroute tcptraceroute curl iptables-persistent | screen dnsutils sysstat lsof haveged nmap tcpdump traceroute tcptraceroute curl iptables-persistent | ||
</ | </ | ||
- | ===== PostgreSQL ===== | + | ===== PostgreSQL |
<note tip>If you are install CzechIdM on Sql server, please follow [[tutorial: | <note tip>If you are install CzechIdM on Sql server, please follow [[tutorial: | ||
- | CentOS7 | + | CentOS8 |
- | ==== Database server installation - CentOS7 and CentOS8 -!CHANGED ==== | + | ==== Database server installation - CentOS8 -!CHANGED ==== |
- | * Software installation on CentOS7(versions can vary): | + | |
- | <code bash> | + | |
- | yum install -y https:// | + | |
- | yum install -y postgresql96-server postgresql96-contrib pgstat2_96 pg_top96 | + | |
- | </ | + | |
- | #TODO | + | |
* Software installation on CentOS8(versions can vary): | * Software installation on CentOS8(versions can vary): | ||
+ | |||
<code bash> | <code bash> | ||
# enable module postgres 12 | # enable module postgres 12 | ||
Line 76: | Line 71: | ||
* create new system directory: | * create new system directory: | ||
- | < | + | |
- | mkdir -p / | + | < |
+ | mkdir -p / | ||
+ | mkdir -p / | ||
chown -R postgres: | chown -R postgres: | ||
chmod 700 /data/pgsql | chmod 700 /data/pgsql | ||
</ | </ | ||
+ | |||
* Copy of the configuration file for systemd, in which we will make change of directory for data: | * Copy of the configuration file for systemd, in which we will make change of directory for data: | ||
+ | |||
<code bash> | <code bash> | ||
- | cp / | + | cp / |
</ | </ | ||
- | In the file ''/ | + | |
+ | In the file ''/ | ||
< | < | ||
# Location of database directory | # Location of database directory | ||
- | Environment=PGDATA=/ | + | Environment=PGDATA=/ |
</ | </ | ||
Line 94: | Line 94: | ||
< | < | ||
- | PGDATA=/ | + | PGDATA=/ |
</ | </ | ||
Line 108: | Line 108: | ||
<code bash> | <code bash> | ||
- | /usr/pgsql-11/bin/postgresql96-setup initdb | + | /usr/bin/postgresql-setup |
</ | </ | ||
+ | Change SELINUX labels: | ||
+ | < | ||
+ | chcon -Rt postgresql_db_t pgsql/ | ||
+ | chcon -Rt postgresql_log_t / | ||
+ | </ | ||
* Enable and start database: | * Enable and start database: | ||
<code bash> | <code bash> | ||
- | systemctl start postgresql-11.service | + | systemctl start postgresql.service |
- | systemctl enable postgresql-11.service | + | systemctl enable postgresql.service |
</ | </ | ||
Line 123: | Line 127: | ||
<code bash> | <code bash> | ||
- | [root@tomcat1 system]# systemctl status postgresql-9.6.service -l | + | [root@HOSTNAME data]# systemctl status postgresql.service -l |
- | ● postgresql-9.6.service - PostgreSQL | + | ● postgresql.service - PostgreSQL database server |
- | | + | |
- | | + | |
- | Main PID: 2626 (postmaster) | + | Main PID: 25715 (postmaster) |
- | | + | Tasks: 8 (limit: 52428) |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | └─2634 postgres: stats collector | + | |
+ | | ||
+ | ├─25722 postgres: stats collector | ||
+ | | ||
- | lis 18 23:50:06 tomcat1.localdomain | + | Mar 11 10:48:06 HOSTNAME |
- | lis 18 23:50:06 tomcat1.localdomain | + | Mar 11 10:48:06 HOSTNAME postmaster[25715]: |
- | lis 18 23:50:06 tomcat1.localdomain | + | Mar 11 10:48:06 HOSTNAME |
- | lis 18 23:50:06 tomcat1.localdomain | + | Mar 11 10:48:06 HOSTNAME postmaster[25715]: |
+ | Mar 11 10:48:06 HOSTNAME postmaster[25715]: | ||
+ | Mar 11 10:48:06 HOSTNAME postmaster[25715]: | ||
+ | Mar 11 10:48:06 HOSTNAME postmaster[25715]: | ||
+ | Mar 11 10:48:06 HOSTNAME | ||
+ | Mar 11 10:48:06 HOSTNAME | ||
</ | </ | ||
Line 175: | Line 187: | ||
systemctl enable postgresql | systemctl enable postgresql | ||
</ | </ | ||
- | ==== DB server configuration ==== | + | ==== DB server configuration |
First of all, enable the password authentication. | First of all, enable the password authentication. | ||
- | In the file ''/ | + | In the file ''/ |
< | < | ||
host all | host all | ||
Line 192: | Line 204: | ||
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 sizing, use a [[https:// | 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 sizing, use a [[https:// | ||
- | In a file ''/ | + | In a file ''/ |
< | < | ||
max_connections = 100 # (change requires restart) | max_connections = 100 # (change requires restart) | ||
Line 211: | Line 223: | ||
</ | </ | ||
- | Restart DB: '' | + | Restart DB: '' |
For Debian installation, | For Debian installation, | ||
< | < | ||
- | / | + | / |
- | / | + | / |
</ | </ | ||
< | < | ||
- | ===== Java - CentOS7 | + | ===== Java - CentOS8 -! CHANGED |
- | Java must be installed before Tomcat start. It is recommended to use OpenJDK (at least 1.8) from standard OS repository. | + | Java must be installed before Tomcat start. It is recommended to use OpenJDK (at least 1.11) from standard OS repository. |
Installation: | Installation: | ||
<code bash> | <code bash> | ||
- | yum install -y java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel | + | yum install -y java-11-openjdk-headless java-11-openjdk-devel |
</ | </ | ||