update help elma
This commit is contained in:
@ -1,20 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Кластер PostgreSQL</title>
|
||||
<title>PostgreSQL cluster</title>
|
||||
<meta name="generator" content="Help+Manual" />
|
||||
<meta name="keywords" content="«Системные требования ELMA365 On-Premises Enterprise»" />
|
||||
<meta name="keywords" content="" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="Для корректной работы системы требуется PostgreSQL версии 11–15. В статье описана установка PostgreSQL 13 для ОС Ubuntu Linux 20.04 и 22.04. Также вы можете ознакомиться с..." />
|
||||
<meta name="description" content="To ensure the correct operation of the system, PostgreSQL version 10–15 is required. The article describes the installation of PostgreSQL 13 for Ubuntu Linux 20.04 and 22.04...." />
|
||||
<meta name="picture" content="" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="Cправка по Low-code платформе ELMA365" />
|
||||
<meta property="og:url" content="https://elma365.com/ru/help" />
|
||||
<meta property="og:image" content="" />
|
||||
<meta property="og:site_name" content="ELMA365" />
|
||||
<meta property="og:title" content="Full documentation for BRIX365 platform. Low-code developer guide. User guide. Admin guide. Developer guide." />
|
||||
<meta property="og:url" content="https://brix365.com/en/help" />
|
||||
<meta property="og:image" content="" />
|
||||
<link rel="icon" href="favicon.png" type="image/png" />
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
||||
@ -24,7 +23,6 @@
|
||||
<link rel="stylesheet" href="./article.css" />
|
||||
<link rel="stylesheet" href="./glossary.css" />
|
||||
<link rel="stylesheet" href="./theme.css" />
|
||||
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="helpman_settings.js"></script>
|
||||
<script type="text/javascript" src="helpman_topicinit.js"></script>
|
||||
@ -36,16 +34,16 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-M6ETBEC1R9"></script><script>window.dataLayer=window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date()); gtag('config', 'G-M6ETBEC1R9');</script>
|
||||
|
||||
<script>!function(e,t,c,n,r,a,m){e.ym=e.ym||function(){(e.ym.a=e.ym.a||[]).push(arguments)},e.ym.l=1*new Date;for(var s=0;s<document.scripts.length;s++)if(document.scripts[s].src===n)return;a=t.createElement(c),m=t.getElementsByTagName(c)[0],a.async=1,a.src=n,m.parentNode.insertBefore(a,m)}(window,document,"script","https://mc.yandex.ru/metrika/tag.js"),ym(83179930,"init",{clickmap:!0,trackLinks:!0,accurateTrackBounce:!0,webvisor:!0})</script><noscript><div><img alt=""src=https://mc.yandex.ru/watch/83179930 style=position:absolute;left:-9999px></div></noscript>
|
||||
|
||||
<header class="header elma-365">
|
||||
<div class="container">
|
||||
<a class="header__logo" href="https://elma365.com/ru/help">
|
||||
<img src="./logo.svg" alt="header logo">
|
||||
<a class="header__logo" href="https://brix365.com/en/help">
|
||||
<img src="./logo-en.svg" alt="header logo">
|
||||
</a>
|
||||
<!-- <div class="hero__search-form" id="search-panel">
|
||||
<form class="search-form" onsubmit="ym(83179930,'reachGoal','poisk')">
|
||||
<form class="search-form" onsubmit="ym(83180416,'reachGoal','poisk')">
|
||||
<label class="search-form__label">
|
||||
<span id="reset-search" class="search__icon"></span>
|
||||
<input class="search-form__input" type="text">
|
||||
@ -65,7 +63,7 @@
|
||||
</div>
|
||||
<div class="header__navi">
|
||||
|
||||
<ul class="header__list"><li><span class="solution-select"><span class="solution-select__selected"></span><svg width="7" height="4" viewBox="0 0 7 4" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L3.5 3.5L6 1" stroke="white" stroke-linecap="round" stroke-linejoin="round"/></svg><ul class="solution-select__list"><li><a class="project-link" href="https://elma365.com/ru/help/platform/get-trial.html">Платформа</a></li><li><a class="project-link" href="https://elma365.com/ru/help/ecm/ecm-functions.html">ECM</a></li><li><a class="project-link" href="https://elma365.com/ru/help/crm/crm_overview.html">CRM</a></li><li><a class="project-link" href="https://elma365.com/ru/help/service/service-functions.html">Service</a></li><li><a class="project-link" href="https://elma365.com/ru/help/projects/projects-functions.html">Проекты</a></li><li><a class="project-link" href="https://elma365.com/ru/help/business_solutions/-elma365-store.html">Бизнес-решения</a></li></ul></span></li><li><a href="https://api.elma365.com/ru/"target="_blank">API</a></li><li><a href="https://tssdk.elma365.com/"target="_blank">SDK</a></li><li><a href="https://community.elma365.com/" target="_blank">Community</a></li><li><a href="https://elma-academy.com/ru/" target="_blank">Академия</a></li><li><a href="https://elma365.com/ru/" target="_blank">Сайт ELMA365</a></li></ul>
|
||||
<ul class="header__list"><li><span class="solution-select"><span class="solution-select__selected"></span><svg width="7" height="4" viewBox="0 0 7 4" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L3.5 3.5L6 1" stroke="white" stroke-linecap="round" stroke-linejoin="round"/></svg><ul class="solution-select__list"><li><a class="project-link" href="https://brix365.com/en/help/platform/get-trial.html">Platform</a></li><li><a class="project-link" href="https://brix365.com/en/help/ecm/ecm-functions.html">ECM</a></li><li><a class="project-link" href="https://brix365.com/en/help/crm/crm_overview.html">CRM</a></li><li><a class="project-link" href="https://brix365.com/en/help/service/service-functions.html">Service</a></li><li><a class="project-link" href="https://brix365.com/en/help/projects/projects-functions.html">Projects</a></li><li><a class="project-link" href="https://brix365.com/en/help/business_solutions/-elma365-store.html">Business Solutions</a></li></ul></span></li><li><a href="https://api.brix365.com/en/" target="_blank">API</a></li><li><a href="https://tssdk.brix365.com/" target="_blank">SDK</a></li></ul>
|
||||
|
||||
|
||||
</div>
|
||||
@ -80,8 +78,8 @@
|
||||
|
||||
<aside class="sidebar" id="sidebar">
|
||||
<div class="sidebar__header">
|
||||
<a class="header__logo" href="https://elma365.com/ru/help">
|
||||
<img src="./logo-light.svg">
|
||||
<a class="header__logo" href="https://brix365.com/en/help">
|
||||
<img src="./logo-light-en.svg">
|
||||
</a>
|
||||
<span class="sidebar__close elma-365-close" id="close"></span>
|
||||
</div>
|
||||
@ -94,15 +92,15 @@
|
||||
<div class="article-inner">
|
||||
<div class="content">
|
||||
<header class="article__header">
|
||||
<div class="article__bread" style="display:flex; gap:10px;">
|
||||
<div class="article__bread" style="display:flex; gap:10px;">
|
||||
<span id="subcategory" class="search-res__item-category search-res__item-category_subcategory subcategory article__badge"></span>
|
||||
|
||||
<div class="topic__breadcrumbs">
|
||||
<p><a href="elma365-on-premises.html">ELMA365 On-Premises</a> > <a href="infrastructure-preparation.html">Подготовка инфраструктуры</a> > Базы данных > Отказоустойчивая инфраструктура / Кластер PostgreSQL</p>
|
||||
<p><a href="elma365-on-premises.html">BRIX On-Premises</a> > <a href="infrastructure-preparation.html">Prepare infrastructure</a> > Databases > High availability infrastructure / PostgreSQL cluster</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="topic__title"><h1 class="p_Heading1"><span class="f_Heading1">Кластер PostgreSQL</span></h1>
|
||||
<div class="topic__title"><h1 class="p_Heading1"><span class="f_Heading1">PostgreSQL cluster</span></h1>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
@ -111,37 +109,37 @@
|
||||
<a href="#h1-article" class="scroll-top"></a>
|
||||
</div>
|
||||
<!-- Placeholder for topic body. -->
|
||||
<p class="p_Normal">Для корректной работы системы требуется PostgreSQL версии 11<span style="font-size: 15px; color: #394149;">–</span>15. В статье описана установка PostgreSQL 13 для ОС Ubuntu Linux 20.04 и 22.04. Также вы можете ознакомиться с руководством в <a href="https://www.postgresql.org/docs/13/high-availability.html" target="_blank" class="weblink">официальной документации PostgreSQL</a>.</p>
|
||||
<p class="p_Normal">Установка состоит из 10 этапов:</p>
|
||||
<p class="p_Normal" style="line-height: 1.20;">To ensure the correct operation of the system, PostgreSQL version 10–15 is required. The article describes the installation of PostgreSQL 13 for Ubuntu Linux 20.04 and 22.04. You can also refer to the <a href="https://www.postgresql.org/docs/13/high-availability.html" target="_blank" class="weblink">official PostgreSQL documentation</a>.</p>
|
||||
<p class="p_Normal" style="line-height: 1.20;">The installation consists of 10 steps:</p>
|
||||
<ol style="list-style-type:decimal">
|
||||
<li value="1" class="p_Normal"><a href="configure-postgresql.html#preparation-node" class="topiclink">Подготовка нод (серверов)</a>.</li><li value="2" class="p_Normal"><a href="configure-postgresql.html#preparation-etcd" class="topiclink">Подготовка кластера etcd</a>.</li><li value="3" class="p_Normal"><a href="configure-postgresql.html#install-postgresql" class="topiclink">Установка PostgreSQL</a>.</li><li value="4" class="p_Normal"><a href="configure-postgresql.html#setting-postgresql" class="topiclink">Настройка PostgreSQL</a>.</li><li value="5" class="p_Normal"><a href="configure-postgresql.html#install-patroni" class="topiclink">Установка Patroni</a>.</li><li value="6" class="p_Normal"><a href="configure-postgresql.html#setting-patroni" class="topiclink">Настройка Patroni</a>.</li><li value="7" class="p_Normal"><a href="configure-postgresql.html#preparation-postgresql-patroni" class="topiclink">Подготовка кластера PostgreSQL+Patroni</a>.</li><li value="8" class="p_Normal"><a href="configure-postgresql.html#prepare-pgbouncer" class="topiclink">Подготовка PGBouncer (опционально)</a>.</li><li value="9" class="p_Normal"><a href="configure-postgresql.html#haproxy-configuration" class="topiclink">Конфигурация HAProxy (блок postgres)</a>.</li><li value="10" class="p_Normal"><a href="configure-postgresql.html#connecting-to-postgresql" class="topiclink">Подключение к PostgreSQL</a>.</li></ol>
|
||||
<h2 class="p_Heading2"><a id="preparation-node" class="hmanchor"></a><span class="f_Heading2">Шаг 1. Подготовка нод (серверов)</span></h2>
|
||||
<p class="p_Normal">Создайте три ноды (сервера) с последовательно пронумерованными именами хостов.</p>
|
||||
<li value="1" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#preparation-node" class="topiclink">Prepare nodes (servers)</a>.</li><li value="2" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#preparation-etcd" class="topiclink">Prepare the etcd cluster</a>.</li><li value="3" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#install-postgresql" class="topiclink">Install PostgreSQL</a>.</li><li value="4" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#setting-postgresql" class="topiclink">Configure PostgreSQL</a>.</li><li value="5" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#install-patroni" class="topiclink">Install Patroni</a>.</li><li value="6" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#setting-patroni" class="topiclink">Configure Patroni</a>.</li><li value="7" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#preparation-postgresql-patroni" class="topiclink">Prepare the PostgreSQL+Patroni cluster</a>.</li><li value="8" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#prepare-pgbouncer" class="topiclink">Prepare PGBouncer (optional)</a>.</li><li value="9" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#haproxy-configuration" class="topiclink">Configure HAProxy (postgres block)</a>.</li><li value="10" class="p_Normal" style="line-height: 1.20;"><a href="configure-postgresql.html#connecting-to-postgresql" class="topiclink">Connect to PostgreSQL</a>.</li></ol>
|
||||
<h2 class="p_Heading2"><a id="preparation-node" class="hmanchor"></a><span class="f_Heading2">Step 1: Prepare nodes (servers)</span></h2>
|
||||
<p class="p_Normal">Create three nodes (servers) with sequentially numbered host names.</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">начало внимание</span></p>
|
||||
<p class="p_Normal">Минимальное количество серверов для организации кластера <span style="font-size: 15px; font-family: Calibri,Vectora,'Droid Sans','Open Sans',Frutiger,sans-serif;">— </span>три.</p>
|
||||
<p class="p_Normal">The minimum number of servers for organizing a cluster is three.</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">конец внимание</span></p>
|
||||
<p class="p_Normal" style="line-height: 1.50;"><span style="font-size: 15px;">В этом примере используется три узла со следующими hostname и IP-адресами:</span></p>
|
||||
<p class="p_Normal" style="line-height: 1.50;"><span style="font-size: 15px;">In this example, three nodes with the following hostnames and IP addresses are used:</span></p>
|
||||
<ul style="list-style-type:disc">
|
||||
<li class="p_Normal"><span style="font-weight: bold;">postgres-server1.your_domain, 192.168.1.1</span>;</li><li class="p_Normal"><span style="font-weight: bold;">postgres-server2.your_domain, 192.168.1.2</span>;</li><li class="p_Normal"><span style="font-weight: bold;">postgres-server3.your_domain, 192.168.1.3</span>.</li></ul>
|
||||
<p class="p_Normal">Создайте необходимые сопоставления имён хостов в DNS. Если такой возможности нет, внесите нужные записи в <code><b>/etc/hosts</b></code>.</p>
|
||||
<h2 class="p_Heading2"><a id="preparation-etcd" class="hmanchor"></a><span class="f_Heading2">Шаг 2. Подготовка кластера etcd</span></h2>
|
||||
<p class="p_Normal">Create the necessary host name mappings in DNS. If not possible, add the required entries in <code><b>/etc/hosts</b></code>.</p>
|
||||
<h2 class="p_Heading2"><a id="preparation-etcd" class="hmanchor"></a><span class="f_Heading2">Step 2: Prepare the etcd cluster</span></h2>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal" style="line-height: 1.68; margin-top: 10px; margin-right: 0; margin-bottom: 0;">Установите <code><b>etcd</b></code> на все узлы:</li></ol>
|
||||
<li value="1" class="p_Normal" style="line-height: 1.68; margin-top: 10px; margin-right: 0; margin-bottom: 0;">Install <code><b>etcd</b></code> on all nodes:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo apt-</span><span class="f_CodeExample" style="font-weight: bold;">get</span><span class="f_CodeExample"> install etcd -y</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="2" class="p_Normal" style="line-height: 1.68;">Остановите <code><b>etcd</b></code> на всех узлах:</li></ol>
|
||||
<li value="2" class="p_Normal" style="line-height: 1.68;">Stop <code><b>etcd</b></code> on all nodes:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo systemctl stop etcd</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="3" class="p_Normal" style="line-height: 1.68;">Удалите каталог данных:</li></ol>
|
||||
<li value="3" class="p_Normal" style="line-height: 1.68;">Remove the data directory:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo rm -rf /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/etcd</span><span class="f_CodeExample" style="font-style: italic;">/*</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="4" class="p_Normal" style="line-height: 1.68;">Переместите конфигурационный файл по умолчанию:</li></ol>
|
||||
<li value="4" class="p_Normal" style="line-height: 1.68;">Move the default configuration file:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo mv /etc/default/etcd{,.original}</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="5">
|
||||
<li value="5" class="p_Normal" style="line-height: 1.68;">Создайте и откройте для редактирования новый конфигурационный файл:</li></ol>
|
||||
<li value="5" class="p_Normal" style="line-height: 1.68;">Create and open a new configuration file for editing:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo nano /etc/default/etcd</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="6">
|
||||
<li value="6" class="p_Normal" style="line-height: 1.68;">Добавьте пример конфигураций в файл для узла<span style="font-weight: bold;"> postgres-server1.your_domain</span>:</li></ol>
|
||||
<li value="6" class="p_Normal" style="line-height: 1.68;">Add the example configurations for the<span style="font-weight: bold;"> postgres-server1.your_domain</span> node:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">ETCD_NAME="postgres-server1"</span><br />
|
||||
<span class="f_CodeExample">ETCD_DATA_DIR="/var/lib/etcd/default"</span><br />
|
||||
<span class="f_CodeExample">ETCD_HEARTBEAT_INTERVAL="1000"</span><br />
|
||||
@ -155,8 +153,8 @@
|
||||
<span class="f_CodeExample">ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.1:2379"</span><br />
|
||||
<span class="f_CodeExample">ETCD_ENABLE_V2="true"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_ELECTION_TICK_ADVANCE="false"</span></p>
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A1')">Пример конфигураций с включением TLS/SSL для узла postgres-server1.your_domain:</a></p>
|
||||
<div id="TOGGLE0186A1" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A1')">Example configurations with enabling TLS/SSL for the postgres-server1.your_domain node:</a></p>
|
||||
<div id="TOGGLE0186A1" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.80; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<tr>
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">ETCD_NAME="postgres-server1"</span><br />
|
||||
<span class="f_CodeExample">ETCD_DATA_DIR="/var/lib/etcd/default"</span><br />
|
||||
@ -184,22 +182,22 @@
|
||||
</table>
|
||||
</div>
|
||||
<ol style="list-style-type:upper-roman" start="7">
|
||||
<li value="7" class="p_Normal" style="line-height: 1.68;">Добавьте пример конфигураций в файл для узла <span style="font-weight: bold;">postgres-server2.your_domain</span>:</li></ol>
|
||||
<li value="7" class="p_Normal" style="line-height: 1.68;">Add the example configurations to the file for the <span style="font-weight: bold;">postgres-server2.your_domain </span>node:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">ETCD_NAME="postgres-server2"</span><br />
|
||||
<span class="f_CodeExample">ETCD_DATA_DIR="/var/lib/etcd/default"</span><br />
|
||||
<span class="f_CodeExample">ETCD_HEARTBEAT_INTERVAL="1000"</span><br />
|
||||
<span class="f_CodeExample">ETCD_ELECTION_TIMEOUT="5000"</span><br />
|
||||
<span class="f_CodeExample">ETCD_LISTEN_PEER_URLS="http://192.168.1.2:2380"</span><br />
|
||||
<span class="f_CodeExample">ETCD_LISTEN_CLIENT_URLS="http://192.168.1.2:2379,http://127.0.0.1:2379"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.1.2:2380"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_CLUSTER="postgres-server1=http://192.168.1.1:2380,postgres-server2=http://192.168.1.2:2380,postgres-server3=http://192.168.1.3:2380"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.1.2:12380"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_CLUSTER="postgres-server1=http://192.168.1.1:12380,postgres-server2=http://192.168.1.2:12380,postgres-server3=http://192.168.1.3:2380"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_CLUSTER_STATE="new"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_CLUSTER_TOKEN="etcd-postgres-cluster"</span><br />
|
||||
<span class="f_CodeExample">ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.2:2379"</span><br />
|
||||
<span class="f_CodeExample">ETCD_ENABLE_V2="true"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_ELECTION_TICK_ADVANCE="false"</span></p>
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A2')">Пример конфигураций с включением TLS/SSL для узла postgres-server2.your_domain:</a></p>
|
||||
<div id="TOGGLE0186A2" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A2')">Example configurations with enabling TLS/SSL for the postgres-server2.your_domain:</a></p>
|
||||
<div id="TOGGLE0186A2" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.80; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<tr>
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">ETCD_NAME="postgres-server2"</span><br />
|
||||
<span class="f_CodeExample">ETCD_DATA_DIR="/var/lib/etcd/default"</span><br />
|
||||
@ -227,7 +225,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<ol style="list-style-type:upper-roman" start="8">
|
||||
<li value="8" class="p_Normal" style="line-height: 1.68;">Добавьте пример конфигураций в файл для узла <span style="font-weight: bold;">postgres-server3.your_domain</span>:</li></ol>
|
||||
<li value="8" class="p_Normal" style="line-height: 1.68;">Add the example configurations to the file for the <span style="font-weight: bold;">postgres-server3.your_domain </span>node:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">ETCD_NAME="postgres-server3"</span><br />
|
||||
<span class="f_CodeExample">ETCD_DATA_DIR="/var/lib/etcd/default"</span><br />
|
||||
<span class="f_CodeExample">ETCD_HEARTBEAT_INTERVAL="1000"</span><br />
|
||||
@ -241,7 +239,7 @@
|
||||
<span class="f_CodeExample">ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.3:2379"</span><br />
|
||||
<span class="f_CodeExample">ETCD_ENABLE_V2="true"</span><br />
|
||||
<span class="f_CodeExample">ETCD_INITIAL_ELECTION_TICK_ADVANCE="false"</span></p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A3')">Пример конфигураций с включением TLS/SSL для узла postgres-server3.your_domain:</a></p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A3')">Example configurations with enabling TLS/SSL for the postgres-server3.your_domain:</a></p>
|
||||
<div id="TOGGLE0186A3" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.0; page-break-inside: avoid; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<tr>
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">ETCD_NAME="postgres-server3"</span><br />
|
||||
@ -269,100 +267,100 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<p class="p_Normal" style="line-height: 1.68;">Рассмотрим введённые параметры:</p>
|
||||
<p class="p_Normal" style="line-height: 1.68;">Let's review the provided parameters:</p>
|
||||
<ul style="list-style-type:disc">
|
||||
<li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_NAME</b></code> — имя этого узла кластера. Должно быть уникально в кластере;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_LISTEN_CLIENT_URLS</b></code> — точка подключения для клиентов кластера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_ADVERTISE_CLIENT_URLS</b></code> — список URL-адресов, по которым его могут найти остальные узлы кластера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_LISTEN_PEER_URLS</b></code> — точка подключения для остальных узлов кластера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_ADVERTISE_PEER_URLS</b></code> — начальный список URL-адресов, по которым его могут найти остальные узлы кластера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_CLUSTER_TOKEN</b></code> — токен кластера, должен совпадать на всех узлах кластера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_CLUSTER</b></code> — список узлов кластера на момент запуска;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_CLUSTER_STATE</b></code> — может принимать два значения: <code><b>new</b></code> и <code><b>existing</b></code>;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_DATA_DIR</b></code> — расположение каталога данных кластера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_ELECTION_TIMEOUT</b></code> — время в миллисекундах, которое проходит между последним принятым оповещением от лидера кластера, до попытки захватить роль лидера на ведомом узле;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_HEARTBEAT_INTERVAL</b></code> — время в миллисекундах, между рассылками лидером оповещений о том, что он всё ещё лидер.</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_CERT_FILE</b></code> — путь до файла сертификата сервера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_KEY_FILE</b></code> — путь до файла закрытого ключа;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_TRUSTED_CA_FILE</b></code> — путь до файла корневого CA;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_CLIENT_CERT_AUTH</b></code> — может принимать два значения: <code><b>true</b></code> и <code><b>false</b></code>;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_CERT_FILE</b></code> — путь до файла сертификата сервера;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_KEY_FILE</b></code> — путь до файла закрытого ключа;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_TRUSTED_CA_FILE</b></code> — путь до файла корневого CA;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_CLIENT_CERT_AUTH</b></code> — может принимать два значения: <code><b>true</b></code> и <code><b>false</b></code>;</li></ul>
|
||||
<li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_NAME</b></code>: Unique name within the cluster;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_LISTEN_CLIENT_URLS</b></code>: Connection point for clients in the cluster;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_ADVERTISE_CLIENT_URLS</b></code>: URLs through which other cluster nodes can be found.;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_LISTEN_PEER_URLS</b></code>: Connection point for other nodes in the cluster;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_ADVERTISE_PEER_URLS</b></code>: Initial URLs through which other nodes can find it;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_CLUSTER_TOKEN</b></code>: Token for the cluster, must be the same on all nodes.;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_CLUSTER</b></code>: List of nodes in the cluster at startup;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_INITIAL_CLUSTER_STATE</b></code>: Can take two values: <code><b>new</b></code> and <code><b>existing</b></code>;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_DATA_DIR</b></code>: Location of the cluster's data directory;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_ELECTION_TIMEOUT</b></code>: Time in milliseconds between the last received notification from the cluster leader and attempting to take over the leader role on the follower node;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_HEARTBEAT_INTERVAL</b></code>: Time in milliseconds between leader notifications sent by the leader node to inform others that it is still the leader;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_CERT_FILE</b></code>: Path to the server certificate file;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_KEY_FILE</b></code>: Path to the private key file;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_TRUSTED_CA_FILE</b></code>: Path to the root CA file;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_CLIENT_CERT_AUTH</b></code>: Can take two values: <code><b>true</b></code> and <code><b>false</b></code>;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_CERT_FILE</b></code>: Path to the server certificate file;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_KEY_FILE</b></code>: Path to the private key file;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_TRUSTED_CA_FILE</b></code>: Path to the root CA file;</li><li class="p_Normal" style="line-height: 1.68;"><code><b>ETCD_PEER_CLIENT_CERT_AUTH</b></code>: Can take two values: <code><b>true</b></code> and <code><b>false</b></code>;</li></ul>
|
||||
<ol style="list-style-type:upper-roman" start="9">
|
||||
<li value="9" class="p_Normal" style="line-height: 1.68;">Перезапустите <code><b>etcd</b></code> на всех узлах:</li></ol>
|
||||
<li value="9" class="p_Normal" style="line-height: 1.68;">Restart <code><b>etcd</b></code> on all nodes:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo systemctl restart etcd</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="10">
|
||||
<li value="10" class="p_Normal" style="line-height: 1.68;">Проверьте состояние кластера.</li></ol>
|
||||
<p class="p_Normal" style="line-height: 1.68;">Для кластера без TLS:</p>
|
||||
<li value="10" class="p_Normal" style="line-height: 1.68;">Check the cluster status.</li></ol>
|
||||
<p class="p_Normal" style="line-height: 1.68;">For a cluster without TLS:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo etcdctl cluster-health</span></p>
|
||||
<p class="p_Normal">Для кластера c TLS:</p>
|
||||
<p class="p_Normal">For a cluster with TLS:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo etcdctl -C https:</span><span class="f_CodeExample">//postgres-server1.your_domain:2379 --key-file /path/to/private.key --cert-file /path/to/public.crt --ca-file /path/to/certCA.pem cluster-health</span></p>
|
||||
<h2 class="p_Heading2"><a id="install-postgresql" class="hmanchor"></a><span class="f_Heading2">Шаг 3. Установка PostgreSQL</span></h2>
|
||||
<h2 class="p_Heading2"><a id="install-postgresql" class="hmanchor"></a><span class="f_Heading2">Step 3: Install PostgreSQL</span></h2>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">начало внимание</span></p>
|
||||
<p class="p_Normal">С аппаратными требованиями, необходимыми для корректной работы ELMA365 на PostgreSQL, можно ознакомиться в статье <a href="elma365-enterprise-on-premises.html#postgresql" class="topiclink">«Системные требования ELMA365 On-Premises Enterprise»</a>.</p>
|
||||
<p class="p_Normal">Hardware requirements for BRIX on PostgreSQL can be found in <a href="elma365-enterprise-on-premises.html#postgresql" class="topiclink">System requirements for BRIX On-Premises Enterprise</a>.</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">конец внимание</span></p>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal">Для установки PostgreSQL добавьте официальный репозиторий <code><b>postgresql</b></code>:</li></ol>
|
||||
<li value="1" class="p_Normal">To install PostgreSQL, add the official repository <code><b>postgresql</b></code>:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'</span><br />
|
||||
<span class="f_CodeExample">wget --quiet -O - https:</span><span class="f_CodeExample">//www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="2" class="p_Normal">Обновите кеш пакетов, выполнив команду:</li></ol>
|
||||
<li value="2" class="p_Normal">Update package cache:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo apt update</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="3">
|
||||
<li value="3" class="p_Normal">Установите PostgreSQL на все узлы:</li></ol>
|
||||
<li value="3" class="p_Normal">Install PostgreSQL on all nodes:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo apt install postgresql-13 -y</span></p>
|
||||
<h2 class="p_Heading2"><a id="setting-postgresql" class="hmanchor"></a><span class="f_Heading2">Шаг 4. Настройка PostgreSQL</span></h2>
|
||||
<h2 class="p_Heading2"><a id="setting-postgresql" class="hmanchor"></a><span class="f_Heading2">Step 4: Configure PostgreSQL</span></h2>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">начало примечание</span></p>
|
||||
<p class="p_Normal"><span style="font-weight: bold;">Примечание</span></p>
|
||||
<p class="p_Normal">Для пароля разрешается применять следующие символы:</p>
|
||||
<p class="p_Normal"><span style="font-weight: bold;">Note</span></p>
|
||||
<p class="p_Normal">For the password, the following characters are allowed:</p>
|
||||
<ul style="list-style-type:disc">
|
||||
<li class="p_Normal">Заглавные латинские буквы: от A до Z;</li><li class="p_Normal">Строчные латинские буквы: от a до z;</li><li class="p_Normal">Цифры от 0 до 9;</li><li class="p_Normal">Символы: -_.</li></ul>
|
||||
<p class="p_Normal">Зарезервированные (недопустимые) символы:</p>
|
||||
<li class="p_Normal">Uppercase Latin letters: A to Z</li><li class="p_Normal">Lowercase Latin letters: a to z</li><li class="p_Normal">Digits: 0 to 9</li><li class="p_Normal">Symbols: -_</li></ul>
|
||||
<p class="p_Normal">Reserved (invalid) symbols:</p>
|
||||
<p class="p_Normal">! * ' ( ) ; : @ & = + $ , / ? % # [ ]</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">конец примечание</span></p>
|
||||
<h4 class="p_Heading4"><span class="f_Heading4">Действия для узла postgres-server1.your_domain:</span></h4>
|
||||
<h4 class="p_Heading4"><span class="f_Heading4">Actions for the node postgres-server1.your_domain:</span></h4>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal">Создайте новую роль <code><b>elma365</b></code> с паролем <span style="font-weight: bold;">SecretPassword</span>:</li></ol>
|
||||
<li value="1" class="p_Normal">Create a new role <code><b>elma365</b></code> with the password <span style="font-weight: bold;">SecretPassword</span>:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo -u postgres psql -c \</span><br />
|
||||
<span class="f_CodeExample">"CREATE ROLE elma365 WITH login password 'SecretPassword';"</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="2" class="p_Normal">Создайте базу данных <code><b>elma365</b></code> с владельцем <span style="font-weight: bold;">elma365</span>:</li></ol>
|
||||
<li value="2" class="p_Normal">Create a database <code><b>elma365</b></code> with owner <span style="font-weight: bold;">elma365</span>:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo -u postgres psql -c \</span><br />
|
||||
<span class="f_CodeExample">"CREATE DATABASE elma365 WITH OWNER elma365;"</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="3">
|
||||
<li value="3" class="p_Normal">Добавьте необходимые расширения для базы данных <code><b>elma365</b></code>:</li></ol>
|
||||
<li value="3" class="p_Normal">Add necessary extensions for the database <code><b>elma365</b></code>:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo -u postgres psql -d elma365 -c \</span><br />
|
||||
<span class="f_CodeExample">"CREATE EXTENSION \"uuid-ossp\"; CREATE EXTENSION pg_trgm;"</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="4">
|
||||
<li value="4" class="p_Normal">Создайте новую роль <code><b>replicator</b></code> с паролем <span style="font-weight: bold;">ReplicatorPassword</span> для работы с репликами. Должно совпадать с настройками <span style="font-weight: bold;">Patroni</span> из блока <code><b>postgresql - authentication - replication</b></code> и списком разрешённых хостов postgresql в файле <code><b>pg_hba.conf</b></code>:</li></ol>
|
||||
<li value="4" class="p_Normal">Create a new role <code><b>replicator</b></code> with the password <span style="font-weight: bold;">ReplicatorPassword</span> for working with replicas. It must match the Patroni settings in the block <code><b>postgresql - authentication - replication</b></code> and the list of allowed PostgreSQL hosts in the file <code><b>pg_hba.conf</b></code>:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo -u postgres psql -c \</span><br />
|
||||
<span class="f_CodeExample">"CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD 'ReplicatorPassword';"</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="5">
|
||||
<li value="5" class="p_Normal">Установите пароль для пользователя <span style="font-weight: bold;">postgres</span>:</li></ol>
|
||||
<li value="5" class="p_Normal">Set a password for the <span style="font-weight: bold;">postgres</span> user:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'PostgresPassword';"</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="6">
|
||||
<li value="6" class="p_Normal">Остановите PostgreSQL:</li></ol>
|
||||
<li value="6" class="p_Normal">Stop PostgreSQL:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">systemctl stop postgresql</span></p>
|
||||
<h4 class="p_Heading4"><span class="f_Heading4">Действия для узла postgres-server2.your_domain и postgres-server3.your_domain:</span></h4>
|
||||
<h4 class="p_Heading4"><span class="f_Heading4">Actions for the nodes postgres-server2.your_domain and postgres-server3.your_domain:</span></h4>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal"> Остановите PostgreSQL:</li></ol>
|
||||
<li value="1" class="p_Normal"> Stop PostgreSQL:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">systemctl stop postgresql</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="2" class="p_Normal">Удалите каталог данных на нодах <span style="font-weight: bold;">postgres-server2.your_domain</span> и <span style="font-weight: bold;">postgres-server3.your_domain</span>:</li></ol>
|
||||
<li value="2" class="p_Normal">Remove the data directory on the nodes <span style="font-weight: bold;">postgres-server2.your_domain</span> and <span style="font-weight: bold;">postgres-server3.your_domain</span>:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">rm -rf /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/postgresql/13/main</span></p>
|
||||
<h2 class="p_Heading2"><a id="install-patroni" class="hmanchor"></a><span class="f_Heading2">Шаг 5. Установка Patroni</span></h2>
|
||||
<h2 class="p_Heading2"><a id="install-patroni" class="hmanchor"></a><span class="f_Heading2">Step 5: Install Patroni</span></h2>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal">Установите Patroni и PIP на все узлы:</li></ol>
|
||||
<li value="1" class="p_Normal">Install Patroni and PIP on all nodes:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo apt-get install python3-pip python3-dev libpq-dev -y</span><br />
|
||||
<span class="f_CodeExample">sudo apt-get install patroni -y</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="2" class="p_Normal">Установите зависимости для работы Patroni на все узлы:</li></ol>
|
||||
<li value="2" class="p_Normal">Install dependencies for Patroni to work on all nodes:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">pip3 install psycopg2-binary</span><br />
|
||||
<span class="f_CodeExample">pip3 install wheel</span><br />
|
||||
<span class="f_CodeExample">pip3 install python-etcd</span></p>
|
||||
<h2 class="p_Heading2"><a id="setting-patroni" class="hmanchor"></a><span class="f_Heading2">Шаг 6. Настройка Patroni</span></h2>
|
||||
<h2 class="p_Heading2"><a id="setting-patroni" class="hmanchor"></a><span class="f_Heading2">Step 6: Configure Patroni</span></h2>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal">Создайте файл настроек:</li></ol>
|
||||
<li value="1" class="p_Normal">Create a configuration file:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo nano /etc/patroni/config.yml</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="2" class="p_Normal">В созданный файл <code><b>/etc/patroni/config.yml</b></code> нужно поместить пример начальной конфигурации, изменив ip-адреса на свои на каждом узле кластера. Обратите внимание на комментарии в данном файле.</li></ol>
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A4')">Пример начальной конфигурации:</a></p>
|
||||
<div id="TOGGLE0186A4" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<li value="2" class="p_Normal">Place an example initial configuration in the created <code><b>/etc/patroni/config.yml</b></code> file, changing the IP addresses for each node in the cluster. Pay attention to the comments in this file.</li></ol>
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A4')">Example initial configuration </a></p>
|
||||
<div id="TOGGLE0186A4" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.80; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<tr>
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">scope: postgres-cluster # одинаковое значение на всех узлах</span><br />
|
||||
<span class="f_CodeExample">name: postgresql-server1 # разное значение на всех узлах</span><br />
|
||||
<span class="f_CodeExample">namespace: /service/ # одинаковое значение на всех узлах</span><br />
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">scope: postgres-cluster # the same value on all nodes</span><br />
|
||||
<span class="f_CodeExample">name: postgresql-server1 # different values on all nodes</span><br />
|
||||
<span class="f_CodeExample">namespace: /service/ # the same value on all nodes</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">restapi:</span><br />
|
||||
<span class="f_CodeExample"> listen: postgres-server1.your_domain:8008 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> connect_address: postgres-server1.your_domain:8008 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> listen: postgres-server1.your_domain:8008 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> connect_address: postgres-server1.your_domain:8008 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">etcd:</span><br />
|
||||
<span class="f_CodeExample"> hosts: postgres-server1.your_domain:2379,postgres-server2.your_domain:2379,postgres-server3.your_domain:2379 # список всех узлов, на которых установлен etcd</span><br />
|
||||
<span class="f_CodeExample"> hosts: postgres-server1.your_domain:2379,postgres-server2.your_domain:2379,postgres-server3.your_domain:2379 # list of all the nodes with installed etcd</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">bootstrap:</span><br />
|
||||
<span class="f_CodeExample"> method: initdb</span><br />
|
||||
@ -449,7 +447,7 @@
|
||||
<span class="f_CodeExample"> - locale: en_US.UTF-8</span><br />
|
||||
<span class="f_CodeExample"> - data-checksums</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # должен содержать адреса ВСЕХ машин, используемых в кластере</span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # must contain addresses of ALL the machines used in the cluster</span><br />
|
||||
<span class="f_CodeExample"> - local all postgres peer</span><br />
|
||||
<span class="f_CodeExample"> - local all all peer</span><br />
|
||||
<span class="f_CodeExample"> - host all all 0.0.0.0/0 md5</span><br />
|
||||
@ -459,10 +457,10 @@
|
||||
<span class="f_CodeExample"> - host replication replicator 192.168.1.3/32 md5</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">postgresql:</span><br />
|
||||
<span class="f_CodeExample"> listen: 192.168.1.1,127.0.0.1:5432 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> connect_address: 192.168.1.1:5432 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> listen: 192.168.1.1,127.0.0.1:5432 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> connect_address: 192.168.1.1:5432 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> use_unix_socket: </span><span class="f_CodeExample" style="font-weight: bold;">true</span><br />
|
||||
<span class="f_CodeExample"> data_dir: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/postgresql/13/main # каталог данных</span><br />
|
||||
<span class="f_CodeExample"> data_dir: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/postgresql/13/main # data directory</span><br />
|
||||
<span class="f_CodeExample"> bin_dir: /usr/lib/postgresql/13/bin</span><br />
|
||||
<span class="f_CodeExample"> config_dir: /etc/postgresql/13/main</span><br />
|
||||
<span class="f_CodeExample"> pgpass: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/postgresql/.pgpass_patroni</span><br />
|
||||
@ -475,7 +473,7 @@
|
||||
<span class="f_CodeExample"> password: PostgresPassword</span><br />
|
||||
<span class="f_CodeExample"> parameters:</span><br />
|
||||
<span class="f_CodeExample"> unix_socket_directories: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/run/postgresql</span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # должен содержать адреса ВСЕХ машин, используемых в кластере</span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # must contain addresses of ALL the machines used in the cluster</span><br />
|
||||
<span class="f_CodeExample"> - local all postgres peer</span><br />
|
||||
<span class="f_CodeExample"> - local all all peer</span><br />
|
||||
<span class="f_CodeExample"> - host all all 0.0.0.0/0 md5</span><br />
|
||||
@ -507,34 +505,34 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A5')">Пример начальной конфигурации для включения поддержки TLS/SSL в Patroni.</a></p>
|
||||
<div id="TOGGLE0186A5" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A5')">Example initial configuration to enable TLS/SSL support in Patroni</a></p>
|
||||
<div id="TOGGLE0186A5" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.80; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<tr>
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_Normal">Нужно поместить пример начальной конфигурации с TLS/SSL в файл <code><b>/etc/patroni/config.yml</b></code>. Обратите внимание на комментарии в данном файле:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">scope: postgres-cluster # одинаковое значение на всех узлах</span><br />
|
||||
<span class="f_CodeExample">name: postgresql-server1 # разное значение на всех узлах</span><br />
|
||||
<span class="f_CodeExample">namespace: /service/ # одинаковое значение на всех узлах</span><br />
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_Normal">Place the example initial configuration with TLS/SSL in the file <code><b>/etc/patroni/config.yml</b></code>. Pay attention to the comments in this file:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">scope: postgres-cluster # the same value on all nodes</span><br />
|
||||
<span class="f_CodeExample">name: postgresql-server1 # different values on all nodes</span><br />
|
||||
<span class="f_CodeExample">namespace: /service/ # the same value on all nodes</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">restapi:</span><br />
|
||||
<span class="f_CodeExample"> listen: postgres-server1.your_domain:8008 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> connect_address: postgres-server1.your_domain:8008 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> listen: postgres-server1.your_domain:8008 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> connect_address: postgres-server1.your_domain:8008 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> cafile: /path/to/pgCA.pem</span><br />
|
||||
<span class="f_CodeExample"> certfile: /path/to/pg.crt # путь до файла сертификата сервера</span><br />
|
||||
<span class="f_CodeExample"> keyfile: /path/to/pg.key # путь до файла закрытого ключа</span><br />
|
||||
<span class="f_CodeExample"> verify_client: required # путь до файла корневого CA</span><br />
|
||||
<span class="f_CodeExample"> certfile: /path/to/pg.crt # path to the server certificate file</span><br />
|
||||
<span class="f_CodeExample"> keyfile: /path/to/pg.key # path to the private key file</span><br />
|
||||
<span class="f_CodeExample"> verify_client: required # path to the root CA file</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">etcd:</span><br />
|
||||
<span class="f_CodeExample"> protocol: https</span><br />
|
||||
<span class="f_CodeExample"> cert: /path/to/</span><span class="f_CodeExample" style="font-weight: bold;">public</span><span class="f_CodeExample">.crt # путь до файла сертификата сервера</span><br />
|
||||
<span class="f_CodeExample"> key: /path/to/</span><span class="f_CodeExample" style="font-weight: bold;">private</span><span class="f_CodeExample">.key # путь до файла закрытого ключа</span><br />
|
||||
<span class="f_CodeExample"> cacert: /path/to/certCA.pem # путь до файла корневого CA</span><br />
|
||||
<span class="f_CodeExample"> hosts: postgres-server1.your_domain:2379,postgres-server2.your_domain:2379,postgres-server3.your_domain:2379 # список всех узлов, на которых установлен etcd</span><br />
|
||||
<span class="f_CodeExample"> cert: /path/to/</span><span class="f_CodeExample" style="font-weight: bold;">public</span><span class="f_CodeExample">.crt # path to the server certificate file</span><br />
|
||||
<span class="f_CodeExample"> key: /path/to/</span><span class="f_CodeExample" style="font-weight: bold;">private</span><span class="f_CodeExample">.key # path to the private key file</span><br />
|
||||
<span class="f_CodeExample"> cacert: /path/to/certCA.pem # path to the root CA file</span><br />
|
||||
<span class="f_CodeExample"> hosts: postgres-server1.your_domain:2379,postgres-server2.your_domain:2379,postgres-server3.your_domain:2379 # list of all the nodes with installed etcd</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">ctl:</span><br />
|
||||
<span class="f_CodeExample"> insecure: </span><span class="f_CodeExample" style="font-weight: bold;">false</span><span class="f_CodeExample"> # Allow connections to SSL sites without certs</span><br />
|
||||
<span class="f_CodeExample"> certfile: /path/to/pg.crt # путь до файла сертификата сервера</span><br />
|
||||
<span class="f_CodeExample"> keyfile: /path/to/pg.key # путь до файла закрытого ключа</span><br />
|
||||
<span class="f_CodeExample"> cacert: /path/to/pgCA.pem # путь до файла корневого CA</span><br />
|
||||
<span class="f_CodeExample"> certfile: /path/to/pg.crt # path to the server certificate file</span><br />
|
||||
<span class="f_CodeExample"> keyfile: /path/to/pg.key # path to the private key file</span><br />
|
||||
<span class="f_CodeExample"> cacert: /path/to/pgCA.pem # path to the root CA file</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">bootstrap:</span><br />
|
||||
<span class="f_CodeExample"> method: initdb</span><br />
|
||||
@ -625,7 +623,7 @@
|
||||
<span class="f_CodeExample"> - locale: en_US.UTF-8</span><br />
|
||||
<span class="f_CodeExample"> - data-checksums</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # должен содержать адреса ВСЕХ машин, используемых в кластере</span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # must contain addresses of ALL the machines used in the cluster</span><br />
|
||||
<span class="f_CodeExample"> - local all postgres peer</span><br />
|
||||
<span class="f_CodeExample"> - local all all peer</span><br />
|
||||
<span class="f_CodeExample"> - hostssl all all 0.0.0.0/0 md5</span><br />
|
||||
@ -635,10 +633,10 @@
|
||||
<span class="f_CodeExample"> - hostssl replication replicator 192.168.1.3/32 md5</span><br />
|
||||
<span class="f_CodeExample"> </span><br />
|
||||
<span class="f_CodeExample">postgresql:</span><br />
|
||||
<span class="f_CodeExample"> listen: 192.168.1.1,127.0.0.1:5432 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> connect_address: 192.168.1.1:5432 # адрес узла, на котором находится этот файл</span><br />
|
||||
<span class="f_CodeExample"> listen: 192.168.1.1,127.0.0.1:5432 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> connect_address: 192.168.1.1:5432 # address of the node where the file is</span><br />
|
||||
<span class="f_CodeExample"> use_unix_socket: </span><span class="f_CodeExample" style="font-weight: bold;">true</span><br />
|
||||
<span class="f_CodeExample"> data_dir: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/postgresql/13/main # каталог данных</span><br />
|
||||
<span class="f_CodeExample"> data_dir: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/postgresql/13/main # data directory</span><br />
|
||||
<span class="f_CodeExample"> bin_dir: /usr/lib/postgresql/13/bin</span><br />
|
||||
<span class="f_CodeExample"> config_dir: /etc/postgresql/13/main</span><br />
|
||||
<span class="f_CodeExample"> pgpass: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/lib/postgresql/.pgpass_patroni</span><br />
|
||||
@ -646,18 +644,18 @@
|
||||
<span class="f_CodeExample"> replication:</span><br />
|
||||
<span class="f_CodeExample"> username: replicator</span><br />
|
||||
<span class="f_CodeExample"> password: ReplicatorPassword</span><br />
|
||||
<span class="f_CodeExample"> sslcert: /path/to/pg.crt # путь до файла сертификата сервера</span><br />
|
||||
<span class="f_CodeExample"> sslkey: /path/to/pg.key # путь до файла закрытого ключа</span><br />
|
||||
<span class="f_CodeExample"> sslrootcert: /path/to/pgCA.pem # путь до файла корневого CA</span><br />
|
||||
<span class="f_CodeExample"> sslcert: /path/to/pg.crt # path to the server certificate file</span><br />
|
||||
<span class="f_CodeExample"> sslkey: /path/to/pg.key # path to the private key file</span><br />
|
||||
<span class="f_CodeExample"> sslrootcert: /path/to/pgCA.pem # path to the root CA file</span><br />
|
||||
<span class="f_CodeExample"> superuser:</span><br />
|
||||
<span class="f_CodeExample"> username: postgres</span><br />
|
||||
<span class="f_CodeExample"> password: PostgresPassword</span><br />
|
||||
<span class="f_CodeExample"> sslcert: /path/to/pg.crt # путь до файла сертификата сервера</span><br />
|
||||
<span class="f_CodeExample"> sslkey: /path/to/pg.key # путь до файла закрытого ключа</span><br />
|
||||
<span class="f_CodeExample"> sslrootcert: /path/to/pgCA.pem # путь до файла корневого CA</span><br />
|
||||
<span class="f_CodeExample"> sslcert: /path/to/pg.crt # path to the server certificate file</span><br />
|
||||
<span class="f_CodeExample"> sslkey: /path/to/pg.key # path to the private key file</span><br />
|
||||
<span class="f_CodeExample"> sslrootcert: /path/to/pgCA.pem # path to the root CA file</span><br />
|
||||
<span class="f_CodeExample"> parameters:</span><br />
|
||||
<span class="f_CodeExample"> unix_socket_directories: /</span><span class="f_CodeExample" style="font-weight: bold;">var</span><span class="f_CodeExample">/run/postgresql</span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # должен содержать адреса ВСЕХ машин, используемых в кластере</span><br />
|
||||
<span class="f_CodeExample"> pg_hba: # must contain addresses of ALL the machines used in the cluster</span><br />
|
||||
<span class="f_CodeExample"> - local all postgres peer</span><br />
|
||||
<span class="f_CodeExample"> - local all all peer</span><br />
|
||||
<span class="f_CodeExample"> - hostssl all all 0.0.0.0/0 md5</span><br />
|
||||
@ -685,51 +683,50 @@
|
||||
<span class="f_CodeExample"> noloadbalance: </span><span class="f_CodeExample" style="font-weight: bold;">false</span><br />
|
||||
<span class="f_CodeExample"> clonefrom: </span><span class="f_CodeExample" style="font-weight: bold;">false</span><br />
|
||||
<span class="f_CodeExample"> nosync: </span><span class="f_CodeExample" style="font-weight: bold;">false</span></p>
|
||||
<p class="p_Normal">Сделайте пользователя postgres владельцем файла закрытого ключа <code><b>pg.key</b></code>:</p>
|
||||
<p class="p_Normal">Make the <span style="font-weight: bold;">postgres</span> user the owner of the private key file <code><b>pg.key</b></code>:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">Начало внимание</span></p>
|
||||
<p class="p_Normal">Файл закрытого ключа <code><b>pg.key</b></code> указанный в секции <code><b>postgresql</b></code> должен иметь разрешения u=rw (0600) или меньше, если он принадлежит пользователю базы данных postgres, или разрешения u=rw, g=r (0640) или меньше, если он принадлежит пользователю root.</p>
|
||||
<p class="p_Normal">The private key file <code><b>pg.key</b></code> specified in the section <code><b>postgresql</b></code> must have permissions of u=rw (0600) or less if it belongs to the PostgreSQL database user, or permissions of u=rw, g=r (0640) or less if it belongs to the root .</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">Конец внимание</span></p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo chown postgres:postgres -R /path/to/pg.key</span><br />
|
||||
<span class="f_CodeExample">sudo chmod 600 /path/to/pg.key</span></p>
|
||||
<p class="p_Normal">Подробнее о настройке TLS/SSL в Patroni читайте в <a href="https://patroni.readthedocs.io/en/latest/yaml_configuration.html" target="_blank" class="weblink">официальной документации Patroni</a>.</p>
|
||||
<p class="p_Normal">For more details on TLS/SSL configuration in Patroni, refer to the <a href="https://patroni.readthedocs.io/en/latest/yaml_configuration.html" target="_blank" class="weblink">official Patroni documentation</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<ol style="list-style-type:upper-roman" start="3">
|
||||
<li value="3" class="p_Normal">Сделайте пользователя <span style="font-weight: bold;">postgres</span> владельцем каталога настроек:</li></ol>
|
||||
<li value="3" class="p_Normal">Make the <span style="font-weight: bold;">postgres</span> user the owner of the configuration directory:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo chown postgres:postgres -R /etc/patroni</span><br />
|
||||
<span class="f_CodeExample">sudo chmod 700 /etc/patroni</span></p>
|
||||
<h2 class="p_Heading2"><a id="preparation-postgresql-patroni" class="hmanchor"></a><span class="f_Heading2">Шаг 7. Подготовка кластера PostgreSQL+Patroni</span></h2>
|
||||
<h2 class="p_Heading2"><a id="preparation-postgresql-patroni" class="hmanchor"></a><span class="f_Heading2">Step 7: Prepare PostgreSQL+Patroni cluster</span></h2>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal">Запустите службу Patroni на узле <span style="font-weight: bold;">postgres-server1.your_domain</span>, а затем на узлах <span style="font-weight: bold;">postgres-server2.your_domain</span> и <span style="font-weight: bold;">postgres-server3.your_domain</span>:</li></ol>
|
||||
<li value="1" class="p_Normal">Start the Patroni service on the <span style="font-weight: bold;">postgres-server1.your_domain</span> node, and then on the nodes <span style="font-weight: bold;">postgres-server2.your_domain</span> and <span style="font-weight: bold;">postgres-server3.your_domain</span>:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">sudo systemctl enable --now patroni.service</span></p>
|
||||
<ol style="list-style-type:upper-roman" start="2">
|
||||
<li value="2" class="p_Normal">Проверьте состояние кластера:</li></ol>
|
||||
<li value="2" class="p_Normal">Check the cluster status:</li></ol>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">patronictl -c /etc/patroni/config.yml list</span></p>
|
||||
<h2 class="p_Heading2"><a id="prepare-pgbouncer" class="hmanchor"></a><span class="f_Heading2">Шаг 8. Подготовка PGBouncer (опционально)</span></h2>
|
||||
<p class="p_Normal">PGBouncer предназначен для управления пулом соединений к PostgreSQL и позволяет минимизировать издержки, связанные с установлением новых подключений к PostgreSQL.</p>
|
||||
<p class="p_Normal">Про установку и настройку PGBouncer читайте в статье <a href="pgbouncer-installation.html" class="topiclink">«Установка PGBouncer»</a>.</p>
|
||||
<h2 class="p_Heading2"><a id="haproxy-configuration" class="hmanchor"></a><span class="f_Heading2">Шаг 9. Конфигурация HAProxy (блок postgres)</span></h2>
|
||||
<p class="p_Normal">Настройте «<a href="fail-safe-haproxy.html" class="topiclink">Отказоустойчивый HAProxy</a>» для приёма запросов к PostgreSQL и балансировку нагрузки между нодами кластера PostgreSQL. Подробнее об этом читайте в статье <a href="haproxy-postgresql.html" class="topiclink">«Конфигурация HAProxy для PostgreSQL»</a>.</p>
|
||||
<h2 class="p_Heading2"><a id="connecting-to-postgresql" class="hmanchor"></a><span class="f_Heading2">Шаг 10. Подключение к PostgreSQL</span></h2>
|
||||
<p class="p_Normal">Строка для подключения к кластеру PostgreSQL:</p>
|
||||
<h2 class="p_Heading2"><a id="prepare-pgbouncer" class="hmanchor"></a><span class="f_Heading2">Step 8: Prepare PGBouncer (optional)</span></h2>
|
||||
<p class="p_Normal">PGBouncer is designed to manage a connection pool to PostgreSQL, minimizing the overhead associated with establishing new connections to PostgreSQL. For information on installing and configuring PGBouncer, refer to <a href="pgbouncer-installation.html" class="topiclink">Install PGBouncer</a>.</p>
|
||||
<h2 class="p_Heading2"><a id="haproxy-configuration" class="hmanchor"></a><span class="f_Heading2">Step 9: Configure HAProxy (postgres block)</span></h2>
|
||||
<p class="p_Normal">Configure a <a href="fail-safe-haproxy.html" class="topiclink">high availablility HAProxy</a> to handle requests to PostgreSQL and load balance between the nodes of the PostgreSQL cluster. For more details, refer to <a href="haproxy-postgresql.html" class="topiclink">Configure HAProxy for PostgreSQL</a>.</p>
|
||||
<h2 class="p_Heading2"><a id="connecting-to-postgresql" class="hmanchor"></a><span class="f_Heading2">Step 10: Connecto to PostgreSQL</span></h2>
|
||||
<p class="p_Normal">Connection string to connect to the PostgreSQL cluster:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">psqlUrl: postgresql:</span><span class="f_CodeExample">//elma365:SecretPassword@haproxy-server.your_domain:5000/elma365?sslmode=disable</span></p>
|
||||
<p class="p_Normal">Строка для подключения к кластеру Postgres только для чтения:</p>
|
||||
<p class="p_Normal">Connection string to connect to the PostgreSQL cluster for read-only access:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">psqlUrl: postgresql:</span><span class="f_CodeExample">//elma365:SecretPassword@haproxy-server.your_domain:5001/elma365?sslmode=disable</span></p>
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A6')">Подключение к кластеру PostgreSQL с TLS/SSL</a></p>
|
||||
<div id="TOGGLE0186A6" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<p class="p_Normal"><a class="dropdown-toggle" style="font-style: normal; font-weight: normal; color: #000000; background-color: transparent; text-decoration: none;" href="javascript:HMToggle('toggle','TOGGLE0186A6')">Connecting to the PostgreSQL cluster with TLS/SSL</a></p>
|
||||
<div id="TOGGLE0186A6" class="dropdown-toggle-body" style="text-align: left; text-indent: 0; line-height: 1.80; padding: 0 0 0 0; margin: 0 0 0 0;"><table style="border:none; border-spacing:0;">
|
||||
<tr>
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_Normal">Строка для подключения к кластеру PostgreSQL с TLS/SSL:</p>
|
||||
<td style="vertical-align:top; padding:0; border:none"><p class="p_Normal">Connection string to connect to the PostgreSQL cluster with TLS/SS:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">psqlUrl: postgresql:</span><span class="f_CodeExample">//elma365:SecretPassword@haproxy-server.your_domain:5000/elma365?sslmode=require</span></p>
|
||||
<p class="p_Normal">Строка для подключения к кластеру PostgreSQL с TLS/SSL только для чтения:</p>
|
||||
<p class="p_Normal">Connection string to connect to the PostgreSQL cluster with TLS/SSL for read-only access:</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">psqlUrl: postgresql:</span><span class="f_CodeExample">//elma365:SecretPassword@haproxy-server.your_domain:5001/elma365?sslmode=require</span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<h2 class="p_Heading2"><span class="f_Heading2">Подготовка базы данных в PostgreSQL к восстановлению</span></h2>
|
||||
<p class="p_Normal">Если вам потребовалось восстановить базу данных из резервной копии, сначала подготовьте БД к восстановлению. Подробнее об этом читайте в статье <a href="postgresql.html#prepare-to-recovery" class="topiclink">«PostgreSQL»</a>.</p>
|
||||
<h2 class="p_Heading2"><span class="f_Heading2">Prepare a PostgreSQL database for restoration</span></h2>
|
||||
<p class="p_Normal">If you need to restore a database from backup, first prepare the database for restoration. For more details, refer to the article <a href="postgresql.html#prepare-to-restore" class="topiclink">PostgreSQL</a>.</p>
|
||||
|
||||
<div class="bottom-nav">
|
||||
|
||||
@ -746,7 +743,7 @@
|
||||
|
||||
</div>
|
||||
<!-- добавляет на страницу строку блок Была ли статья полезной? -->
|
||||
<div class="feedback-wrap"><div class="feedback" id="feedback"><span><b>Была ли статья полезной?</b></span><form action="" method="POST" class="feedback-form" id="feedback-form"><div class="feedback__popup feedback__popup-response" id="feedback__popup_thx">Спасибо за ваш отзыв!</div><div id="feedback-success-popup"><div class="wrap"><button type="button" class="feedback-popup-close">×</button><svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_212_2187)"><path d="M22 0.6875C10.2294 0.6875 0.6875 10.2294 0.6875 22C0.6875 33.7706 10.2294 43.3125 22 43.3125C33.7706 43.3125 43.3125 33.7706 43.3125 22C43.3125 10.2294 33.7706 0.6875 22 0.6875ZM22 40.5625C11.8023 40.5625 3.4375 32.3078 3.4375 22C3.4375 11.8024 11.6922 3.4375 22 3.4375C32.1977 3.4375 40.5625 11.6922 40.5625 22C40.5625 32.1976 32.3078 40.5625 22 40.5625ZM34.1713 16.933L18.6613 32.3186C18.257 32.7197 17.604 32.7171 17.203 32.3128L9.82283 24.873C9.42176 24.4686 9.42434 23.8157 9.82867 23.4146L10.5609 22.6884C10.9652 22.2873 11.6181 22.2899 12.0192 22.6942L17.9468 28.6697L31.9926 14.7366C32.3969 14.3356 33.0498 14.3382 33.4509 14.7425L34.1772 15.4747C34.5783 15.879 34.5757 16.532 34.1713 16.933Z" fill="#27AE60"></path></g><defs><clipPath id="clip0_212_2187"><rect width="44" height="44" fill="white"></rect></clipPath></defs></svg><p>Ваш отзыв успешно отправлен!</p><span>Спасибо за обратную связь.</span></div></div><div class="feedback__popup" id="feedback__popup_why"><button type="button" class="feedback-popup-close">×</button><div class="feedback__popup-header">Уточните, почему:</div><input type="radio" name="category" id="bad_recommendation" value="bad_recommendation"><label for="bad_recommendation">Рекомендации не помогли</label><input type="radio" name="category" id="difficult_text" value="difficult_text"><label for="difficult_text">Текст трудно понять</label><input type="radio" name="category" id="no_answer" value="no_answer"><label for="no_answer">Нет ответа на мой вопрос</label><input type="radio" name="category" id="bad_header" value="bad_header"><label for="bad_header">Содержание статьи не соответствует заголовку</label><input type="radio" name="category" id="other_reason" value="other_reason"><label for="other_reason">Другая причина</label></div><div class="feedback__popup" id="feedback__popup-other"><button type="button" class="feedback-popup-close">×</button> <div class="feedback__popup-header">Расскажите, что вам не понравилось в статье:</div><textarea class="feedback__textarea" name="other" id=""></textarea><input type="submit" class="feedback__other-btn" value="Отправить"></div><div class="feedback-form__btn-group"><input type="radio" name="useful" id="feedback__useful_yes" value="true"><label for="feedback__useful_yes"><img src="like.svg"/><span class="feedback-form__btn-group_yes-btn">Да</span></label><input type="radio" name="useful" id="feedback__useful_no" value="false"><label for="feedback__useful_no"><img src="dislike.svg"/><span class="feedback-form__btn-group_no-btn">Нет</span></label></div><select name="category"><option disabled>Выберите вариант</option><option value="bad_recommendation" selected>Рекомендации не помогли</option><option value="difficult_text">Текст трудно понять</option><option value="no_answer">Нет ответа на мой вопрос</option><option value="bad_header">Содержание статьи не соответствует заголовку</option><option value="other_reason">Другая причина</option></select><input type="submit"></form></div></div>
|
||||
<div class="feedback" id="feedback"><div class="feedback-help"><span><b>Was this helpful?</b></span><form action="" method="POST" class="feedback-form" id="feedback-form"><div class="feedback__popup feedback__popup-response" id="feedback__popup_thx" style="display: none;">Thanks for your feedback!</div><div class="feedback__popup" id="feedback__popup_why" style="display: none;"><div class="feedback__popup-header">Please specify why:</div><input type="radio" name="category" id="bad_recommendation" value="bad_recommendation"><label for="bad_recommendation">Recommendations did not help me</label><input type="radio" name="category" id="difficult_text" value="difficult_text"><label for="difficult_text">Article is hard to understand</label><input type="radio" name="category" id="no_answer" value="no_answer"><label for="no_answer">Didn`t answer my question</label><input type="radio" name="category" id="bad_header" value="bad_header"><label for="bad_header">Content does not match the topic</label><input type="radio" name="category" id="other_reason" value="other_reason"><label for="other_reason">Other</label></div><div class="feedback__popup" id="feedback__popup-other" style="display: none;"><div class="feedback__popup-header">How we can improve it?</div><textarea class="feedback__textarea" name="other" id=""></textarea><input type="submit" class="feedback__other-btn" value="Submit"></div><div class="feedback-form__btn-group"><input type="radio" name="useful" id="feedback__useful_yes" value="true"><label for="feedback__useful_yes"><img src="like.svg" class="small-img" alt="like"><spanclass="feedback-form__btn-group_yes-btn">Yes</spanclass="feedback-form__btn-group_yes-btn"></label><input type="radio" name="useful" id="feedback__useful_no" value="false"><label for="feedback__useful_no"><img src="dislike.svg" class="small-img" alt="dislike"><spanclass="feedback-form__btn-group_no-btn">No</spanclass="feedback-form__btn-group_no-btn"></label></div><select name="category"><option disabled="">Please specify why</option><option value="bad_recommendation" selected="">Recommendations did not help me</option><option value="difficult_text">Article is hard to understand</option><option value="no_answer">Didn`t answer my question</option><option value="bad_header">Content does not match the topic</option><option value="other_reason">Other</option></select><input type="submit"></form></div><div class="found_typo"><p style="margin: 0px; margin-top: 16px !important;"><span><b>Found a typo?</b></span> Select it and press <i>Ctrl+Enter</i> to send us feedback</p></div></div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
@ -754,7 +751,7 @@
|
||||
<input type="checkbox" />
|
||||
<div class="article__arrow"></div>
|
||||
<div class="table-of-contents elma365-right" id="toc2Content">
|
||||
<h3 class="h3-toc">В этой статье</h3>
|
||||
<h3 class="h3-toc">In this topic</h3>
|
||||
<nav id="toc2"></nav>
|
||||
</div>
|
||||
</aside>
|
||||
@ -765,63 +762,30 @@
|
||||
<div class="footer-container">
|
||||
<div class="footer-mobile">
|
||||
|
||||
<ul class="footer-mobile__list"><li><a href="https://api.elma365.com/ru/" target="_blank">API</a></li><li><a href="https://tssdk.elma365.com/" target="_blank">TS SDK</a></li><li><a href="https://community.elma365.com/" target="_blank">Community</a></li><li><a href="https://elma-academy.com/ru/elma365" target="_blank">Академия</a></li></ul><ul class="footer-mobile__list"><li><a href="https://elma365.com/ru/help/platform/get-trial.html">Платформа</a></li><li><a href="https://elma365.com/ru/help/ecm/ecm-functions.html">ECM</a></li><li><a href="https://elma365.com/ru/help/service/service-functions.html">Service</a></li><li><a href="https://elma365.com/ru/help/projects/projects-functions.html">Проекты</a></li></ul>
|
||||
<ul class="footer-mobile__list"><li><a href="https://brix365.com/en/" target="_blank">BRIX</a></li><li><a href="https://tssdk.brix365.com/en/latest/" target="_blank">SDK</a></li><li><a href="https://api.brix365.com/en/" target="_blank">API</a></li></ul><ul class="footer-mobile__list"><li><a href="https://brix365.com/en/help/platform/get-trial.html">Platform</a></li><li><a href="https://brix365.com/en/help/ecm/ecm-functions.html">ECM</a></li><li><a href="https://brix365.com/en/help/service/service-functions.html">Service</a></li><li><a href="https://brix365.com/en/help/projects/projects-functions.html">Projects</a></li></ul>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="footer-wrap">
|
||||
|
||||
<div><span class="mobile-question-popup">Отправить фидбэк</span><form method="POST" action class="question__popup question-xs" id="question__popup"><div class="question-wrap"><span class="close"></span><span class="title">Задать вопрос</span><label for="help_question" style="display: none;"></label><textarea name="help_question" id="help_question"></textarea><input type="submit" value="Отправить"></div></form><div class="hidden fade-in question-success-xs">Ваш фидбэк отправлен.</div></div>
|
||||
|
||||
<div class="footer-flex-b">
|
||||
<div class="footer-top">
|
||||
<span class="footer-copy">© 2025
|
||||
ELMA365
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
<a href="https://navigator.sk.ru/orn/1122971" target="_blank">
|
||||
<img src="sk-resident.svg" alt="sk icon" class="footer-img" width="117" height="34">
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="footer-line">
|
||||
|
||||
<div class="footer-line-copy">
|
||||
<span class="footer-copy">© 2025
|
||||
ELMA365
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul class="footer-list">
|
||||
|
||||
<li class="footer-item"><a href="https://elma365.com/ru/" target="_blank" class="footer-link" style="color: #0D4A75;"><img src="browse.svg" alt="browse icon" class="footer-img">elma365.com</a></li><li class="footer-item"><a href="https://www.youtube.com/user/ELMABPM" target="_blank" class="footer-link"><img src="yt.svg" alt="youtube icon" class="footer-img"></a></li><li class="footer-item"><a href="https://vk.com/elma_bpm" target="_blank" class="footer-link"><img src="vk.svg" alt="vk icon" class="footer-img"></a></li><li class="footer-item"><a href="https://t.me/elmaday" target="_blank" class="footer-link"><img src="tg.svg" alt="telegram icon" class="footer-img"></a></li><li class="footer-item"><a href="https://dzen.ru/elma" target="_blank" class="footer-link"><img src="dzen.svg" alt="dzen icon" class="footer-img"></a></li>
|
||||
|
||||
|
||||
<li class="footer-item">
|
||||
<a href="https://navigator.sk.ru/orn/1122971" target="_blank">
|
||||
<img src="sk-resident.svg" alt="sk icon" class="footer-img" width="117" height="34">
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-wrap">
|
||||
|
||||
<div><span class="mobile-question-popup">Send feedback</span><form method="POST" action class="question__popup question-xs" id="question__popup"><div class="question-wrap"><span class="close"></span><span class="title">Ask a question</span><label for="help_question" style="display: none;"></label><textarea name="help_question" id="help_question"></textarea><input type="submit" value="Send"></div></form><div class="hidden fade-in question-success-xs">Sent</div></div>
|
||||
|
||||
<div class="footer-flex-b">
|
||||
<span class="footer-copy">© 2025 BRIX</span>
|
||||
<ul class="footer-list">
|
||||
|
||||
<li class="footer-item">
|
||||
<a href="#" class="arrow-top" style="display: block;"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="arrow-top"></a>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
<!-- <script type="text/javascript" src="jquery1.min.js"></script>-->
|
||||
<iframe name="hmnavigation" style="display:none!important"></iframe>
|
||||
<!--<script src="./jquery-ui.js"></script> -->
|
||||
<script src="./jquery-ui.min.js"></script>
|
||||
<script src="./jquery-ui.js"></script>
|
||||
<!--script src="//cdn.jsdelivr.net/npm/featherlight@1.7.14/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script-->
|
||||
<script src="./jquery.tocify.min.js"></script>
|
||||
<script src="./TypoReporter.min.js"></script>
|
||||
|
Reference in New Issue
Block a user