{"id":9286,"date":"2021-06-09T10:58:10","date_gmt":"2021-06-09T07:58:10","guid":{"rendered":"https:\/\/ip-calculator.ru\/blog\/?p=9286"},"modified":"2021-06-09T11:47:46","modified_gmt":"2021-06-09T08:47:46","slug":"kak-ustanovit-i-nastroit-haproxy-v-ubuntu-20-04-lts","status":"publish","type":"post","link":"https:\/\/ip-calculator.ru\/blog\/ask\/kak-ustanovit-i-nastroit-haproxy-v-ubuntu-20-04-lts\/","title":{"rendered":"\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c HAproxy \u0432 Ubuntu 20.04 LTS"},"content":{"rendered":"<div class=\"flat_pm_start\"><\/div>\n<p>HAproxy &#8212; \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 TCP \u0438 HTTP. \u041e\u043d \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. HAproxy \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Linux. \u042d\u0442\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0441\u0432\u043e\u0435\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043c\u0430\u043b\u044b\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c HAproxy \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Ubuntu.\u00a0 \u041d\u0443, \u0430 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 <a href=\"https:\/\/buy.fineproxy.org\/\">\u0441\u0430\u0439\u0442<\/a> \u0438 \u043a\u0443\u043f\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<p>\u041c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0442\u0440\u0438 \u043c\u0430\u0448\u0438\u043d\u044b. \u041c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c HAproxy \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u044b Apache \u043d\u0430 \u0434\u0432\u0443\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445. \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 Apache.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong> \u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435, \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 Ubuntu 20.04 LTS (Focal Fossa). \u0422\u0430 \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430 \u0434\u043b\u044f \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Debian \u0438 Mint.<\/p>\n<h2>\u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0441\u0435\u0442\u0438<\/h2>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Ubuntu; \u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445:<\/p>\n<pre>Hostname: HAproxy, IP address: 192.168.72.157 (Frontend server)\r\nHostname: web-server1, IP address: 192.168.72.158 (Backend servers)\r\nHostname: web-server2, IP address: 192.168.72.159 (Backend servers)<\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u0423 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u0430\u0432\u0430 sudo \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445.<\/p>\n<p>\u041c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043e\u0434\u043d\u0443 \u043c\u0430\u0448\u0438\u043d\u0443 \u043a\u0430\u043a \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0430 \u0434\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0430\u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u044b. \u0421\u0435\u0440\u0432\u0435\u0440 HAproxy \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u0434\u0432\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0448\u0438\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0448\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9287\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-486.png\" alt=\"\" width=\"791\" height=\"505\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-486.png 791w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-486-300x192.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-486-768x490.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 &#8212; Backend-\u0441\u0435\u0440\u0432\u0435\u0440\u044b<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0434\u0432\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 ( \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u04401 \u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u04402 ) \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0448\u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/p>\n<h3>\u041d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u04351 (192.168.72.158)<\/h3>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u043c\u0435\u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 \u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0445\u043e\u0441\u0442\u043e\u0432 \u0432\u0430\u0448\u0438\u0445 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/p>\n<h4>1. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b hosts<\/h4>\n<p>\u041d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u04351 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \/etc\/hosts :<\/p>\n<pre>$ sudo nano \/etc\/hosts<\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre>hostname-of-HAproxy IP-address-of-HAproxy<\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre>HAproxy 192.168.72.157<\/pre>\n<h4>2. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Apache.<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Apache, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435.<\/p>\n<pre>$ sudo apt install apache2<\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0443\u0436\u0431\u0443 Apache, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ sudo systemctl enable apache2 \r\n$ sudo systemctl start apache2<\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f web-server1, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ echo \"&lt;H1&gt;Hello! This is webserver1: 192.168.72.158 &lt;\/H1&gt;\" | sudo tee \/var\/www\/html\/index.html<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a Apache \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e:<\/p>\n<pre>$ sudo ufw allow 80\/tcp<\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0430:<\/p>\n<pre>$ ufw reload<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0430\u0439\u0442\u0443 \u0432 \u0441\u0432\u043e\u0435\u043c \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u043d\u0430\u0431\u0440\u0430\u0432 http:\/\/, \u0430 \u0437\u0430\u0442\u0435\u043c \u043b\u0438\u0431\u043e IP-\u0430\u0434\u0440\u0435\u0441, \u043b\u0438\u0431\u043e \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<pre>http:\/\/ hostname-or-IP-address<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9289\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-487.png\" alt=\"\" width=\"851\" height=\"248\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-487.png 851w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-487-300x87.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-487-768x224.png 768w\" sizes=\"auto, (max-width: 851px) 100vw, 851px\" \/><\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \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 curl \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<pre>$ curl &lt;hostname-or-IP-address&gt;<\/pre>\n<h3>\u041d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435-2 192.168.72.159<\/h3>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u043c\u0435\u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 \u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0445\u043e\u0441\u0442\u043e\u0432 \u0432\u0430\u0448\u0438\u0445 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/p>\n<h4>1. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b hosts<\/h4>\n<p>\u041d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u04352 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \/ etc \/ hosts :<\/p>\n<pre>$ sudo nano \/etc\/hosts<\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre>HAproxy 192.168.72.157<\/pre>\n<h4>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Apache.<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Apache, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435.<\/p>\n<pre>$ sudo apt install apache2<\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0443\u0436\u0431\u0443 Apache, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ sudo systemctl \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c apache2 \r\n$ sudo systemctl start apache2<\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f web-server2, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ echo \"&lt;H1&gt;Hello! This is webserver2: 192.168.72.159 &lt;\/H1&gt;\" | sudo tee \/var\/www\/html\/index.html<\/pre>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 Apache \u0432 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0435:<\/p>\n<pre>$ sudo ufw allow 80\/tcp<\/pre>\n<p>\u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0430:<\/p>\n<pre>$ ufw reload<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0430\u0439\u0442\u0443 \u0432 \u0441\u0432\u043e\u0435\u043c \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u043d\u0430\u0431\u0440\u0430\u0432 http: \/\/, \u0430 \u0437\u0430\u0442\u0435\u043c \u043b\u0438\u0431\u043e IP-\u0430\u0434\u0440\u0435\u0441, \u043b\u0438\u0431\u043e \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430.<\/p>\n<pre>http:\/\/ hostname-or-IP-address<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9288\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-488.png\" alt=\"\" width=\"944\" height=\"283\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-488.png 944w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-488-300x90.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-488-768x230.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \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 curl \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<pre>$ curl &lt;hostname-or-IP-address&gt;<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u044b Apache \u0433\u043e\u0442\u043e\u0432\u044b.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 HAproxy-Frontend server<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 HAproxy \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432. \u042d\u0442\u043e\u0442 HAproxy-\u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 HAproxy ( 192.168.72.157 ) \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<h3>1. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b hosts<\/h3>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \/ etc \/ hosts, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<p>$ sudo nano \/ etc \/ hosts<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430 \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 Apache \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0445\u043e\u0441\u0442\u0430 :<\/p>\n<pre>192.168.72.157 HAproxy\r\n192.168.72.158 web-server1\r\n192.168.72.159 web-server2<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9290\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-489.png\" alt=\"\" width=\"698\" height=\"188\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-489.png 698w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-489-300x81.png 300w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \/etc\/hosts.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 HAproxy<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c HAproxy \u043d\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 Ubuntu (192.168.72.157). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 apt, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ sudo apt-get update<\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre>$ sudo apt-get upgrade<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 HAproxy, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ sudo sudo apt install haproxy<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9291\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-490.png\" alt=\"\" width=\"899\" height=\"273\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-490.png 899w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-490-300x91.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-490-768x233.png 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u044d\u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ haproxy -v<\/pre>\n<p>\u041e\u043d \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0430\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e HAproxy \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e HAproxy \u0431\u044b\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 HAproxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/h2>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c HAproxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \/etc\/haproxy\/haproxy.cfg :<\/p>\n<pre>$ sudo nano \/etc\/haproxy\/haproxy.cfg<\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b haproxy.cfg, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0430\u0448\u0438\u043c\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 HAproxy \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043f\u043e\u0440\u0442 80 \u0438\u0437 192.168.72.157 , \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 , \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 \u0432\u0430\u0448\u0438\u0445 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9292\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-492.png\" alt=\"\" width=\"798\" height=\"431\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-492.png 798w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-492-300x162.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-492-768x415.png 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 HAproxy<\/h2>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 HAproxy \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u0440\u0435\u043c\u044f \u0431\u0435\u0437\u043e\u0442\u043a\u0430\u0437\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0435\u0430\u043d\u0441\u0430 \u0438 \u0442.\u0434. \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 HAproxy, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \/etc\/haproxy\/haproxy.cfg :<\/p>\n<pre>listen stats\r\nbind 192.168.72.157:8080\r\nmode http\r\noption forwardfor\r\noption httpclose\r\nstats enable\r\nstats show-legends\r\nstats refresh 5s\r\nstats uri \/stats\r\nstats realm Haproxy\\ Statistics\r\nstats auth kbuzdar:kbuzdar\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 #Login User and Password for the monitoring\r\nstats admin if TRUE\r\ndefault_backend web-backend<\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u00ab \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u00bb HAproxy \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b stats \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 http \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 stats auth .<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9293\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-493.png\" alt=\"\" width=\"936\" height=\"426\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-493.png 936w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-493-300x137.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-493-768x350.png 768w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><\/p>\n<p>\u041f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b haproxy.cfg.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre>$ haproxy -c -f \/etc\/haproxy\/haproxy.cfg<\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u0435\u0440\u043d\u044b.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9294\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-494.png\" alt=\"\" width=\"681\" height=\"64\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-494.png 681w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-494-300x28.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0443\u0436\u0431\u0443 HAproxy:<\/p>\n<pre>$ sudo systemctl restart haproxy.service<\/pre>\n<p>\u041e\u043d \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0441\u043b\u0443\u0436\u0431\u0443 HAproxy.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u043b\u0443\u0436\u0431\u044b HAproxy, \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<pre>$ sudo systemctl status haproxy.service<\/pre>\n<p>\u0410\u043a\u0442\u0438\u0432\u043d\u043e (\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442) \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 , \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9295\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-495.png\" alt=\"\" width=\"823\" height=\"200\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-495.png 823w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-495-300x73.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-495-768x187.png 768w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><\/p>\n<p>\u0412\u043e\u0442 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c HAproxy:<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre>$ sudo systemctl start haproxy.service<\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy, \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<pre>$ sudo systemctl stop haproxy.service<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy, \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<pre>$ sudo systemctl \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c haproxy.service<\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre>$ sudo systemctl \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c haproxy.service<\/pre>\n<h2>\u0422\u0435\u0441\u0442 HAproxy<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 HAproxy \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c. \u0421 \u0432\u0430\u0448\u0435\u0433\u043e HAproxy-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u0432\u044f\u0437\u044c \u0441 \u043e\u0431\u043e\u0438\u043c\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u043f\u043e \u0438\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0438\u043b\u0438 \u0438\u043c\u0435\u043d\u0430\u043c \u0445\u043e\u0441\u0442\u043e\u0432.<\/p>\n<pre>$ ping \u0438\u043c\u044f-\u0445\u043e\u0441\u0442\u0430-\u0438\u043b\u0438-IP-\u0430\u0434\u0440\u0435\u0441<\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u043e\u0438\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9296\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-496.png\" alt=\"\" width=\"883\" height=\"457\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-496.png 883w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-496-300x155.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-496-768x397.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/p>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u043a\u0441\u0438 HA \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430<br \/>\n\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 HAproxy \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043b\u044e\u0431\u043e\u0439 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 http: \/\/, \u0430 \u0437\u0430\u0442\u0435\u043c IP-\u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 192.168.72.157.<\/p>\n<pre>http:\/\/192.168.72.157<\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0441\u0435\u0440\u0432\u0435\u0440 HAproxy \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043e\u0431\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e, \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0432 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437.<\/p>\n<p>\u0412\u043e\u0442 \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0441\u0435\u0442\u0438\u043b\u0438 http:\/\/192.168.72.157 :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-9297\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-497-1024x239.png\" alt=\"\" width=\"700\" height=\"163\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-497-1024x239.png 1024w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-497-300x70.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-497-768x179.png 768w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-497.png 1060w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>\u042d\u0442\u043e \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-9298\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-498-1024x262.png\" alt=\"\" width=\"700\" height=\"179\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-498-1024x262.png 1024w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-498-300x77.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-498-768x197.png 768w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-498.png 1062w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432\u043c\u0435\u0441\u0442\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-9299\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-499-1024x240.png\" alt=\"\" width=\"700\" height=\"164\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-499-1024x240.png 1024w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-499-300x70.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-499-768x180.png 768w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-499.png 1055w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u043a\u0441\u0438 HA \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e curl<\/h3>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \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 curl \u0432 Linux \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 HAproxy. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 curl, \u0430 \u0437\u0430\u0442\u0435\u043c IP-\u0430\u0434\u0440\u0435\u0441 \u0438\u043b\u0438 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy.<\/p>\n<pre>$ curl 192.168.72.157<\/pre>\n<p>\u0438\u043b\u0438 \u0436\u0435<\/p>\n<pre>$ curl HAproxy<\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 curl \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u0447\u0435\u0440\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u043e\u0438\u043c\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy:<\/p>\n<pre>$ while true; do curl 192.168.72.157; sleep 1; done<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9300\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-500.png\" alt=\"\" width=\"781\" height=\"204\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-500.png 781w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-500-300x78.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-500-768x201.png 768w\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" \/><\/p>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 HAproxy<br \/>\n\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 HAproxy, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 http: \/\/, \u0430 \u0437\u0430\u0442\u0435\u043c IP-\u0430\u0434\u0440\u0435\u0441\/\u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy \u0438 \u043f\u043e\u0440\u0442 8080 \/ stats:<\/p>\n<pre>http:\/\/192.168.72.157:8080\/stats<\/pre>\n<p>\u0438\u043b\u0438 \u0436\u0435<\/p>\n<pre>http:\/\/HAproxy:8080\/stats<\/pre>\n<p>\u041f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0436\u043c\u0438\u0442\u0435 OK .<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-9301\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-501-1024x411.png\" alt=\"\" width=\"700\" height=\"281\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-501-1024x411.png 1024w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-501-300x120.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-501-768x308.png 768w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-501.png 1208w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>\u042d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0442\u0447\u0435\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 HAproxy.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-9302\" src=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-502-1024x534.png\" alt=\"\" width=\"700\" height=\"365\" srcset=\"https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-502-1024x534.png 1024w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-502-300x156.png 300w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-502-768x401.png 768w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-502-325x170.png 325w, https:\/\/ip-calculator.ru\/blog\/wp-content\/uploads\/2021\/06\/word-image-502.png 1438w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 HAproxy \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Linux. \u041c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e HAproxy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u043b\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 Apache. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c HAproxy. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 curl. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435 <a href=\"https:\/\/www.haproxy.org\/#docs\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e HAproxy<\/a>.<\/p>\n<div class=\"container-lazyload preview-lazyload container-youtube js-lazyload--not-loaded\"><a href=\"https:\/\/www.youtube.com\/watch?v=2nzjxzR-C38\" class=\"lazy-load-youtube preview-lazyload preview-youtube\" data-video-title=\"\u0421\u0435\u043c\u0438\u043d\u0430\u0440 HAProxy \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f.\" title=\"Play video &quot;\u0421\u0435\u043c\u0438\u043d\u0430\u0440 HAProxy \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f.&quot;\">https:\/\/www.youtube.com\/watch?v=2nzjxzR-C38<\/a><noscript>Video can&#8217;t be loaded because JavaScript is disabled: <a href=\"https:\/\/www.youtube.com\/watch?v=2nzjxzR-C38\" title=\"\u0421\u0435\u043c\u0438\u043d\u0430\u0440 HAProxy \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f.\">\u0421\u0435\u043c\u0438\u043d\u0430\u0440 HAProxy \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f. (https:\/\/www.youtube.com\/watch?v=2nzjxzR-C38)<\/a><\/noscript><\/div>\n<div class=\"flat_pm_end\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>HAproxy &#8212; \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 TCP \u0438 HTTP. \u041e\u043d \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. HAproxy \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Linux. \u042d\u0442\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0441\u0432\u043e\u0435\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043c\u0430\u043b\u044b\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0412 \u044d\u0442\u043e\u043c [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-9286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ask"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/posts\/9286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/comments?post=9286"}],"version-history":[{"count":0,"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/posts\/9286\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/media\/189"}],"wp:attachment":[{"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/media?parent=9286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/categories?post=9286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ip-calculator.ru\/blog\/wp-json\/wp\/v2\/tags?post=9286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}