{"id":296548,"date":"2019-12-28T15:00:16","date_gmt":"2019-12-28T15:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296548"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296548","title":{"rendered":"\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 PostgreSQL \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Patroni, etcd, HAProxy"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482314\/\">\n<p>\u0422\u0430\u043a \u0443\u0436 \u0432\u044b\u0448\u043b\u043e, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u043e\u043f\u044b\u0442\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0443. \u0418 \u0442\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0433\u0443\u0433\u043b\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e, \u0432 \u0447\u0435\u043c \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430, \u043d\u043e \u0443\u0436\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437 \u044f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u043a\u0430\u043a \u0432 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 enviroment \u043a\u0430\u043a \u0443 \u0430\u0432\u0442\u043e\u0440\u0430, \u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u043d\u044f\u0442\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u044e, \u0432 \u0447\u0435\u043c \u0442\u0443\u0442 \u0434\u0435\u043b\u043e, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437, \u044f \u0440\u0435\u0448\u0438\u043b \u2014 \u0430 \u043d\u0430\u043f\u0438\u0448\u0443-\u043a\u0430 \u044f \u0441\u0432\u043e\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u0422\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"gaydy-v-internete\">\u0413\u0430\u0439\u0434\u044b \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435<\/h2>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0443\u0436 \u0432\u044b\u0448\u043b\u043e, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0433\u0430\u0439\u0434\u043e\u0432, \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u0432, step-by-step \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439. \u0422\u0430\u043a \u0443\u0436 \u0432\u044b\u0448\u043b\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 PostgreSQL, \u0433\u043b\u0430\u0432\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441 Master-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0432\u0441\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0432\u043e\u0434 \u0440\u0435\u0437\u0435\u0440\u0432\u0430 \u043f\u0440\u0438 \u043e\u0442\u043a\u0430\u0437\u0435 Master-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0431\u044b\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0441\u0442\u0435\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li>PostgreSQL \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0421\u0423\u0411\u0414<\/li>\n<li><a href=\"https:\/\/github.com\/zalando\/patroni\">Patroni<\/a> \u0432 \u043a\u0430\u0447\u0435\u0442\u0441\u0432\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/li>\n<li>etcd \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u043b\u044f Patroni<\/li>\n<li>HAproxy \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0434\u0438\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0431\u0430\u0437\u0443<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"ustanovka\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u0412\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u2014 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 PostgreSQL \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Patroni, etcd, HAProxy.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u041e\u0421 Debian 10.<\/p>\n<p>  <\/p>\n<h3 id=\"etcd\">etcd<\/h3>\n<p>  <\/p>\n<p>\u041d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c etcd \u043d\u0430 \u0442\u0435\u0445 \u0436\u0435 \u043c\u0430\u0448\u0438\u043d\u0430\u0445, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f patroni \u0438 postgresql, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f etcd \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0438. \u041d\u043e \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043c\u044b \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a.<br \/>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c etcd.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash apt-get update apt-get install etcd<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0444\u0430\u0439\u043b \/etc\/default\/etcd<\/b><\/p>\n<div class=\"spoiler_text\">\n<h1 id=\"member\">[member]<\/h1>\n<p>  <\/p>\n<p>ETCD_NAME=datanode1 # hostname \u0432\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b<br \/>  ETCD_DATA_DIR=&quot;\/var\/lib\/etcd\/default.etcd&quot;<\/p>\n<p>  <\/p>\n<h1 id=\"all-ip-adresses-should-be-valid-lister-peer-client-etc-should-be-set-to-ip-address-of-host\">ALL IP ADRESSES SHOULD BE VALID. LISTER PEER, CLIENT etc SHOULD BE SET TO IP ADDRESS OF HOST<\/h1>\n<p>  <\/p>\n<p>ETCD_LISTEN_PEER_URLS=&quot;<a href=\"http:\/\/192.168.0.143:2380\">http:\/\/192.168.0.143:2380<\/a>&quot; # \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b<br \/>  ETCD_LISTEN_CLIENT_URLS=&quot;<a href=\"http:\/\/192.168.0.143:2379,http:\/\/127.0.0.1:2379\">http:\/\/192.168.0.143:2379,http:\/\/127.0.0.1:2379<\/a>&quot; # \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b<\/p>\n<p>  <\/p>\n<h1 id=\"cluster\">[cluster]<\/h1>\n<p>  <\/p>\n<p>ETCD_INITIAL_ADVERTISE_PEER_URLS=&quot;<a href=\"http:\/\/192.168.0.143:2380\">http:\/\/192.168.0.143:2380<\/a>&quot; # \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b<br \/>  ETCD_INITIAL_CLUSTER=&quot;datanode1=<a href=\"http:\/\/192.168.0.143:2380,datanode2=http:\/\/192.168.0.144:2380,datanode3=http:\/\/192.168.0.145:2380\">http:\/\/192.168.0.143:2380,datanode2=http:\/\/192.168.0.144:2380,datanode3=http:\/\/192.168.0.145:2380<\/a>&quot; # \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0441\u0435\u0445 \u043c\u0430\u0448\u0438\u043d \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 etcd<br \/>  ETCD_INITIAL_CLUSTER_STATE=&quot;new&quot;<br \/>  ETCD_INITIAL_CLUSTER_TOKEN=&quot;etcd-cluster-1&quot;<br \/>  ETCD_ADVERTISE_CLIENT_URLS=&quot;<a href=\"http:\/\/192.168.0.143:2379\">http:\/\/192.168.0.143:2379<\/a>&quot; # \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">systemctl restart etcd<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"postgresql-96--patroni\">PostgreSQL 9.6 + patroni<\/h3>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u043d\u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u041f\u041e. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u0430\u0448\u0438\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0435 \u043c\u043e\u0435\u043c\u0443 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 (\u043f\u043e\u0447\u0442\u0438) \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u0432\u0430\u0441. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0437-\u043f\u043e\u0434 root.<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u044e PostgreSQL 9.6, \u044d\u0442\u043e \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 PostgreSQL.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash apt-get install gnupg -y echo &quot;deb http:\/\/apt.postgresql.org\/pub\/repos\/apt\/ buster-pgdg main&quot; &gt;&gt; \/etc\/apt\/sources.list wget --quiet -O - https:\/\/www.postgresql.org\/media\/keys\/ACCC4CF8.asc | apt-key add - apt-get update apt-get install postgresql-9.6 python3-pip python3-dev libpq-dev -y systemctl stop postgresql pip3 install --upgrade pip pip install psycopg2 pip install patroni[etcd] echo &quot;\\ [Unit] Description=Runners to orchestrate a high-availability PostgreSQL After=syslog.target network.target  [Service] Type=simple  User=postgres Group=postgres  ExecStart=\/usr\/local\/bin\/patroni \/etc\/patroni.yml  KillMode=process  TimeoutSec=30  Restart=no  [Install] WantedBy=multi-user.targ\\ &quot; &gt; \/etc\/systemd\/system\/patroni.service mkdir -p \/data\/patroni chown postgres:postgres \/data\/patroni chmod 700 \/data\/patroni\u043f\u043e touch \/etc\/patroni.yml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0444\u0430\u0439\u043b \/etc\/patroni.yml \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0432 ip-\u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u043e \u0432\u0441\u0435\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u044b.<br \/>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c yaml. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430 \u0441\u0432\u043e\u0438, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/patroni.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">scope: pgsql # \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043d\u0430 \u0432\u0441\u0435\u0445 \u043d\u043e\u0434\u0430\u0445 namespace: \/cluster\/ # \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043d\u0430 \u0432\u0441\u0435\u0445 \u043d\u043e\u0434\u0430\u0445 name: postgres1 # \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c \u043d\u0430 \u0432\u0441\u0435\u0445 \u043d\u043e\u0434\u0430\u0445  restapi:     listen: 192.168.0.143:8008 # \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0439 \u043d\u043e\u0434\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b     connect_address: 192.168.0.143:8008 # \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0439 \u043d\u043e\u0434\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b  etcd:     hosts: 192.168.0.143:2379,192.168.0.144:2379,192.168.0.145:2379 # \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u043d\u043e\u0434\u044b, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 etcd \u043d\u0430 \u043d\u0438\u0445 \u0436\u0435  # this section (bootstrap) will be written into Etcd:\/&lt;namespace&gt;\/&lt;scope&gt;\/config after initializing new cluster # and all other cluster members will use it as a `global configuration` bootstrap:     dcs:         ttl: 100         loop_wait: 10         retry_timeout: 10         maximum_lag_on_failover: 1048576         postgresql:             use_pg_rewind: true             use_slots: true             parameters:                     wal_level: replica                     hot_standby: &quot;on&quot;                     wal_keep_segments: 5120                     max_wal_senders: 5                     max_replication_slots: 5                     checkpoint_timeout: 30      initdb:     - encoding: UTF8     - data-checksums     - locale: en_US.UTF8     # init pg_hba.conf \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0412\u0421\u0415\u0425 \u043c\u0430\u0448\u0438\u043d, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435     pg_hba:     - host replication postgres ::1\/128 md5     - host replication postgres 127.0.0.1\/8 md5     - host replication postgres 192.168.0.143\/24 md5     - host replication postgres 192.168.0.144\/24 md5     - host replication postgres 192.168.0.145\/24 md5     - host all all 0.0.0.0\/0 md5      users:         admin:             password: admin             options:                 - createrole                 - createdb  postgresql:     listen: 192.168.0.143:5432 # \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0439 \u043d\u043e\u0434\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b     connect_address: 192.168.0.143:5432 # \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0439 \u043d\u043e\u0434\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b     data_dir: \/data\/patroni # \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0441\u043a\u0440\u0438\u043f\u0442, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430     bin_dir:  \/usr\/lib\/postgresql\/9.6\/bin # \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0443\u0442\u044c \u0434\u043e \u0432\u0430\u0448\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 postgresql     pgpass: \/tmp\/pgpass     authentication:         replication:             username: postgres             password: postgres         superuser:             username: postgres             password: postgres     create_replica_methods:         basebackup:             checkpoint: 'fast'     parameters:         unix_socket_directories: '.'  tags:     nofailover: false     noloadbalance: false     clonefrom: false     nosync: false<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0444\u0430\u0439\u043b \/etc\/patroni.yml \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">systemctl start patroni systemctl start postgresql<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435 \u043e\u043a\u043e\u043b\u043e 30 \u0441\u0435\u043a\u0443\u043d\u0434, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"haproxy\">HAproxy<\/h3>\n<p>  <\/p>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0447\u0443\u0434\u0435\u0441\u043d\u044b\u0439 HAproxy \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0434\u0438\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430. Master-\u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u043c\u0430\u0448\u0438\u043d\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 HAproxy.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u0443 \u0441 HAproxy \u0435\u0434\u0438\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043e\u0442\u043a\u0430\u0437\u0430, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 Docker, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 K8&#8217;s \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0448 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0433\u0434\u0435 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u2014 Dockerfile \u0438 haproxy.cfg. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Dockerfile<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">FROM ubuntu:latest  RUN apt-get update \\     &amp;&amp; apt-get install -y haproxy rsyslog \\     &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*  RUN mkdir \/run\/haproxy  COPY haproxy.cfg \/etc\/haproxy\/haproxy.cfg  CMD haproxy -f \/etc\/haproxy\/haproxy.cfg &amp;&amp; tail -F \/var\/log\/haproxy.log<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u044c\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b, \u0432 \u0442\u0440\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0444\u0430\u0439\u043b\u0430 haproxy.cfg \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0430\u0448\u0438\u0445 \u043c\u0430\u0448\u0438\u043d. HAproxy \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a Patroni, \u0432 HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 master-\u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c 200, \u0430 replica \u2014 503.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">haproxy.cfg<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">global     maxconn 100  defaults     log global     mode tcp     retries 2     timeout client 30m     timeout connect 4s     timeout server 30m     timeout check 5s  listen stats     mode http     bind *:7000     stats enable     stats uri \/  listen postgres     bind *:5000     option httpchk     http-check expect status 200     default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions     server postgresql1 192.168.0.143:5432 maxconn 100 check port 8008     server postgresql2 192.168.0.144:5432 maxconn 100 check port 8008     server postgresql3 192.168.0.145:5432 maxconn 100 check port 8008 <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 &quot;\u043b\u0435\u0436\u0430\u0442&quot; \u043e\u0431\u0430 \u043d\u0430\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u0441 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">docker build -t my-haproxy . docker run -d -p5000:5000 -p7000:7000 my-haproxy <\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043e\u0442\u043a\u0440\u044b\u0432 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 HAproxy \u0438 \u0443\u043a\u0430\u0437\u0430\u0432 \u043f\u043e\u0440\u0442 7000, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 UP \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 DOWN. \u042d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 503 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 HAproxy. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  <\/p>\n<h3 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0412\u044b \u0432\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b! \u0412\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0437\u0430 30 \u043c\u0438\u043d\u0443\u0442 \u0432\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0439 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0432\u0432\u043e\u0434\u043e\u043c \u0440\u0435\u0437\u0435\u0440\u0432\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c <a href=\"https:\/\/patroni.readthedocs.io\/en\/latest\/\">\u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 Patroni<\/a>, \u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441 \u0435\u0435 \u0447\u0430\u0441\u0442\u044c\u044e, \u043a\u0430\u0441\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b patronictl, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0432\u0430\u0448\u0438\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e!<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <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\/482314\/\"> https:\/\/habr.com\/ru\/post\/482314\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482314\/\">\n<p>\u0422\u0430\u043a \u0443\u0436 \u0432\u044b\u0448\u043b\u043e, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u043e\u043f\u044b\u0442\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0443. \u0418 \u0442\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0433\u0443\u0433\u043b\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e, \u0432 \u0447\u0435\u043c \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430, \u043d\u043e \u0443\u0436\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437 \u044f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u043a\u0430\u043a \u0432 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 enviroment \u043a\u0430\u043a \u0443 \u0430\u0432\u0442\u043e\u0440\u0430, \u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u043d\u044f\u0442\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u044e, \u0432 \u0447\u0435\u043c \u0442\u0443\u0442 \u0434\u0435\u043b\u043e, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437, \u044f \u0440\u0435\u0448\u0438\u043b \u2014 \u0430 \u043d\u0430\u043f\u0438\u0448\u0443-\u043a\u0430 \u044f \u0441\u0432\u043e\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u0422\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\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-296548","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296548","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=296548"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296548\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}