{"id":305881,"date":"2020-06-25T09:00:40","date_gmt":"2020-06-25T09:00:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305881"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305881","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HAProxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Data Plane Service Mesh \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508132\/\">\n<h1 id=\"ispolzovanie-haproxy-v-kachestve-data-plane-service-mesh-v-arhitekture-mikroservisov\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HAProxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Data Plane Service Mesh \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/h1>\n<p>  <\/p>\n<p>HAProxy Data Plane API \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 HAProxy, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 HAProxy \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u044f\u0434 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041b\u0443\u0447\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HAProxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Data Plane Service Mesh \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0433\u0434\u0435 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 sidecar.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Data Plane API \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0421\u043c. \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/www.haproxy.com\/documentation\/dataplaneapi\/latest\/\" rel=\"nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 API<\/a> \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"trebovaniya\">\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<ul>\n<li>\n<p>HAProxy Community 1.9 \u0438\u043b\u0438 \u043d\u043e\u0432\u0435\u0435 (2.0 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Process Manager)<\/p>\n<p>  <\/li>\n<li>\n<p>HAProxy Enterprise 1.9 \u0438\u043b\u0438 \u043d\u043e\u0432\u0435\u0435<\/p>\n<p>  <\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0447\u0438\u0435 \u0437\u043d\u0430\u043d\u0438\u044f HTTP \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 REST API<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"ustanovka-data-plane-api\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Data Plane API<\/h2>\n<p>  <\/p>\n<h3 id=\"ustanovite-data-plane-api-vmeste-s-haproxy-enterprise\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Data Plane API \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 HAProxy Enterprise<\/h3>\n<p>  <\/p>\n<p>Data Plane API \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e apt \u0438\u043b\u0438 yum.<\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Ubuntu 18.04.<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 HAProxy \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c haproxy_key \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043a\u043b\u044e\u0447 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f HAProxy apt:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ haproxy_key=[YOUR KEY] $ curl -fsSL https:\/\/www.haproxy.com\/download\/hapee\/key\/$haproxy_key-common\/HAPEE-key-1.9r1.asc | sudo apt-key add -<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 add-apt-repository, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo add-apt-repository &quot;deb [arch=amd64] https:\/\/www.haproxy.com\/download\/hapee\/key\/${haproxy_key}-common\/1.9r1\/ubuntu-18.04\/amd64\/ bionic main&quot; $ sudo add-apt-repository &quot;deb [arch=amd64] https:\/\/www.haproxy.com\/download\/hapee\/key\/${haproxy_key}-plus\/1.9r1\/ubuntu-18.04\/amd64\/ bionic main&quot; $ sudo add-apt-repository &quot;deb [arch=amd64] https:\/\/www.haproxy.com\/download\/hapee\/key\/${haproxy_key}-plus\/extras\/ubuntu-18.04\/amd64\/ bionic main&quot;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442 Data Plane API \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo apt install hapee-extras-dataplane-api<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e \u043f\u0443\u0442\u0438: \/opt\/hapee-extras\/sbin\/hapee-dataplane-api.<\/p>\n<p>  <\/p>\n<h3 id=\"ustanovite-data-plane-api-s-haproxy-community\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Data Plane API \u0441 HAProxy Community<\/h3>\n<p>  <\/p>\n<p>Data Plane API \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441 Github.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043f\u0443\u0442\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ chmod +x dataplaneapi $ sudo cp dataplaneapi \/usr\/local\/bin\/<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"nastroyka-dostupa-k-haproxy\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a HAProxy<\/h3>\n<p>  <\/p>\n<p>Data Plane API \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b, \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043f\u0430\u0440\u043e\u043b\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 HAProxy \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 userlist. \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u2013 \u044d\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a frontend \u0438 backend.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b HAProxy <code>\/etc\/hapee-1.9\/hapee-lb.cfg<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">userlist hapee-dataplaneapi     user dataplaneapi insecure-password mypassword<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>dataplaneapi<\/code> \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u043c <code>mypassword<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>mkpasswd<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>whois<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo apt install -y whois $ mkpasswd -m sha-256 mypassword $5$aVnIFECJ$2QYP64eTTXZ1grSjwwdoQxK\/AP8kcOflEO1Q5fc.5aA<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<p>\u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c HAProxy, \u0447\u0442\u043e\u0431\u044b <code>userlist<\/code> \u0432\u0441\u0442\u0443\u043f\u0438\u043b \u0432 \u0441\u0438\u043b\u0443.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 Data Plane API \u0437\u0430\u043f\u0443\u0449\u0435\u043d, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0435\u0433\u043e, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>Data Plane API \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0435\u043c\u0443 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e HAProxy \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"nastroyka-dostupa-k-soketu-haproxy\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043e\u043a\u0435\u0442\u0443 HAProxy<\/h3>\n<p>  <\/p>\n<p>Data Plane API \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u043e\u043a\u0435\u0442 HAProxy.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b HAProxy \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0438\u043c\u0435\u043b \u0441\u0442\u0440\u043e\u043a\u0443 <code>stats socket<\/code> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <code>global<\/code>:<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>user<\/code> \u0438 <code>group<\/code> \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Data Plane API. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 HAProxy Community, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043a\u0430\u043a \u0434\u043b\u044f <code>haproxy<\/code>. \u041e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 <code>hapee-lb<\/code> \u0438 <code>hapee<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f HAProxy Enterprise, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043d\u0438\u0436\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">global    stats socket \/run\/haproxy.sock user hapee-lb group hapee mode 660 level admin<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0435 API, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0442\u0443 \u0436\u0435 \u0433\u0440\u0443\u043f\u043f\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo usermod -a -G hapee $USER<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\u041f\u0420\u0418\u041c\u0415\u0427\u0410\u041d\u0418\u0415  \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0432 \u0441\u0438\u043b\u0443, \u0432\u044b\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0441\u043d\u043e\u0432\u0430 \u0432\u0445\u043e\u0434\u0438\u0442\u0435 \u0432 \u043d\u0435\u0435.<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"zapusk-data-plane-api\">\u0417\u0430\u043f\u0443\u0441\u043a Data Plane API<\/h2>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 API \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">hapee-dataplane-api [OPTIONS]<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438 HAProxy.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c hapee-dataplane-api \u0441 \u0444\u043b\u0430\u0433\u043e\u043c <code>--help<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"parametry-application\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Application<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u0435\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f Data Plane API \u0438 \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/th>\n<th>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>&#8212;scheme=<\/td>\n<td>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c listeners. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u044b \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 swagger<\/td>\n<\/tr>\n<tr>\n<td>&#8212;cleanup-timeout=<\/td>\n<td>\u041b\u044c\u0433\u043e\u0442\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0442\u044c \u0431\u0435\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (default: 10s)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;graceful-timeout=<\/td>\n<td>\u041b\u044c\u0433\u043e\u0442\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (default: 15s)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;max-header-size=<\/td>\n<td>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0431\u0430\u0439\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041e\u043d \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. (default:1MiB)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;socket-path=<\/td>\n<td>\u0421\u043e\u043a\u0435\u0442 Unix \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f (default: \/var\/run\/data-plane.sock))<\/td>\n<\/tr>\n<tr>\n<td>&#8212;host=<\/td>\n<td>IP-\u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f (default: localhost) [$HOST]<\/td>\n<\/tr>\n<tr>\n<td>&#8212;port=<\/td>\n<td>\u041f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439; \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 [$PORT]<\/td>\n<\/tr>\n<tr>\n<td>&#8212;listen-limit=<\/td>\n<td>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/td>\n<\/tr>\n<tr>\n<td>&#8212;keep-alive=<\/td>\n<td>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u044b TCP keep-alive \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439. \u041e\u043d \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u0442 \u043c\u0435\u0440\u0442\u0432\u044b\u0435 TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438) (default: 3m)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;read-timeout=<\/td>\n<td>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0435\u0440\u0435\u0434 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u043e\u043c (default: 30s)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;write-timeout=<\/td>\n<td>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0435\u0440\u0435\u0434 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u043e\u043c (default: 60s)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-host=<\/td>\n<td>IP-\u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f TLS; \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d, \u0442\u043e \u044d\u0442\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 &#8212;host [$TLS_HOST]<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-port=<\/td>\n<td>\u041f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439; \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 [$TLS_PORT]<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-certificate=<\/td>\n<td>\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 [$TLS_CERTIFICATE]<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-key=<\/td>\n<td>\u0417\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 [$TLS_PRIVATE_KEY]<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-ca=<\/td>\n<td>\u0424\u0430\u0439\u043b \u0446\u0435\u043d\u0442\u0440\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 mutual tls auth [$TLS_CA_CERTIFICATE]<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-listen-limit=<\/td>\n<td>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-keep-alive=<\/td>\n<td>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u044b TCP keep-alive \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439. \u041e\u043d \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u0442 \u043c\u0435\u0440\u0442\u0432\u044b\u0435 TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-read-timeout=<\/td>\n<td>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0435\u0440\u0435\u0434 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u043e\u043c<\/td>\n<\/tr>\n<tr>\n<td>&#8212;tls-write-timeout=<\/td>\n<td>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0435\u0440\u0435\u0434 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u043e\u043c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<h3 id=\"parametry-haproxy\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b HAProxy<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e API \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 HAProxy.<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/th>\n<th>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>-c, &#8212;config-file=<\/td>\n<td>\u041f\u0443\u0442\u044c \u043a HAProxy \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 (default: \u0444\u0430\u0439\u043b \/etc\/haproxy\/haproxy.cfg)<\/td>\n<\/tr>\n<tr>\n<td>-u, &#8212;userlist=<\/td>\n<td>\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 HAProxy \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 API (default: controller)<\/td>\n<\/tr>\n<tr>\n<td>-b, &#8212;haproxy-bin=<\/td>\n<td>\u041f\u0443\u0442\u044c \u043a \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 HAProxy (default: haproxy)<\/td>\n<\/tr>\n<tr>\n<td>-d, &#8212;reload-delay=<\/td>\n<td>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u043c\u0438 (\u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445) (default: 5)<\/td>\n<\/tr>\n<tr>\n<td>-r, &#8212;reload-cmd=<\/td>\n<td>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Reload<\/td>\n<\/tr>\n<tr>\n<td>-s, &#8212;restart-cmd=<\/td>\n<td>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/td>\n<\/tr>\n<tr>\n<td>&#8212;reload-retention=<\/td>\n<td>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0434\u043d\u044f\u0445, \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d (default: 1)<\/td>\n<\/tr>\n<tr>\n<td>-t, &#8212;transaction-dir=<\/td>\n<td>\u041f\u0443\u0442\u044c \u043a \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 (default: \/tmp\/haproxy)<\/td>\n<\/tr>\n<tr>\n<td>-n, &#8212;backups-number=<\/td>\n<td>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445\u0441\u044f \u0432 config dir \u0441 \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u043e\u043c \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 (default: 0)<\/td>\n<\/tr>\n<tr>\n<td>-m, &#8212;master-runtime=<\/td>\n<td>\u041f\u0443\u0442\u044c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0441\u043e\u043a\u0435\u0442\u0443 Runtime API<\/td>\n<\/tr>\n<tr>\n<td>-i, &#8212;show-system-info<\/td>\n<td>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 info<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<h3 id=\"parametry-vedeniya-zhurnala\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a API.<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/th>\n<th>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>&#8212;log-to=[stdout|file]<\/td>\n<td>\u0426\u0435\u043b\u044c \u0436\u0443\u0440\u043d\u0430\u043b\u0430, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c stdout \u0438\u043b\u0438 file (default: stdout)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;log-file=<\/td>\n<td>\u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 (default: \/var\/log\/dataplaneapi\/dataplaneapi.log)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;log-level=[trace|debug|info|warning|error]<\/td>\n<td>\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 (default: warning)<\/td>\n<\/tr>\n<tr>\n<td>&#8212;log-format=[text|JSON]<\/td>\n<td>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 (default: text)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<h3 id=\"drugie-parametry\">\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 API.<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/th>\n<th>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>-v, &#8212;version<\/td>\n<td>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u0441\u0431\u043e\u0440\u043a\u0435<\/td>\n<\/tr>\n<tr>\n<td>-h, &#8212;help<\/td>\n<td>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u043f\u0440\u0430\u0432\u043a\u0443 (\u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<h3 id=\"zapustit-data-plane-api-s-haproxy-enterprise\">\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Data Plane API \u0441 HAProxy Enterprise<\/h3>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a Data Plane API \u0441 HAProxy Enterprise \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo \/opt\/hapee-extras\/sbin\/hapee-dataplane-api \\ --host 0.0.0.0 \\ --port 5555 \\ --haproxy-bin \/opt\/hapee-1.9\/sbin\/hapee-lb \\ --config-file \/etc\/hapee-1.9\/hapee-lb.cfg \\ --reload-cmd &quot;systemctl reload hapee-1.9-lb&quot; \\ --reload-delay 5 \\ --userlist hapee-dataplaneapi \\ --restart-cmd &quot;systemctl restart hapee-1.9-lb&quot;<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"zapustit-data-plane-api-kak-servis\">\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Data Plane API \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Data Plane API \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 CLI. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 <code>\/etc\/default\/hapee-extras-dataplane-api<\/code>.<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c 1.9 \u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0444\u0430\u0439\u043b \u0441 \u0432\u0430\u0448\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 HAProxy Enterprise:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo sed -i 's\/1.9\/1.9\/g' \/etc\/default\/hapee-extras-dataplane-api<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo systemctl enable hapee-extras-dataplane-api<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0443\u0436\u0431\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo systemctl enable hapee-extras-dataplane-api<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h3 id=\"otobrazhenie-data-plane-api-v-brauzere\">\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 Data Plane API \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c API \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 5555, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/localhost:5555\/v1\/specification\" rel=\"nofollow\">http:\/\/localhost:5555\/v1\/specification<\/a>.<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u041f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 JSON, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b API.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0412 Firefox \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0443\u0434\u043e\u0431\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441 \u0440\u0430\u0437\u0431\u043e\u0440\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c\u0438. \u0423\u0437\u0435\u043b \u043f\u0443\u0442\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 URL-\u0430\u0434\u0440\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/5b5\/89c\/fca\/5b589cfca43c22ee50906212d87daa61.png\"><\/p>\n<p>  <\/p>\n<h3 id=\"test-metodov-test-methods\">\u0422\u0435\u0441\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (Test methods)<\/h3>\n<p>  <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>curl<\/code> \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>info<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X GET --user dataplaneapi:mypassword http:\/\/localhost:5555\/v1\/services\/haproxy\/info  {&quot;haproxy&quot;:{&quot;processes&quot;:1,&quot;release_date&quot;:&quot;2019-04-02&quot;,&quot;time&quot;:&quot;2019-04-08T22:07:39.291Z&quot;,&quot;uptime&quot;:1006,&quot;version&quot;:&quot;1.9.1-1.0.0-200.372&quot;}}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">{&quot;code&quot;:500,&quot;message&quot;:&quot;dial unix \/run\/haproxy.sock: connect: permission denied&quot;}<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 API, \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043e\u043a\u0435\u0442\u0443 HAProxy. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0435\u0433\u043e \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 HAProxy, \u0438 \u0441\u043d\u043e\u0432\u0430 \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\u041f\u0420\u0418\u041c\u0415\u0427\u0410\u041d\u0418\u0415  \u0417\u0430\u0434\u0430\u0447\u0430 Data Plane API \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c HAProxy. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 API \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0435\u043c\u0443 \u0441\u0438\u0433\u043d\u0430\u043b SIGUSR2, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"ispolzovanie-haproxy-process-manager\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HAProxy Process Manager<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 HAProxy 2.0 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HAProxy Process Manager \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Data Plane API. Process Manager \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>program<\/code> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e HAProxy \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 HAProxy.<\/p>\n<p>  <\/p>\n<h3 id=\"nastroyka-haproxy-dlya-starta-data-plane-api\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 HAProxy \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 Data Plane API<\/h3>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 Data Plane API \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 HAProxy. \u0421\u0442\u0440\u043e\u043a\u0430 <code>no option start-on-reload<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 Data Plane API \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043a HAProxy \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e HAProxy:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">program api    command dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin \/usr\/sbin\/haproxy --config-file \/etc\/haproxy\/haproxy.cfg --reload-cmd &quot;systemctl reload haproxy&quot; --reload-delay 5 --userlist hapee-dataplaneapi    no option start-on-reload<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c HAProxy \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <code>master-worker<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>master-worker<\/code> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b <code>global<\/code> (\u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 -W \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438). \u0417\u0430\u0442\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441 HAProxy, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0431\u043e\u0447\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 HAProxy.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo systemctl restart haproxy $ sudo systemctl status haproxy  Main PID: 1274 (haproxy)    Tasks: 6 Memory: 5.5M    CPU: 2.838s CGroup: \/system.slice\/haproxy.service    1274 \/usr\/sbin\/haproxy -Ws -f \/etc\/haproxy\/haproxy.cfg -p \/run\/haproxy.pid -sf 2768 -x \/run\/haproxy\/admin.sock    2768 \/usr\/sbin\/haproxy -Ws -f \/etc\/haproxy\/haproxy.cfg -p \/run\/haproxy.pid -sf 2662 -x \/run\/haproxy\/admin.sock    2830 \/opt\/hapee-extras\/sbin\/hapee-dataplane-api --host 0.0.0.0 --port 5555 -b \/usr\/local\/sbin\/haproxy -c \/etc\/haproxy\/haproxy.cfg -d 5 -r systemctl reload haproxy -u controller    2831 \/usr\/sbin\/haproxy -Ws -f \/etc\/haproxy\/haproxy.cfg -p \/run\/haproxy.pid -sf 2768 -x \/run\/haproxy\/admin.sock<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 HAProxy \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 Docker \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 master-worker (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e), \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>kill-SIGUSR2 [PID]<\/code> \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <code>--reload-cmd<\/code>, \u0433\u0434\u0435 PID \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0432\u0435\u043d 1, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b HAProxy \u0431\u0435\u0437 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">program api    command \/etc\/haproxy\/dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin \/usr\/sbin\/haproxy --config-file \/etc\/haproxy\/haproxy.cfg --reload-cmd &quot;kill -SIGUSR2 1&quot; --reload-delay 5 --userlist hapee-dataplaneapi    no option start-on-reload<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h3 id=\"ispolzovanie-data-plane-api\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Data Plane API<\/h3>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0432\u0430\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 Data Plane API.<\/p>\n<p>  <\/p>\n<h4 id=\"get-zaprosy\">GET \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/h4>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GET-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b URL-\u0430\u0434\u0440\u0435\u0441\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X GET --user admin:mypassword http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/frontends  {&quot;_version&quot;:1,&quot;data&quot;:[{&quot;default_backend&quot;:&quot;be_web&quot;,&quot;name&quot;:&quot;fe_main&quot;}]}<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 JSON \u0441 \u0434\u0432\u0443\u043c\u044f \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f: <code>_version<\/code> \u0438 <code>data<\/code>.<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 HAProxy \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 POST, PUT \u0438\u043b\u0438 DELETE. \u042d\u0442\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u043d\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0442.<\/p>\n<p>  <\/li>\n<li>\n<p>\u041a\u043b\u044e\u0447 <code>data<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"post-zaprosy\">POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/h4>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e POST-\u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0432 URL-\u0430\u0434\u0440\u0435\u0441. \u0415\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u043e \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 POST \u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\u0421\u041e\u0412\u0415\u0422  \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u044c URL-\u0430\u0434\u0440\u0435\u0441 \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 URL \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \u0430\u043c\u043f\u0435\u0440\u0441\u0430\u043d\u0434\u0430 \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\   -H &quot;Content-Type: application\/json&quot; \\   -d '{&quot;name&quot;: &quot;test_frontend&quot;, &quot;default_backend&quot;: &quot;be_web&quot;, &quot;mode&quot;: &quot;http&quot;, &quot;maxconn&quot;: 2000}' \\   &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/frontends?version=1&quot;<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"ispolzovanie-tranzakciy\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439<\/h4>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 <code>be_web<\/code>, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0435, \u0447\u0442\u043e API \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c.<\/p>\n<p>  <\/li>\n<li>\n<p>API \u0441\u043e\u0437\u0434\u0430\u0435\u0442 <code>frontend<\/code> \u0431\u0435\u0437 <code>bind<\/code> \u043b\u0438\u043d\u0438\u0438.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u044d\u043a\u0435\u043d\u0434 <code>be_web<\/code><\/p>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043a \u0431\u044d\u043a\u0435\u043d\u0434\u0443<\/p>\n<p>  <\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/p>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 <code>bind<\/code> \u043a <code>frontend<\/code><\/p>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b; \u0438 \u043f\u043e\u043a\u0430 \u0432\u044b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0438\u0445 \u0432\u0441\u0435, \u0432\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e HAProxy \u0441 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u043c\u0438, \u043d\u043e \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0445 \u0432\u0441\u0435 \u0441\u0440\u0430\u0437\u0443.<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438: <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ http:\/\/localhost:5555\/v1\/services\/haproxy\/transactions?version=5<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">{&quot;_version&quot;:5,&quot;id&quot;:&quot;b9a0ecd7-b8ae-4ef8-8865-0cd5e38396cd&quot;,&quot;status&quot;:&quot;in_progress&quot;}<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>transaction_id<\/code> \u0432 URL-\u0430\u0434\u0440\u0435\u0441. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X GET --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/transactions&quot;<\/code><\/pre>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u044d\u043a\u044d\u043d\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ -d '{&quot;name&quot;: &quot;test_backend&quot;, &quot;mode&quot;:&quot;http&quot;, &quot;balance&quot;: {&quot;algorithm&quot;:&quot;roundrobin&quot;}, &quot;httpchk&quot;: {&quot;method&quot;: &quot;HEAD&quot;, &quot;uri&quot;: &quot;\/check&quot;, &quot;version&quot;: &quot;HTTP\/1.1&quot;}}' \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/backends?transaction_id=b9a0ecd7-b8ae-4ef8-8865-0cd5e38396cd&quot;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0431\u044d\u043a\u044d\u043d\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ -d '{&quot;name&quot;: &quot;server1&quot;, &quot;address&quot;: &quot;127.0.0.1&quot;, &quot;port&quot;: 8080, &quot;check&quot;: &quot;enabled&quot;, &quot;maxconn&quot;: 30, &quot;weight&quot;: 100}' \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/servers?backend=test_backend&amp;transaction_id=b9a0ecd7-b8ae-4ef8-8865-0cd5e38396cd&quot;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 <code>frontend<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ -d '{&quot;name&quot;: &quot;test_frontend&quot;, &quot;mode&quot;: &quot;http&quot;, &quot;default_backend&quot;: &quot;test_backend&quot;, &quot;maxconn&quot;: 2000}' \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/frontends?transaction_id=b9a0ecd7-b8ae-4ef8-8865-0cd5e38396cd&quot;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 <code>bind<\/code> \u043a <code>frontend<\/code> :<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ -d '{&quot;name&quot;: &quot;http&quot;, &quot;address&quot;: &quot;*&quot;, &quot;port&quot;: 80}' \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/binds?frontend=test_frontend&amp;transaction_id=b9a0ecd7-b8ae-4ef8-8865-0cd5e38396cd&quot;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X PUT --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/transactions\/b9a0ecd7-b8ae-4ef8-8865-0cd5e38396cd&quot;<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h4 id=\"monitor-configuration-reloads\">Monitor Configuration Reloads<\/h4>\n<p>  <\/p>\n<p>Data Plane API \u0441 <code>--reload-delay<\/code> \u0438\u043b\u0438 <code>-d<\/code> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0432 \u043f\u044f\u0442\u044c \u0441\u0435\u043a\u0443\u043d\u0434, \u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0435 \u043f\u044f\u0442\u044c \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0431\u044b\u043b\u043e \u043b\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 HAProxy. \u0415\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, API \u0436\u0434\u0435\u0442 \u0435\u0449\u0435 \u043f\u044f\u0442\u044c \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043d\u043e\u0432\u0430. \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438, \u0436\u0434\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443. \u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 <code>\/services\/haproxy\/reloads<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0430.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c HAProxy \u0441\u0440\u0430\u0437\u0443 \u0436\u0435, \u043c\u0438\u043d\u0443\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 force_reload=true URL \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p>  <\/p>\n<h3 id=\"primer-konfiguracii\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/h3>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 ACL \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>is_api<\/code> \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>test_frontend<\/code>.<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 ACL \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>is_api<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ -d '{&quot;id&quot;: 0, &quot;acl_name&quot;: &quot;is_api&quot;, &quot;criterion&quot;: &quot;path_beg&quot;, &quot;value&quot;: &quot;\/api&quot;}' \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/acls?parent_type=frontend&amp;parent_name=test_frontend&amp;version=4&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">frontend test_frontend    mode http    maxconn 2000    acl is_api path_beg \/api    default_backend test_backend<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 <code>use_backend<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 ACL <code>is_api<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ -d '{&quot;id&quot;: 0, &quot;cond&quot;: &quot;if&quot;, &quot;cond_test&quot;: &quot;is_api&quot;, &quot;name&quot;: &quot;test_backend&quot;}' \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/backend_switching_rules?frontend=test_frontend&amp;version=5&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">frontend test_frontend    mode http    maxconn 2000    acl is_api path_beg \/api    use_backend test_backend if is_api    default_backend test_backend<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0423\u0434\u0430\u043b\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 <code>use_backend<\/code> (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c <code>id<\/code> 0 \u0432 URL-\u0430\u0434\u0440\u0435\u0441):<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X DELETE --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/backend_switching_rules\/0?frontend=test_frontend&amp;version=6&quot;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 ACL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u0440\u043e\u043c\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0442 localhost:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ curl -X POST --user admin:mypassword \\ -H &quot;Content-Type: application\/json&quot; \\ -d '{&quot;id&quot;: 0, &quot;cond&quot;: &quot;unless&quot;, &quot;cond_test&quot;: &quot;{ src 127.0.0.1 }&quot;, &quot;type&quot;: &quot;deny&quot;}' \\ &quot;http:\/\/localhost:5555\/v1\/services\/haproxy\/configuration\/http_request_rules?parent_type=frontend&amp;parent_name=test_frontend&amp;version=7&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f HAProxy \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">frontend test_frontend    mode http    maxconn 2000    acl is_api path_beg \/api    http-request deny unless { src 127.0.0.1 }    default_backend test_backend<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h3 id=\"summary\">Summary<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 HAProxy Data Plane API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c HAProxy HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 HAProxy.<\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u043a\u0441\u0438, \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u0432, \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, ACLs (\u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c), \u043f\u0440\u0430\u0432\u0438\u043b \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043c\u043d\u043e\u0433\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u0432 <a href=\"https:\/\/www.haproxy.com\/documentation\/dataplaneapi\/latest\/\" rel=\"nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 API<\/a>. <\/p>\n<p>  <\/p>\n<p>P.S. \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0447\u0430\u0442 HAproxy <a href=\"https:\/\/t.me\/haproxy_ru\" rel=\"nofollow\">https:\/\/t.me\/haproxy_ru<\/a><\/p>\n<\/div>\n<p> \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\/508132\/\"> https:\/\/habr.com\/ru\/post\/508132\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508132\/\">\n<h1 id=\"ispolzovanie-haproxy-v-kachestve-data-plane-service-mesh-v-arhitekture-mikroservisov\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HAProxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Data Plane Service Mesh \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/h1>\n<p>  <\/p>\n<p>HAProxy Data Plane API \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 HAProxy, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 HAProxy \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u044f\u0434 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041b\u0443\u0447\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HAProxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Data Plane Service Mesh \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0433\u0434\u0435 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 sidecar.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Data Plane API \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.<\/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-305881","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305881","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=305881"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305881\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}