{"id":334679,"date":"2022-06-18T15:00:12","date_gmt":"2022-06-18T15:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=334679"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=334679","title":{"rendered":"<span>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Zabbix 5.2 \u0434\u043e Zabbix 6.0 \u043d\u0430 CentOS 8<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c Zabbix \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u0441 \u043d\u0430\u0441\u043a\u043e\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0441\u0442\u0435\u043c. \u0420\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u0432 \u043f\u043e \u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0441\u0442\u0435\u043d\u0434\u0435, \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u0437 \u043d\u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u0430 \u0431\u043e\u044e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f. \u0421\u043b\u0435\u0433\u043a\u0430 \u043f\u0440\u0438\u0447\u0435\u0441\u0430\u043d\u043d\u043e\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044d\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>CentOS 8<\/p>\n<\/li>\n<li>\n<p>Zabbix 5.2.6<\/p>\n<\/li>\n<li>\n<p>PostgresSQL 12.6<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/zabbix\/blog\/458530\/\" rel=\"noopener noreferrer nofollow\">TimescaleDB 2.1.1<\/a><\/p>\n<\/li>\n<li>\n<p>\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 Zabbix \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u041e\u0421<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Zabbix<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Primary keys \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e root, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u043d\u043e\u0435 (\u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c sudo \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435).<\/p>\n<h2>1. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u041e\u0421<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a Red Hat \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c CentOS 8 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0442\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0451 \u043d\u0430 Oracle Linux. \u0411\u043b\u0430\u0433\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u0435\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 (\u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0433\u043e\u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u044f \u044d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c):<\/p>\n<pre><code class=\"bash\"># \u0410\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 CentOS \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-* sed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-* dnf clean all dnf update dnf upgrade<\/code><\/pre>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <a href=\"https:\/\/raw.githubusercontent.com\/oracle\/centos2ol\/main\/centos2ol.sh\" rel=\"noopener noreferrer nofollow\">centos2ol.sh<\/a> \u043e\u0442 Oracle. \u041f\u043e <a href=\"https:\/\/github.com\/oracle\/centos2ol#before-you-start\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 README.md, \u0433\u0434\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0420\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043f\u0438\u044e \u044f \u0434\u0435\u043b\u0430\u043b \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u044d\u043a\u0430\u043f\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u044f\u0434\u0440\u0430 (Kernels)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432 \/var\/cache \u0435\u0441\u0442\u044c 5 Gb \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/docs.oracle.com\/en\/learn\/switch_centos8_linux8\/index.html#confirm-system-switch-to-oracle-linux\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u043e\u0442 Oracle<\/a> (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c) \u0433\u0434\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 dnf repolist # \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0440\u0435\u043f. \u0423 \u0432\u0430\u0441 \u043e\u043d \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439. dnf config-manager --set-disabled epel epel-modular grafana pgdg-common pgdg12 pgdg13 timescale_timescaledb zabbix zabbix-non-supported # \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c wget https:\/\/raw.githubusercontent.com\/oracle\/centos2ol\/main\/centos2ol.sh chmod +x centos2ol.sh .\/centos2ol.sh<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/p>\n<pre><code class=\"bash\">Switch complete. Oracle recommends rebooting this system. [root@zabbix ~]# reboot<\/code><\/pre>\n<h2>2. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0411\u0414<\/h2>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 6 \u0432\u0435\u0440\u0441\u0438\u0438 Zabbix \u0442\u0440\u0435\u0431\u0443\u0435\u0442 PostgreSQL 13 \u0438\u043b\u0438 \u0441\u0442\u0430\u0440\u0448\u0435. \u042f \u043f\u0440\u0438\u043d\u044f\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0435\u0440\u0441\u0438\u044e 14.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 PostgreSQL 12.6 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 TimescaleDB 2.1.1, \u0430 \u0434\u043b\u044f <a href=\"https:\/\/docs.timescale.com\/timescaledb\/latest\/how-to-guides\/update-timescaledb\/#timescaledb-release-compatibility\" rel=\"noopener noreferrer nofollow\">PostgreSQL 14 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 2.5+<\/a>, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0451. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e TimescaleDB 2.7 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442) \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 PostgreSQL 12, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e PostgreSQL.<\/p>\n<pre><code class=\"bash\">su - postgres # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 zabbix psql zabbix # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0411\u0414 \u0438 \u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 zabbix=# \\dx                                       List of installed extensions     Name     | Version |   Schema   |                            Description -------------+---------+------------+-------------------------------------------------------------------  plpgsql     | 1.0     | pg_catalog | PL\/pgSQL procedural language  timescaledb | 2.1.1   | public     | Enables scalable inserts and complex queries for time-series data (2 rows) zabbix=# \\q exit<\/code><\/pre>\n<p>\u041d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 PostgreSQL:<\/p>\n<pre><code class=\"bash\"># \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 PostgreSQL rpm -Uvh https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-8-x86_64\/pgdg-redhat-repo-latest.noarch.rpm # \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0435\u0435 dnf config-manager --set-disabled pgdg10 pgdg11 pgdg13  # \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 dnf config-manager --set-enabled timescale_timescaledb<\/code><\/pre>\n<p>\u041d\u0443 \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c TimescaleDB:<\/p>\n<pre><code class=\"bash\"># \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442 dnf upgrade -y timescaledb-2-postgresql-12 su - postgres psql zabbix # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432 \u0411\u0414 ALTER EXTENSION timescaledb UPDATE; # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0432\u0435\u0440\u0441\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u0434\u043e 2.7.0 \\dx                                       List of installed extensions     Name     | Version |   Schema   |                            Description -------------+---------+------------+-------------------------------------------------------------------  plpgsql     | 1.0     | pg_catalog | PL\/pgSQL procedural language  timescaledb | 2.7.0   | public     | Enables scalable inserts and complex queries for time-series data (2 rows)  \\q<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0430\u043c PostgreSQL. \u0422\u0443\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043d\u0435\u0451 \u0431\u0430\u0437\u044b. \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b pg_upgrade, \u0445\u043e\u0442\u044f \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b.<\/p>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c PostgeSQL 14 \u0438 TimescaleDB \u0434\u043b\u044f \u043d\u0435\u0451 dnf install -y postgresql14-server timescaledb-2-postgresql-14 # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0431\u0430\u0437\u0443 postgresql-14-setup initdb # \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b timescaledb-tune \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 postgresql.conf: timescaledb-tune --pg-config=\/usr\/pgsql-14\/bin\/pg_config # \u0422\u0430\u043a \u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0440\u0442 \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 # port = 5532 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e port = 5432) vim \/var\/lib\/pgsql\/14\/data\/postgresql.conf # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 systemctl enable postgresql-14 # \u0421\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0432\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 diff \/var\/lib\/pgsql\/12\/data\/pg_hba.conf \/var\/lib\/pgsql\/14\/data\/pg_hba.conf<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 pg_hba.conf \u0443 postgresql 14 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 scram-sha-256 (\u0432\u043c\u0435\u0441\u0442\u043e md5 \u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439). \u041f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438 (\u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0445 \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u043d\u0430 <abbr title=\"Salted Challenge Response Authentication Mechanism\" type=\"abbr\">SCRAM<\/abbr> (\u0432\u043e\u0442 <a href=\"https:\/\/www.crunchydata.com\/blog\/how-to-upgrade-postgresql-passwords-to-scram\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/a>), \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 md5. <\/p>\n<p>\u042f \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u043b \u044d\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430 \u0443\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435. \u041d\u043e, \u0434\u0443\u043c\u0430\u044e, \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e SCRUM<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438 \u0434\u043e SCRAM \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 2 \u0432\u0435\u0449\u0430\u0445:<\/p>\n<ol>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f PostgreSQL 10 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u0430\u0439\u0432\u0435\u0440\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 SCRAM.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0430\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a:   <\/p>\n<ol>\n<li>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 postgresql.conf \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 password_encryption \u0432 scram-sha-256.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438. \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c zabbix.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438, \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0439 (\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439) \u043f\u0430\u0440\u043e\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \\password \u0432 psql.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c md5 \u0432 \u0444\u0430\u0439\u043b\u0435 pg_hba.conf \u043d\u0430 scram-sha-256.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c password_encryption = scram-sha-256 vim \/var\/lib\/pgsql\/14\/data\/postgresql.conf # \u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e PostgreSQL service postgresql-14 reload # \u041f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c postgres \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c psql su - postgres psql # \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 SELECT     rolname, rolpassword ~ '^SCRAM-SHA-256\\$' AS has_upgraded FROM pg_authid WHERE rolcanlogin; # \u0423 \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  rolname  | has_upgraded ----------+--------------  postgres | t  zabbix   | f (2 rows) # \u0415\u0441\u043b\u0438 \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 has_upgraded \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 false (f), \u0442\u043e \u0435\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c. # \u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f zabbix \\password zabbix # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f TRUE (t) SELECT rolname, rolpassword ~ '^SCRAM-SHA-256\\$' AS has_upgraded FROM pg_authid WHERE rolcanlogin; # \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0441\u0435\u0445 true  rolname  | has_upgraded ----------+--------------  postgres | t  zabbix   | t (2 rows) # \u0412\u044b\u0445\u043e\u0434 \u0438\u0437 psql \\q # \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c md5 \u0432 \u0444\u0430\u0439\u043b\u0435 pg_hba.conf \u043d\u0430 scram-sha-256 vim \/var\/lib\/pgsql\/14\/data\/pg_hba.conf # \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u0423\u0417 root exit # \u0418 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e PostgreSQL service postgresql-14 reload<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<pre><code class=\"bash\"># \u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0433\u043e\u0442\u043e\u0432 \u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e. # \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c pg_upgrade \u0441 \u043a\u043b\u044e\u0447\u043e\u043c --check. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442. sudo -iu postgres \/usr\/pgsql-14\/bin\/pg_upgrade \\   --old-datadir=\/var\/lib\/pgsql\/12\/data \\   --new-datadir=\/var\/lib\/pgsql\/14\/data \\   --old-bindir=\/usr\/pgsql-12\/bin \\   --new-bindir=\/usr\/pgsql-14\/bin \\   --old-options '-c config_file=\/var\/lib\/pgsql\/12\/data\/postgresql.conf' \\   --new-options '-c config_file=\/var\/lib\/pgsql\/14\/data\/postgresql.conf' \\   --check    # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f: Performing Consistency Checks on Old Live Server ------------------------------------------------ Checking cluster versions                                   ok Checking database user is the install user                  ok Checking database connection settings                       ok Checking for prepared transactions                          ok Checking for system-defined composite types in user tables  ok Checking for reg* data types in user tables                 ok Checking for contrib\/isn with bigint-passing mismatch       ok Checking for user-defined encoding conversions              ok Checking for user-defined postfix operators                 ok Checking for presence of required libraries                 ok Checking database user is the install user                  ok Checking for prepared transactions                          ok Checking for new cluster tablespace directories             ok  *Clusters are compatible* # \u041e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442, \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e.<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u0430 (\u0441\u0442\u0430\u0440\u044b\u0439 \u0438 \u043d\u043e\u0432\u044b\u0439) \u0441\u0435\u0440\u0432\u0438\u0441\u0430 PostgeSQL \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b. \u0414\u0430 \u0438 Zabbix \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<pre><code class=\"bash\">service postgresql-12 stop service postgresql-14 stop service zabbix-server stop service zabbix-agent2 stop # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 sudo -iu postgres \/usr\/pgsql-14\/bin\/pg_upgrade \\   --old-datadir=\/var\/lib\/pgsql\/12\/data \\   --new-datadir=\/var\/lib\/pgsql\/14\/data \\   --old-bindir=\/usr\/pgsql-12\/bin \\   --new-bindir=\/usr\/pgsql-14\/bin \\   --old-options '-c config_file=\/var\/lib\/pgsql\/12\/data\/postgresql.conf' \\   --new-options '-c config_file=\/var\/lib\/pgsql\/14\/data\/postgresql.conf' # \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u0432 \u0441\u0442\u0430\u0440\u043e\u0439 \u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 # port = 5432 vim \/var\/lib\/pgsql\/14\/data\/postgresql.conf # port = 5532 vim \/var\/lib\/pgsql\/12\/data\/postgresql.conf # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c Zabbix service postgresql-14 start service zabbix-server start service zabbix-agent2 start # \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u0431\u0430\u0437\u044b \u0438 \u0441\u0431\u043e\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438: sudo -iu postgres \/usr\/pgsql-14\/bin\/vacuumdb --all --analyze-in-stages # \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0432\u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0430\u0440\u043e\u0439 \u0411\u0414: \/var\/lib\/pgsql\/delete_old_cluster.sh # \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438 \u0441\u0430\u043c PostgreSQL 12 dnf remove postgresql12-server-12.11-1PGDG.rhel8.x86_64 postgresql12-libs-12.11-1PGDG.rhel8.x86_64<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c, \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0430\u043c Zabbix.<\/p>\n<h2>3. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Zabbix<\/h2>\n<p>\u0421\u0430\u043c Zabbix \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0435\u0441\u043b\u0438 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044f \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e Zabbix \u0438 Zabbix Proxy \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0436\u043e\u0440\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Zabbix \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0442 \u0441 \u043d\u0435\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u043a\u0441\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440. \u041f\u0440\u043e\u043a\u0441\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<p>\u041d\u0443 \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0411\u0414 \u0435\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e 6 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u043e\u0438\u0442 \u0435\u0449\u0451 \u0440\u0430\u0437 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0435 \u043a\u043e\u043f\u0438\u0438 \u0431\u0430\u0437\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041d\u0443 \u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043d\u044d\u043f\u0448\u043e\u0442.<\/p>\n<pre><code class=\"bash\"># \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c zabbix-server service zabbix-server stop # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0437\u0430\u0431\u0431\u0438\u043a\u0441\u0430: rpm -Uvh https:\/\/repo.zabbix.com\/zabbix\/6.0\/rhel\/8\/x86_64\/zabbix-release-6.0-1.el8.noarch.rpm # \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u044d\u0448 (\u0445\u043e\u0442\u044f \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c): dnf clean all dnf makecache # \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 zabbix \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 rpm -qa | grep zabbix # \u0423 \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f: zabbix-release-6.0-1.el8.noarch zabbix-get-5.2.7-1.el8.x86_64 zabbix-nginx-conf-5.2.6-1.el8.noarch zabbix-web-deps-5.2.6-1.el8.noarch zabbix-web-pgsql-5.2.6-1.el8.noarch zabbix-agent2-5.2.5-1.el7.x86_64 zabbix-web-5.2.6-1.el8.noarch zabbix-server-pgsql-5.2.6-1.el8.x86_64 zabbix-java-gateway-5.2.6-1.el8.x86_64 # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 zabbix \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0432\u044b\u0431\u0438\u0440\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0443 \u0432\u0430\u0441 \u043f\u0430\u043a\u0435\u0442\u044b: dnf upgrade zabbix-web zabbix-web-pgsql zabbix-server-pgsql zabbix-agent2 zabbix-get zabbix-server zabbix-java-gateway # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c zabbix-server \u0438 \u0436\u0434\u0451\u043c \u043f\u043e\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 \u0431\u0430\u0437\u044b service zabbix-server start<\/code><\/pre>\n<h2>4. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Primary keys<\/h2>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0441\u0442\u0430\u0432\u043b\u044e <a href=\"https:\/\/www.zabbix.com\/documentation\/current\/en\/manual\/appendix\/install\/db_primary_keys\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u0430\u0437\u0434\u0435\u043b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Zabbix<\/a>, \u0442\u0430\u043c \u044d\u0442\u043e\u0442 \u0448\u0430\u0433 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437\u043b\u043e\u0436\u0435\u043d.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0437\u043d\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f \u0431\u0430\u0437\u044b<\/p>\n<\/li>\n<li>\n<p>Zabbix \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>CSV \u0444\u0430\u0439\u043b\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 Zabbix Proxy \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 history_pk_prepare.sql<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\"> # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u201czabbix-sql-scripts\u201d: dnf install -y zabbix-sql-scripts # \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Zabbix: service zabbix-server stop # \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u043c \u0441\u043a\u0440\u0438\u043f\u0442 history_pk_prepare.sql \u043d\u0430 \u0431\u0430\u0437\u0435 zabbix \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f zabbix. # \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u0442 \u0441\u0442\u0430\u0440\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439 \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u044b\u0435. sudo -u zabbix psql zabbix &lt; \/usr\/share\/doc\/zabbix-sql-scripts\/postgresql\/history_pk_prepare.sql<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e. \u041d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0431\u0431\u0438\u043a\u0441.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0442\u043e \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u0451, \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0443\u044e. \u0418 \u0442\u0430\u043a 5 \u0440\u0430\u0437 (\u043f\u043e \u0447\u0438\u0441\u043b\u0443 \u0442\u0430\u0431\u043b\u0438\u0446 \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438).<\/p>\n<p>\u0414\u043b\u044f TimescaleDB \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Zabbix \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f <strong>\u043e\u0434\u043d\u043e\u0439 <\/strong>\u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c postgres \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c psql su - postgres psql # \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0438\u0436\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>history.sql<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"pgsql\"> -- \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0437\u0430\u0439\u043c\u0443\u0442 \u043d\u0435\u0441\u0436\u0430\u0442\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0433\u0443\u0437\u043a\u0438 \u0432 CSV. select sum(before_compression_total_bytes)\/1024\/1024 as before_compression_total_mbytes, sum(after_compression_total_bytes)\/1024\/1024 as after_compression_total_mbytes FROM chunk_compression_stats('history_old');  -- \u0412\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b \\copy (select * from history_old) TO '\/tmp\/history.csv' DELIMITER ',' CSV  CREATE TEMP TABLE temp_history (     itemid     bigint NOT NULL,     clock      integer  DEFAULT '0' NOT NULL,     value      DOUBLE PRECISION DEFAULT '0.0000'   NOT NULL,     ns  integer  DEFAULT '0' NOT NULL ); -- \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \\copy temp_history FROM '\/tmp\/history.csv' DELIMITER ',' CSV  -- \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c hypertable \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0435\u0451 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 select create_hypertable('history', 'clock', chunk_time_interval => 86400, migrate_data => true); INSERT INTO history SELECT * FROM temp_history ON CONFLICT (itemid,clock,ns) DO NOTHING;  -- \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0436\u0430\u0442\u0438\u0435 select set_integer_now_func('history', 'zbx_ts_unix_now', true); alter table history set (timescaledb.compress,timescaledb.compress_segmentby='itemid',timescaledb.compress_orderby='clock,ns');  -- \u0412 hypertable_schema \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c public \u043d\u0430 \u0441\u0432\u043e\u044e \u0441\u0445\u0435\u043c\u0443, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f -- \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 ID \u0437\u0430\u0434\u0430\u0447\u0438 (&lt;JOB_ID>) \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 run_job select add_compression_policy('history', (     select extract(epoch from (config::json->>'compress_after')::interval) from timescaledb_information.jobs where application_name like 'Compression%%' and hypertable_schema='public' and hypertable_name='history_old'     )::integer );  select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history'), scheduled => true);  -- \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u0436\u0430\u0442\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (\u0432\u043c\u0435\u0441\u0442\u043e &lt;JOB_ID> \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c ID \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430) call run_job(&lt;JOB_ID>); -- \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 'NOTICE:  no chunks for hypertable public.history_uint that satisfy compress chunk policy', \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e.<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>history_uint.sql<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"pgsql\"> -- Verify that there is enough space to allow export of uncompressed data select sum(before_compression_total_bytes)\/1024\/1024 as before_compression_total_mbytes, sum(after_compression_total_bytes)\/1024\/1024 as after_compression_total_mbytes FROM chunk_compression_stats('history_uint_old');  -- Export data \\copy (select * from history_uint_old) TO '\/tmp\/history_uint.csv' DELIMITER ',' CSV  CREATE TEMP TABLE temp_history_uint (     itemid     bigint NOT NULL,     clock      integer  DEFAULT '0' NOT NULL,     value      numeric(20)     DEFAULT '0' NOT NULL,     ns  integer  DEFAULT '0' NOT NULL ); -- Import data \\copy temp_history_uint FROM '\/tmp\/history_uint.csv' DELIMITER ',' CSV  -- Create hypertable and populate it select create_hypertable('history_uint', 'clock', chunk_time_interval => 86400, migrate_data => true); INSERT INTO history_uint SELECT * FROM temp_history_uint ON CONFLICT (itemid,clock,ns) DO NOTHING;  -- Enable compression select set_integer_now_func('history_uint', 'zbx_ts_unix_now', true); alter table history_uint set (timescaledb.compress,timescaledb.compress_segmentby='itemid',timescaledb.compress_orderby='clock,ns');  -- Substitute your schema in hypertable_schema -- Job id will returned, it should be passed to run_job select add_compression_policy('history_uint', (     select extract(epoch from (config::json->>'compress_after')::interval) from timescaledb_information.jobs where application_name like 'Compression%%' and hypertable_schema='public' and hypertable_name='history_uint_old'     )::integer );  select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_uint'), scheduled => true);  -- Run compression job call run_job(&lt;JOB_ID>); -- May show 'NOTICE:  no chunks for hypertable public.history_uint that satisfy compress chunk policy', it is fine.<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>history_str.sql<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"pgsql\"> -- Verify that there is enough space to allow export of uncompressed data select sum(before_compression_total_bytes)\/1024\/1024 as before_compression_total_mbytes, sum(after_compression_total_bytes)\/1024\/1024 as after_compression_total_mbytes FROM chunk_compression_stats('history_str_old');  -- Export data \\copy (select * from history_str_old) TO '\/tmp\/history_str.csv' DELIMITER ',' CSV  CREATE TEMP TABLE temp_history_str (     itemid     bigint NOT NULL,     clock      integer  DEFAULT '0' NOT NULL,     value      varchar(255)    DEFAULT ''  NOT NULL,     ns  integer  DEFAULT '0' NOT NULL ); -- Import data \\copy temp_history_str FROM '\/tmp\/history_str.csv' DELIMITER ',' CSV  -- Create hypertable and populate it select create_hypertable('history_str', 'clock', chunk_time_interval => 86400, migrate_data => true); INSERT INTO history_str SELECT * FROM temp_history_str ON CONFLICT (itemid,clock,ns) DO NOTHING;  -- Enable compression select set_integer_now_func('history_str', 'zbx_ts_unix_now', true); alter table history_str set (timescaledb.compress,timescaledb.compress_segmentby='itemid',timescaledb.compress_orderby='clock,ns');  -- Substitute your schema in hypertable_schema -- Job id will returned, it should be passed to run_job select add_compression_policy('history_str', (     select extract(epoch from (config::json->>'compress_after')::interval) from timescaledb_information.jobs where application_name like 'Compression%%' and hypertable_schema='public' and hypertable_name='history_str_old'     )::integer );  select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_str'), scheduled => true);  -- Run compression job call run_job(&lt;JOB_ID>); -- May show 'NOTICE:  no chunks for hypertable public.history_uint that satisfy compress chunk policy', it is fine.<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>history_log.sql<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"pgsql\">-- Verify that there is enough space to allow export of uncompressed data select sum(before_compression_total_bytes)\/1024\/1024 as before_compression_total_mbytes, sum(after_compression_total_bytes)\/1024\/1024 as after_compression_total_mbytes FROM chunk_compression_stats('history_log_old');  -- Export data \\copy (select * from history_log_old) TO '\/tmp\/history_log.csv' DELIMITER ',' CSV  CREATE TEMP TABLE temp_history_log (     itemid     bigint NOT NULL,     clock      integer  DEFAULT '0' NOT NULL,     timestamp  integer  DEFAULT '0' NOT NULL,     source     varchar(64)     DEFAULT ''  NOT NULL,     severity   integer  DEFAULT '0' NOT NULL,     value      text     DEFAULT ''  NOT NULL,     logeventid integer  DEFAULT '0' NOT NULL,     ns  integer  DEFAULT '0' NOT NULL ); -- Import data \\copy temp_history_log FROM '\/tmp\/history_log.csv' DELIMITER ',' CSV  -- Create hypertable and populate it select create_hypertable('history_log', 'clock', chunk_time_interval => 86400, migrate_data => true); INSERT INTO history_log SELECT * FROM temp_history_log ON CONFLICT (itemid,clock,ns) DO NOTHING;  -- Enable compression select set_integer_now_func('history_log', 'zbx_ts_unix_now', true); alter table history_log set (timescaledb.compress,timescaledb.compress_segmentby='itemid',timescaledb.compress_orderby='clock,ns');  -- Substitute your schema in hypertable_schema -- Job id will returned, it should be passed to run_job select add_compression_policy('history_log', (     select extract(epoch from (config::json->>'compress_after')::interval) from timescaledb_information.jobs where application_name like 'Compression%%' and hypertable_schema='public' and hypertable_name='history_log_old'     )::integer );  select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_log'), scheduled => true);  -- Run compression job call run_job(&lt;JOB_ID>); -- May show 'NOTICE:  no chunks for hypertable public.history_uint that satisfy compress chunk policy', it is fine. <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>history_text.sql<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"pgsql\"> -- Verify that there is enough space to allow export of uncompressed data select sum(before_compression_total_bytes)\/1024\/1024 as before_compression_total_mbytes, sum(after_compression_total_bytes)\/1024\/1024 as after_compression_total_mbytes FROM chunk_compression_stats('history_text_old');  -- Export data \\copy (select * from history_text_old) TO '\/tmp\/history_text.csv' DELIMITER ',' CSV  CREATE TEMP TABLE temp_history_text (     itemid     bigint NOT NULL,     clock      integer  DEFAULT '0' NOT NULL,     value      text     DEFAULT ''  NOT NULL,     ns  integer  DEFAULT '0' NOT NULL ); -- Import data \\copy temp_history_text FROM '\/tmp\/history_text.csv' DELIMITER ',' CSV  -- Create hypertable and populate it select create_hypertable('history_text', 'clock', chunk_time_interval => 86400, migrate_data => true); INSERT INTO history_text SELECT * FROM temp_history_text ON CONFLICT (itemid,clock,ns) DO NOTHING;  -- Enable compression select set_integer_now_func('history_text', 'zbx_ts_unix_now', true); alter table history_text set (timescaledb.compress,timescaledb.compress_segmentby='itemid',timescaledb.compress_orderby='clock,ns');  -- Substitute your schema in hypertable_schema -- Job id will returned, it should be passed to run_job select add_compression_policy('history_text', (     select extract(epoch from (config::json->>'compress_after')::interval) from timescaledb_information.jobs where application_name like 'Compression%%' and hypertable_schema='public' and hypertable_name='history_text_old'     )::integer );  select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_text'), scheduled => true);  -- Run compression job call run_job(&lt;JOB_ID>); -- May show 'NOTICE:  no chunks for hypertable public.history_uint that satisfy compress chunk policy', it is fine.<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0443 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u0440\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:<\/p>\n<pre><code class=\"pgsql\">DROP TABLE history_old; DROP TABLE history_uint_old; DROP TABLE history_str_old; DROP TABLE history_log_old; DROP TABLE history_text_old; \\q<\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 sql \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u044b (\u0431\u0435\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b call run_job) \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0410 call run_job(&lt;JOB_ID>); \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430. <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\">touch history_text.sql vi history_text.sql sudo -u zabbix psql zabbix &lt; \/tmp\/history_text.sql # \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u044b\u0432\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430  before_compression_total_mbytes | after_compression_total_mbytes ---------------------------------+--------------------------------             292.0625000000000000 |            70.7031250000000000 (1 row)  COPY 1359548 CREATE TABLE COPY 1359548      create_hypertable ----------------------------  (15,public,history_text,t) (1 row)  INSERT 0 1359548  set_integer_now_func ----------------------  (1 row)  ALTER TABLE  add_compression_policy ------------------------                    1007 (1 row)                                                 alter_job -------------------------------------------------------------------------------------------------------  (1007,\"1 day\",00:00:00,-1,01:00:00,t,\"{\"\"hypertable_id\"\": 15, \"\"compress_after\"\": 612000}\",-infinity) (1 row)  # \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c run_job \u0441 Job ID = 1007 echo \"call run_job(1007);\" |sudo -u zabbix psql zabbix CALL<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Zabbix:<\/p>\n<pre><code class=\"bash\">service zabbix-server start<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0451, \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u044f \u0441\u0431\u043e\u0440\u043d\u0430\u044f \u0441\u043e\u043b\u044f\u043d\u043a\u0430 \u0438\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/672158\/\"> https:\/\/habr.com\/ru\/post\/672158\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c Zabbix \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u0441 \u043d\u0430\u0441\u043a\u043e\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0441\u0442\u0435\u043c. \u0420\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u0432 \u043f\u043e \u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0441\u0442\u0435\u043d\u0434\u0435, \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u0437 \u043d\u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u0430 \u0431\u043e\u044e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f. \u0421\u043b\u0435\u0433\u043a\u0430 \u043f\u0440\u0438\u0447\u0435\u0441\u0430\u043d\u043d\u043e\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044d\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>CentOS 8<\/p>\n<\/li>\n<li>\n<p>Zabbix 5.2.6<\/p>\n<\/li>\n<li>\n<p>PostgresSQL 12.6<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/zabbix\/blog\/458530\/\" rel=\"noopener noreferrer nofollow\">TimescaleDB 2.1.1<\/a><\/p>\n<\/li>\n<li>\n<p>\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 Zabbix \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u041e\u0421<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Zabbix<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Primary keys \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e root, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u043d\u043e\u0435 (\u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c sudo \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435).<\/p>\n<h2>1. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u041e\u0421<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a Red Hat \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c CentOS 8 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0442\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0451 \u043d\u0430 Oracle Linux. \u0411\u043b\u0430\u0433\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u0435\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 (\u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0433\u043e\u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u044f \u044d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c):<\/p>\n<pre><code class=\"bash\"># \u0410\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 CentOS \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-* sed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-* dnf clean all dnf update dnf upgrade<\/code><\/pre>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <a href=\"https:\/\/raw.githubusercontent.com\/oracle\/centos2ol\/main\/centos2ol.sh\" rel=\"noopener noreferrer nofollow\">centos2ol.sh<\/a> \u043e\u0442 Oracle. \u041f\u043e <a href=\"https:\/\/github.com\/oracle\/centos2ol#before-you-start\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 README.md, \u0433\u0434\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0420\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043f\u0438\u044e \u044f \u0434\u0435\u043b\u0430\u043b \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u044d\u043a\u0430\u043f\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u044f\u0434\u0440\u0430 (Kernels)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432 \/var\/cache \u0435\u0441\u0442\u044c 5 Gb \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/docs.oracle.com\/en\/learn\/switch_centos8_linux8\/index.html#confirm-system-switch-to-oracle-linux\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u043e\u0442 Oracle<\/a> (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c) \u0433\u0434\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 dnf repolist # \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0440\u0435\u043f. \u0423 \u0432\u0430\u0441 \u043e\u043d \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439. dnf config-manager --set-disabled epel epel-modular grafana pgdg-common pgdg12 pgdg13 timescale_timescaledb zabbix zabbix-non-supported # \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c wget https:\/\/raw.githubusercontent.com\/oracle\/centos2ol\/main\/centos2ol.sh chmod +x centos2ol.sh .\/centos2ol.sh<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/p>\n<pre><code class=\"bash\">Switch complete. Oracle recommends rebooting this system. [root@zabbix ~]# reboot<\/code><\/pre>\n<h2>2. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0411\u0414<\/h2>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 6 \u0432\u0435\u0440\u0441\u0438\u0438 Zabbix \u0442\u0440\u0435\u0431\u0443\u0435\u0442 PostgreSQL 13 \u0438\u043b\u0438 \u0441\u0442\u0430\u0440\u0448\u0435. \u042f \u043f\u0440\u0438\u043d\u044f\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0435\u0440\u0441\u0438\u044e 14.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 PostgreSQL 12.6 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 TimescaleDB 2.1.1, \u0430 \u0434\u043b\u044f <a href=\"https:\/\/docs.timescale.com\/timescaledb\/latest\/how-to-guides\/update-timescaledb\/#timescaledb-release-compatibility\" rel=\"noopener noreferrer nofollow\">PostgreSQL 14 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 2.5+<\/a>, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0451. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e TimescaleDB 2.7 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442) \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 PostgreSQL 12, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e PostgreSQL.<\/p>\n<pre><code class=\"bash\">su - postgres # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 zabbix psql zabbix # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0411\u0414 \u0438 \u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 zabbix=# \\dx                                       List of installed extensions     Name     | Version |   Schema   |                            Description -------------+---------+------------+-------------------------------------------------------------------  plpgsql     | 1.0     | pg_catalog | PL\/pgSQL procedural language  timescaledb | 2.1.1   | public     | Enables scalable inserts and complex queries for time-series data (2 rows) zabbix=# \\q exit<\/code><\/pre>\n<p>\u041d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 PostgreSQL:<\/p>\n<pre><code class=\"bash\"># \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 PostgreSQL rpm -Uvh https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-8-x86_64\/pgdg-redhat-repo-latest.noarch.rpm # \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0435\u0435 dnf config-manager --set-disabled pgdg10 pgdg11 pgdg13  # \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 dnf config-manager --set-enabled timescale_timescaledb<\/code><\/pre>\n<p>\u041d\u0443 \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c TimescaleDB:<\/p>\n<pre><code class=\"bash\"># \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442 dnf upgrade -y timescaledb-2-postgresql-12 su - postgres psql zabbix # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432 \u0411\u0414 ALTER EXTENSION timescaledb UPDATE; # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0432\u0435\u0440\u0441\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u0434\u043e 2.7.0 \\dx                                       List of installed extensions     Name     | Version |   Schema   |                            Description -------------+---------+------------+-------------------------------------------------------------------  plpgsql     | 1.0     | pg_catalog | PL\/pgSQL procedural language  timescaledb | 2.7.0   | public     | Enables scalable inserts and complex queries for time-series data (2 rows)  \\q<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0430\u043c PostgreSQL. \u0422\u0443\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043d\u0435\u0451 \u0431\u0430\u0437\u044b. \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b pg_upgrade, \u0445\u043e\u0442\u044f \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b.<\/p>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c PostgeSQL 14 \u0438 TimescaleDB \u0434\u043b\u044f \u043d\u0435\u0451 dnf install -y postgresql14-server timescaledb-2-postgresql-14 # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0431\u0430\u0437\u0443 postgresql-14-setup initdb # \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b timescaledb-tune \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 postgresql.conf: timescaledb-tune --pg-config=\/usr\/pgsql-14\/bin\/pg_config # \u0422\u0430\u043a \u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0440\u0442 \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 # port = 5532 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e port = 5432) vim \/var\/lib\/pgsql\/14\/data\/postgresql.conf # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 systemctl enable postgresql-14 # \u0421\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0432\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 diff \/var\/lib\/pgsql\/12\/data\/pg_hba.conf \/var\/lib\/pgsql\/14\/data\/pg_hba.conf<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 pg_hba.conf \u0443 postgresql 14 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 scram-sha-256 (\u0432\u043c\u0435\u0441\u0442\u043e md5 \u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439). \u041f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438 (\u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0445 \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u043d\u0430 <abbr title=\"Salted Challenge Response Authentication Mechanism\" type=\"abbr\">SCRAM<\/abbr> (\u0432\u043e\u0442 <a href=\"https:\/\/www.crunchydata.com\/blog\/how-to-upgrade-postgresql-passwords-to-scram\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/a>), \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 md5. <\/p>\n<p>\u042f \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u043b \u044d\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430 \u0443\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435. \u041d\u043e, \u0434\u0443\u043c\u0430\u044e, \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e SCRUM<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438 \u0434\u043e SCRAM \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 2 \u0432\u0435\u0449\u0430\u0445:<\/p>\n<ol>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f PostgreSQL 10 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u0430\u0439\u0432\u0435\u0440\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 SCRAM.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0430\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a:   <\/p>\n<ol>\n<li>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 postgresql.conf \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 password_encryption \u0432 scram-sha-256.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438. \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c zabbix.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438, \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0439 (\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439) \u043f\u0430\u0440\u043e\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \\password \u0432 psql.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c md5 \u0432 \u0444\u0430\u0439\u043b\u0435 pg_hba.conf \u043d\u0430 scram-sha-256.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c password_encryption = scram-sha-256 vim \/var\/lib\/pgsql\/14\/data\/postgresql.conf # \u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e PostgreSQL service postgresql-14 reload # \u041f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c postgres \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c psql su - postgres psql # \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 SELECT     rolname, rolpassword ~ '^SCRAM-SHA-256\\$' AS has_upgraded FROM pg_authid WHERE rolcanlogin; # \u0423 \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  rolname  | has_upgraded ----------+--------------  postgres | t  zabbix   | f (2 rows) # \u0415\u0441\u043b\u0438 \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 has_upgraded \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 false (f), \u0442\u043e \u0435\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c. # \u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f zabbix \\password zabbix # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f TRUE (t) SELECT rolname, rolpassword ~ '^SCRAM-SHA-256\\$' AS has_upgraded FROM pg_authid WHERE rolcanlogin; # \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0441\u0435\u0445 true  rolname  | has_upgraded ----------+--------------  postgres | t  zabbix   | t (2 rows) # \u0412\u044b\u0445\u043e\u0434 \u0438\u0437 psql \\q # \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c md5 \u0432 \u0444\u0430\u0439\u043b\u0435 pg_hba.conf \u043d\u0430 scram-sha-256 vim \/var\/lib\/pgsql\/14\/data\/pg_hba.conf # \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u0423\u0417 root exit # \u0418 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e PostgreSQL service postgresql-14 reload<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<pre><code class=\"bash\"># \u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0433\u043e\u0442\u043e\u0432 \u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e. # \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c pg_upgrade \u0441 \u043a\u043b\u044e\u0447\u043e\u043c --check. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442. sudo -iu postgres \/usr\/pgsql-14\/bin\/pg_upgrade \\   --old-datadir=\/var\/lib\/pgsql\/12\/data \\   --new-datadir=\/var\/lib\/pgsql\/14\/data \\   --old-bindir=\/usr\/pgsql-12\/bin \\   --new-bindir=\/usr\/pgsql-14\/bin \\   --old-options '-c config_file=\/var\/lib\/pgsql\/12\/data\/postgresql.conf' \\   --new-options '-c config_file=\/var\/lib\/pgsql\/14\/data\/postgresql.conf' \\   --check    # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f: Performing Consistency Checks on Old Live Server ------------------------------------------------ Checking cluster versions                                   ok Checking database user is the install user                  ok Checking database connection settings                       ok Checking for prepared transactions                          ok Checking for system-defined composite types in user tables  ok Checking for reg* data types in user tables                 ok Checking for contrib\/isn with bigint-passing mismatch       ok Checking for user-defined encoding conversions              ok Checking for user-defined postfix operators                 ok Checking for presence of required libraries                 ok Checking database user is the install user                  ok Checking for prepared transactions                          ok Checking for new cluster tablespace directories             ok  *Clusters are compatible* # \u041e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442, \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e.<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u0430 (\u0441\u0442\u0430\u0440\u044b\u0439 \u0438 \u043d\u043e\u0432\u044b\u0439) \u0441\u0435\u0440\u0432\u0438\u0441\u0430 PostgeSQL \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b. \u0414\u0430 \u0438 Zabbix \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<pre><code class=\"bash\">service postgresql-12 stop service postgresql-14 stop service zabbix-server stop service zabbix-agent2 stop # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 sudo -iu postgres \/usr\/pgsql-14\/bin\/pg_upgrade \\   --old-datadir=\/var\/lib\/pgsql\/12\/data \\   --new-datadir=\/var\/lib\/pgsql\/14\/data \\   --old-bindir=\/usr\/pgsql-12\/bin \\   --new-bindir=\/usr\/pgsql-14\/bin \\   --old-options<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-334679","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=334679"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334679\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=334679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=334679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=334679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}