{"id":214069,"date":"2014-02-27T16:05:03","date_gmt":"2014-02-27T12:05:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=214069"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=214069","title":{"rendered":"<span class=\"post_title\">\u0421\u0432\u043e\u0439 Cocaine. \u041e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u042f\u043d\u0434\u0435\u043a\u0441\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041c\u044b \u0443\u0436\u0435 <a href=\"http:\/\/habrahabr.ru\/company\/yandex\/blog\/209324\/\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438<\/a> \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043f\u0440\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0438\u0448\u0451\u043b \u0447\u0435\u0440\u0451\u0434 \u043e\u0442 \u0441\u043b\u043e\u0432 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0434\u0435\u043b\u0443 \u2014 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0431\u043b\u0430\u043a\u043e \u043d\u0430 Elliptics \u0438 Cocaine.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/company\/yandex\/blog\/214069\/\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e40\/0ef\/ca5\/e400efca5a67bf741ae2ee2468bffbbd.jpg\"\/><br \/>  <\/a>  <\/p>\n<h2>\u0421\u0445\u0435\u043c\u0430<\/h2>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u043b\u0430\u0447\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <a href=\"https:\/\/github.com\/cocaine\/cocaine-framework-python\/tree\/v0.11\/examples\/flask\">\u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 <b>flask<\/b>. <\/p>\n<p>  \u042d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043a\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<ul>\n<li><b>cocaine-runtime<\/b>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 Docker;<\/li>\n<li><b>Docker-registry<\/b> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439;<\/li>\n<li><b>Elliptics<\/b> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u043b\u0430\u043a\u0430;<\/li>\n<li><b>\u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u043d\u043e\u0434\u0430 cocaine-runtime<\/b> \u2014 \u0435\u0434\u0438\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043a\u0430\u0438\u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430;<\/li>\n<li><b>HTTP-frontend<\/b> \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c.<\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0430\u043f\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e88\/65b\/73f\/e8865b73fa8aec9dc83ac2d38b3b8120.jpg\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <b>5<\/b> (\u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445) \u043c\u0430\u0448\u0438\u043d\u043e\u043a \u0441 \u044f\u0434\u0440\u043e\u043c \u043d\u0435 \u043d\u0438\u0436\u0435 <b>3.8<\/b> \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 <b>Docker<\/b>. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/repo.reverbrain.com\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c <b>\/etc\/apt\/sources.list.d\/reverbrain.list<\/b> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"bash\">deb http:\/\/repo.reverbrain.com\/precise\/ current\/amd64\/ deb http:\/\/repo.reverbrain.com\/precise\/ current\/all\/ <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0442\u044f\u043d\u0435\u043c \u043a\u043b\u044e\u0447:  <\/p>\n<pre><code class=\"bash\">curl -O http:\/\/repo.reverbrain.com\/REVERBRAIN.GPG sudo apt-key add REVERBRAIN.GPG <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u043a\u043e\u043a\u0430\u0438\u043d\u0443, \u0441\u0442\u0430\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b:  <\/p>\n<pre><code class=\"bash\">apt-get update apt-cache search cocaine <\/code><\/pre>\n<\/div>\n<\/div>\n<h4>5 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 Elliptics<\/h4>\n<p>  \u041c\u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e <b>Elliptics<\/b> \u0438\u0437 <i>\u043e\u0434\u043d\u043e\u0439<\/i> \u043c\u0430\u0448\u0438\u043d\u044b \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u0421\u0440\u0430\u0437\u0443 \u0437\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0439 Elliptics \u0434\u043b\u044f \u0431\u043e\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u0432\u0430\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443\u0442 \u0440\u0435\u0431\u044f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 Elliptics. \u0422\u0430\u043a\u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/doc.reverbrain.com\/elliptics:server-tutorial\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>  \u0412 \u043f\u0430\u0440\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">sudo apt-get install elliptics=2.24.14.31 elliptics-client=2.24.14.31 mkdir \/tmp\/history\/ && mkdir \/tmp\/root cp \/usr\/share\/doc\/elliptics\/examples\/ioserv.conf  .\/tst_ioserv.conf <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 <b>tst_ioserv.conf<\/b> \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e 3 \u0441\u0442\u0440\u043e\u043a\u0438. \u0418\u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">group = 1 addr = localhost:1025:2-0 192.168.50.201:1025:2-1 \/\/ \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0439 IP indexes_shard_count = 16  <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">dnet_ioserv -c tst_ioserv.conf <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/c14\/887\/b0e\/c14887b0eef5ee9265ede751c4ff4c86.png\"\/><\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 cocaine-runtime + Docker<\/h4>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0438\u043d\u0438-\u043e\u0431\u043b\u0430\u043a\u0430 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u0430\u0448\u0438\u043d, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0445 \u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042f\u0434\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e <b>cocaine-runtime<\/b>. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0430\u043c <b>Docker<\/b> \u0438 <b>cocaine-plugin<\/b> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <b>Docker<\/b>.<\/p>\n<p>  \u0423\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0445\u043e\u0442\u044f \u043d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>  \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u0435\u0441\u0442\u044c \u0431\u043b\u0430\u0433\u043e. \u041e\u043d\u0430 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li>\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441 \u043d\u0430\u043c\u0438;<\/li>\n<li>\u043d\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0432\u0443\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439;<\/li>\n<li>\u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 dev, test, prod-\u0441\u0440\u0435\u0434\u0430\u0445.<\/li>\n<\/ul>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a \u0431\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0438 \u0443\u0434\u043e\u0431\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 go) \u0438\u043b\u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f\u0434\u0440\u043e \u043d\u0438\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f).<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:  <\/p>\n<pre><code class=\"bash\">sudo apt-get install cocaine-runtime libcocaine-core2 libcocaine-plugin-docker2 libcocaine-plugin-elliptics=2.24.14.31 elliptics-client=2.24.14.31 <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/bbd\/ed0\/deb\/bbded0debaf6d1d5b59710d07d94a9fb.png\"\/><\/p>\n<p>  \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <b>cocaine-tool<\/b>. \u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0437 <b>PyPI<\/b> \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f Python \u043f\u0430\u043a\u0435\u0442\u043e\u0432. <\/p>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u043d\u0434\u0438\u043d\u0433 \u0432 Python \u0434\u043b\u044f <b>msgpack<\/b>.  <\/p>\n<pre><code class=\"bash\">sudo apt-get install msgpack-python <\/code><\/pre>\n<p>  \u0410 \u0437\u0430\u0442\u0435\u043c <b>cocaine-tools<\/b>.  <\/p>\n<pre><code class=\"bash\">sudo pip install cocaine-tools <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0410 \u043f\u043e\u0447\u0435\u043c\u0443 msgpack-python \u043d\u0435 \u0438\u0437 PyPI?<\/b><\/p>\n<div class=\"spoiler_text\">Msgpack-python \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u0430 \u00abpure-Python\u00bb, \u0432\u0442\u043e\u0440\u0430\u044f \u2014 \u043d\u0430 Cython. \u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438\u0437 PyPI \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0447\u0438\u0441\u0442\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u041f\u043b\u043e\u0445\u043e \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u041c\u044b \u0431\u0440\u0430\u043b\u0438 \u0437\u0430 \u044d\u0442\u0430\u043b\u043e\u043d Cython \u0432\u0435\u0440\u0441\u0438\u044e. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0438\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u0442\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u2014 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u2014 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u0422\u0430\u043a \u0431\u044b\u043b\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/div>\n<\/div>\n<p>  Docker \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"http:\/\/docs.docker.io\/en\/latest\/installation\/ubuntulinux\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u043b\u044e\u0431\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0443\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">curl -s https:\/\/get.docker.io\/ubuntu\/ | sudo sh<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/36c\/4e4\/1c2\/36c4e41c2097f95c3cd036451a21b701.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u044f\u0446\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <b>cocaine-runtime<\/b> \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c. <br \/>  \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <b>cocaine-runtime<\/b> \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.  <\/p>\n<pre><code class=\"bash\">sudo service cocaine-runtime stop  <\/code><\/pre>\n<p>  \u0414\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \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 \u0432 <b>\/etc\/cocaine\/cocaine-default.conf<\/b> \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code>{     &quot;version&quot;: 2,     &quot;paths&quot;: {         &quot;plugins&quot;: &quot;\/usr\/lib\/cocaine&quot;,         &quot;runtime&quot;: &quot;\/var\/run\/cocaine&quot;     },     &quot;services&quot;: {         &quot;logging&quot;: {             &quot;type&quot;: &quot;logging&quot;         },         &quot;storage&quot;: {             &quot;type&quot;: &quot;storage&quot;,             &quot;args&quot;: {                 &quot;backend&quot;: &quot;core&quot;             }         },         &quot;node&quot;: {             &quot;type&quot;: &quot;node&quot;,             &quot;args&quot;: {                 &quot;runlist&quot;: &quot;default&quot;             }         }     },     &quot;storages&quot;: {         &quot;core&quot;: {             &quot;type&quot;: &quot;files&quot;,             &quot;args&quot;: {                 &quot;path&quot;: &quot;\/var\/lib\/cocaine&quot;             }         },         &quot;cache&quot;: {             &quot;type&quot;: &quot;files&quot;,             &quot;args&quot;: {                 &quot;path&quot;: &quot;\/var\/cache\/cocaine&quot;             }         }     },     &quot;loggers&quot;: {         &quot;core&quot;: {             &quot;type&quot;: &quot;syslog&quot;,             &quot;args&quot;: {                 &quot;identity&quot;: &quot;cocaine&quot;,                 &quot;verbosity&quot;: &quot;info&quot;             }         }     } } <\/code><\/pre>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <b>2<\/b> \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ol>\n<li>\u0421\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0435\u043c (\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 <b>Elliptics<\/b>). \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <b>cocaine-runtime<\/b> \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0437 storage \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043f\u0440\u043e\u0444\u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 storage, \u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u0435, \u0447\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u0441\u043e\u0431\u043e\u0439.<\/li>\n<li>\u0417\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c <b>runtime<\/b> \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0435\u0431\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u043d\u043e\u0434\u0430\u043c \u043e\u0431\u043b\u0430\u043a\u0430.<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u0434\u043e\u0431\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u00ab\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <b>\/etc\/cocaine\/cocaine-cloud.conf<\/b>).<\/p>\n<p>  \u0417\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c <b>cocaine-runtime<\/b> \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u043d\u043e\u0434\u0430\u043c \u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u043c\u043e\u0436\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0441\u0435\u043a\u0446\u0438\u044e network \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441 <b>services<\/b>.<\/p>\n<pre><code class=\"bash\">  &quot;network&quot; : {         &quot;group&quot;: &quot;224.168.2.9&quot;    },   &quot;services&quot;: {   ...   } <\/code><\/pre>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>group<\/b> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 multicast-\u0433\u0440\u0443\u043f\u043f\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0430 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0439.<br \/>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f <b>storage<\/b> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441\u0435\u043a\u0446\u0438\u0439 <b>services\/storage<\/b> \u0438 <b>storages\/core<\/b>:<\/p>\n<pre><code class=\"javascript\">&quot;storage&quot;: {             &quot;type&quot;: &quot;elliptics&quot;         }, &quot;storages&quot; : {         &quot;core&quot;: {             &quot;type&quot;: &quot;elliptics&quot;,             &quot;args&quot;: {                 &quot;nodes&quot; : { \t\t\t&quot;192.168.50.201&quot; : 1025 \t\t}, \t\t&quot;io-thread-num&quot; : 8, \t\t&quot;wait-timeout&quot; : 30, \t\t&quot;check-timeout&quot; : 60, \t\t&quot;net-thread-num&quot; : 8, \t\t&quot;groups&quot; : [1], \t\t&quot;verbosity&quot; : 2             }         } } <\/code><\/pre>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 storage \u043d\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 <b>Elliptics<\/b> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c. \u041a \u0441\u043b\u043e\u0432\u0443, \u0432\u0441\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441\u0442\u0430\u0432\u044f\u0442\u0441\u044f \u0432 \/usr\/lib\/cocaine, \u0433\u0434\u0435 \u0438\u0445 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0449\u0435\u0442 <b>cocaine-runtime<\/b>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043a\u0430\u0438\u043d \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443. \u0421\u043e\u0437\u0434\u0430\u0435\u043c <br \/>  <code>\/etc\/default\/cocaine-runtime<\/code>:<br \/>  CONFIG_PATH=&quot;\/etc\/cocaine\/cocaine-cloud.conf&quot;<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c <b>cocaine-runtime<\/b> \u0441 \u043d\u043e\u0432\u044b\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c, \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/100\/ba6\/5b0\/100ba65b0a38f73bfdea562aefc8d724.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 <b>10053<\/b> \u0441\u0435\u0440\u0432\u0438\u0441-\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u044d\u0442\u043e\u0439 \u043d\u043e\u0434\u044b \u0431\u0443\u0434\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 DNS \u0434\u043b\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0443\u0434\u0430 \u043d\u0430\u0434\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b.<\/p>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 \u044d\u0442\u043e\u0439 \u043d\u043e\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>cocaine-tool info<\/code>. \u0412\u044b\u0432\u043e\u0434 \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043d\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u2014 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043a\u043e\u0440\u043e \u043e\u043d \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e <b>cocaine-runtime<\/b> \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 <b>Docker<\/b>. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u0442\u0430\u043a \u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/1e4\/337\/0f8\/1e43370f80c0376d6b0e2bfee89778d2.png\"\/><\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0418\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c <b>2<\/b> \u043c\u0430\u0448\u0438\u043d\u043a\u0438 \u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c <b>cocaine-runtime<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043c\u043e\u0442\u0440\u044f\u0442 \u0432 \u043e\u0431\u0449\u0438\u0439 <b>storage<\/b> \u2014 \u044d\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e!<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0443\u0436\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u043a\u0430 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043e\u0431\u043b\u0430\u043a\u043e, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435. \u0417\u0430\u0441\u0443\u0447\u0438\u0432 \u0440\u0443\u043a\u0430\u0432\u0430, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043a\u0430\u0438\u043d\u043e\u0432\u044b\u0439 storage. \u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <b>cocaine-tool<\/b>.<\/p>\n<p>  \u0421\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430.  <\/p>\n<pre><code class=\"bash\">git clone git@github.com:cocaine\/cocaine-framework-python.git -b v0.11 cd cocaine-framework-python\/examples\/flask\/ <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/46a\/310\/a46\/46a310a465b1552d8d327b036848fa18.png\"\/><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0437\u0434\u0435\u0441\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d <b>manifest.json<\/b>:  <\/p>\n<pre><code class=\"javascript\">{   &quot;slave&quot;: &quot;main.py&quot; } <\/code><\/pre>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c <b>environment<\/b>.<\/p>\n<p>  \u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  <\/p>\n<pre><code class=\"bash\">cocaine-tool app upload --name example <\/code><\/pre>\n<p>  <b>cocaine-tool<\/b> \u0437\u0430\u043f\u0430\u043a\u0443\u0435\u0442 \u0412\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0430\u0440\u0445\u0438\u0432 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/b24\/594\/b87\/b24594b87804db79016d49f41e12161c.png\"\/><\/p>\n<p>  \u0412\u043e\u0442 \u043e\u043d\u043e, \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435! \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <b>flask<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u043e\u0442 \u044d\u0442\u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.  <\/p>\n<pre><code class=\"bash\">sudo apt-get install python-flask <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0442\u0438\u043f \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u0438 \u0442\u0434. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u0438 \u0441\u043b\u0443\u0436\u0430\u0442 \u043f\u0440\u043e\u0444\u0438\u043b\u0438. \u041f\u0440\u043e\u0444\u0438\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u2014 \u043f\u0443\u0441\u0442\u043e\u0439 JSON <code>{}<\/code>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/github.com\/cocaine\/cocaine-core\/wiki\/profile\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438<\/a>. \u0411\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043b\u0435\u0435, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435.<\/p>\n<p>  \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0444\u0438\u043b\u044c <b>default<\/b> \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0435\u0433\u043e \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/d6b\/584\/2cb\/d6b5842cb31c7863af0d38b80d7578fc.png\"\/><\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043d\u0430\u0441\u0442\u0430\u043b \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0443\u0431\u0438\u043b\u044c\u043d\u0438\u043a \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f:  <\/p>\n<pre><code class=\"bash\">cocaine-tool app start --name example --profile default <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/b53\/140\/4f1\/b531404f191d0ac8708d4a2e243fb681.png\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c-\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>cocaine-tool info<\/code> \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f. \u0412 \u043d\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043d\u043e\u0434\u0435 \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python  from cocaine.services import Service app = Service(&quot;example&quot;) print(app.enqueue(&quot;write&quot;, &quot;DATA&quot;).get()) print(app.enqueue(&quot;read&quot;, &quot;DATA&quot;).get()) <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u0435, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0438 \u0442\u0430\u043c. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 <b>Docker<\/b>.<\/p>\n<h2>Docker-registry<\/h2>\n<p>  <b>Docker-registry<\/b> \u2014 \u044d\u0442\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 (\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u043d\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"http:\/\/docs.docker.io\/en\/latest\/reference\/api\/registry_index_spec\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 docker<\/a>.<\/p>\n<p>  <b>Docker-registry<\/b> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0435\u043a\u0435\u043d\u0434\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432. \u0410\u0441\u0441\u043e\u0440\u0442\u0438\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 \u043f\u0440\u043e\u0441\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0432 <b>Elliptics<\/b>.<\/p>\n<p>  \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <b>Docker-registry<\/b> \u2014 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Docker. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <b>Docker<\/b> (\u0441\u043c\u043e\u0442\u0440\u0438 \u0432\u044b\u0448\u0435) \u0438 \u0434\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437.  <\/p>\n<pre><code class=\"bash\">sudo docker run -p 5000:5000 registry <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0437 <b>registry<\/b> \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/ba6\/265\/205\/ba6265205da8913343a5f70b65de85c5.png\"\/><br \/>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <b>Docker-registry<\/b> \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u043f\u043e\u0440\u0442 <b>5000<\/b>. \u041f\u0438\u043d\u0433\u0443\u0435\u043c \u0435\u0433\u043e:  <\/p>\n<pre><code class=\"bash\">curl &quot;http:\/\/192.168.50.4:5000\/_ping&quot;  <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430.<\/p>\n<h2>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435<\/h2>\n<p>  \u0414\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043b\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u00ab\u043d\u0435\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u043e\u0433\u043e\u00bb. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c <b>Dockerfile<\/b>. \u041f\u043e \u0441\u0443\u0442\u0438 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 shell-\u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437 \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Docker-registry.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043b\u044e\u0431\u043e\u0439 <b>Docker<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0447\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043e\u0431\u0440\u0430\u0437 \u0438\u0437 registry. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <b>Dockerfile<\/b>, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c. \u0412\u043c\u0435\u0441\u0442\u043e Dockerfile \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c Chef-\u0440\u0435\u0446\u0435\u043f\u0442 \u0438\u043b\u0438 Puppet-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435.<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 Docker. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c.  <\/p>\n<pre><code class=\"javascript\">{     &quot;queue-limit&quot;: 1000,     &quot;pool-limit&quot;: 10,     &quot;isolate&quot;: {         &quot;type&quot;: &quot;docker&quot;,         &quot;args&quot;: {             &quot;memory_limit&quot;: 1000000000,             &quot;endpoint&quot;: &quot;unix:\/\/\/var\/run\/docker.sock&quot;,             &quot;registry&quot;: &quot;registry.cloud.net:5000&quot;,             &quot;cpu_shares&quot;: 0         }       },     &quot;concurrency&quot;: 200 } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0444\u0438\u043b\u044c \u043c\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0438\u043c\u0435\u043d\u0435\u043c docker-profile.json, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0435\u0433\u043e \u0441 \u0438\u043c\u0435\u043d\u0435\u043c docker-profile  <\/p>\n<pre><code class=\"bash\">cocaine-tool profile upload --name docker-profile --profile=docker-profile.json <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 Dockerfile, \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">sudo cocaine-tool app upload --docker=unix:\/\/\/var\/run\/docker.sock --registry=registry.cloud.net:5000 --manifest manifest-docker.json --name example-docker --timeout 20000 <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043d\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0432\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0441\u0435\u0442\u0438. \u041d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u043d\u0430\u0434\u043f\u0438\u0441\u044c. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/f33\/8cf\/998\/f338cf9980c765b798629917a1d7d4fa.png\"\/><\/p>\n<p>  \u0423\u043f\u0443\u0449\u0435\u043d \u0438\u0437 \u0432\u0438\u0434\u0443 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f cocaine-runtime \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0438 \u043a\u0430\u043a \u0443\u0437\u043d\u0430\u0451\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c <b>runlist<\/b>. \u041f\u043e \u0441\u0443\u0442\u0438 \u0441\u0432\u043e\u0435\u0439 \u044d\u0442\u043e\u0442 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0438\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <b>cocane-runtime<\/b> \u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435. \u041e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438, \u0432 <b>storage<\/b>. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0431\u043e\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u043e\u0434\u0430\u0445 \u043e\u0431\u043b\u0430\u043a\u0430 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u0438 \u0440\u0430\u043d\u043b\u0438\u0441\u0442\u044b \u043d\u0430 \u043d\u0438\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435. \u0418\u043c\u044f \u0440\u0430\u043d\u043b\u0438\u0441\u0442\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 <b>cocaine-runtime<\/b> \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 runlist \u0441\u0435\u0440\u0432\u0438\u0441\u0430 node.<\/p>\n<h2>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u043d\u043e\u0434\u044b<\/h2>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438 \u0441\u0432\u043e\u0435\u0439 \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043f\u0443\u043d\u043a\u0442 \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 cocaine-runtime\u00bb. \u042d\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0440\u043e\u043b\u0438 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u043d\u043e\u0434\u044b \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 <b>cocaine-runtime<\/b>. \u0412\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0435 \u0432 \u043d\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 <b>gateway plugin<\/b>. <\/p>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u041f\u0435\u0440\u0432\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b>adhoc<\/b>. \u041e\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0412\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043d\u0430\u043c\u0438 \u0432 \u0431\u043e\u0435\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b>ipvs<\/b>. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e. Adhoc \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <b>ipvs<\/b>. \u0418 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0432\u0448\u0443\u044e\u0441\u044f \u0432\u0430\u043c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e.<\/p>\n<p>  \u041e\u0442 \u0441\u043b\u043e\u0432 \u043a \u0434\u0435\u043b\u0443. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b:  <\/p>\n<pre><code class=\"bash\">sudo apt-get install cocaine-runtime libcocaine-core2 libcocaine-plugin-ipvs2 libcocaine-plugin-elliptics=2.24.14.31 elliptics-client=2.24.14.31 <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a1d\/dc5\/2d5\/a1ddc52d565b092445b61b47d7b1ebea.png\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <b>ipvs<\/b>, \u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0438\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0420\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0442\u044c <b>runtime<\/b> \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u043d\u043e\u0434\u043e\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u043e\u0431\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 <b>network<\/b> \u0441 \u043f\u043e\u0434\u0441\u0435\u043a\u0446\u0438\u0435\u0439 <b>gateway<\/b>. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0436\u0434\u0435, \u043f\u0440\u0430\u0432\u0438\u043c \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u00ab\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb. \u0421\u0435\u0440\u0432\u0438\u0441 <b>storage<\/b> \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443 \u2014 \u043e\u043d \u0441\u043a\u043e\u0440\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.  <\/p>\n<pre><code class=\"javascript\">    &quot;network&quot;: {         &quot;group&quot;: &quot;224.168.2.9&quot;,         &quot;gateway&quot;: {              &quot;type&quot;: &quot;ipvs&quot; \/\/ adhoc         }     },     &quot;services&quot;... <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 <code>sudo service cocane-runtime restart<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441:  <\/p>\n<pre><code class=\"bash\">cocaine \/usr\/bin\/cocaine-runtime --daemonize --configuration \/etc\/cocaine\/cocaine-gateway.conf --pidfile \/var\/run\/cocaine\/runtime.pid <\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 <b>gateway<\/b> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0435\u0449\u0435 \u0440\u044f\u0434 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (\u043e \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438).<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u043b\u043e\u0433 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 syslog). \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043d\u043e\u0434, \u0430 \u043f\u043e\u0442\u043e\u043c \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u043b\u0430\u0441\u044c. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0432\u0430\u0448\u0438\u043c\u0438 \u0431\u0435\u043a\u0435\u043d\u0434\u0430\u043c\u0438 \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e <b>discovery<\/b> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/516\/1b1\/b44\/5161b1b441b3c1d8a0fa0aacebc5bd65.png\"\/><\/p>\n<h2>Cocaine-native-proxy<\/h2>\n<p>  Cocaine-native-proxy \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e HTTP. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0435\u0451 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b.  <\/p>\n<pre><code class=\"bash\">apt-get install cocaine-native-proxy <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043d\u043e\u0434 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <b>locators<\/b>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u0430\u044f \u043d\u043e\u0434\u0430 \u043e\u0434\u043d\u0430. \u0421\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u043d\u043e\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043f\u043b\u043e\u0445\u043e \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043d\u043e\u0434\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u043e\u0434\u0430\u0445, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u043c\u0435\u0442\u044c \u043a \u043d\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/cocaine\/cocaine-native-proxy\/blob\/master\/README.md\">github.com\/cocaine\/cocaine-native-proxy\/blob\/master\/README.md<\/a>  <\/p>\n<pre><code class=\"javascript\">{     &quot;endpoints&quot;: [         &quot;0.0.0.0:8080&quot;     ],     &quot;backlog&quot;: 2048,     &quot;threads&quot;: 2,     &quot;application&quot;: {         &quot;locators&quot;: [&quot;192.168.50.103:10053&quot;],         &quot;service_pool&quot;: 5,         &quot;reconnect_timeout&quot;: 180,         &quot;request_timeout&quot;: 5     } } <\/code><\/pre>\n<p>  \u0422\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u044f\u0446\u0438\u0438 \u2014 \u043c\u0430\u0448\u0438\u043d\u0430 \u0441 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u0435\u0449\u0435\u0439 \u043d\u043e\u0434\u043e\u0439. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e HTTP \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u043d\u0430\u0440\u0443\u0436\u0443 \u0447\u0435\u0440\u0435\u0437 <b>cocaine-native-proxy<\/b>, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u0430 \u043f\u0440\u043e\u043a\u0441\u0438 \u0442\u043e\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043d\u043e\u0434\u0443. \u041c\u044b \u0435\u0451 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 locators. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0437\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. HTTP \u043a\u043b\u0438\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f <b>http<\/b>, \u0430 \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 Python \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f <b>write<\/b> \u0438 <b>read<\/b>.<\/p>\n<p>  \u0412 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c \u043a\u043e\u0434\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 192.168.50.103.  <\/p>\n<pre><code class=\"python\"> #!\/usr\/bin\/env python  from cocaine.services import Service app = Service(&quot;example&quot;, host=&quot;192.168.50.103&quot;) print(app.enqueue(&quot;write&quot;, &quot;DATA&quot;).get()) print(app.enqueue(&quot;read&quot;, &quot;DATA&quot;).get()) <\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f http \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 flask. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432 HTTP-proxy \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0432 \u043a\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u043e\u0441\u043b\u0430\u0442\u044c. \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 URL \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443: <code>\/&lt;appname&gt;\/&lt;eventname&gt;\/tail?arg=1&args=2<\/code>. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e URL \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435. \u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043d \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442 \u0432 \u0432\u0438\u0434\u0435 <code>\/tail?arg=1&args=2<\/code>. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<p>  \u041f\u0440\u0438 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 <b>X-Cocaine-Service, X-Cocaine-Event<\/b>. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <b>nginx<\/b>.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438:  <\/p>\n<pre><code class=\"bash\">curl &quot;http:\/\/localhost:8080\/read&quot; -H &quot;X-Cocaine-Service: example&quot; -H &quot;X-Cocaine-Event: http&quot; curl &quot;http:\/\/localhost:8080\/example\/http\/read&quot; <\/code><\/pre>\n<h2>\u0411\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041d\u0430\u0448\u0435 \u043e\u0431\u043b\u0430\u043a\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u0418\u0434\u0435\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0438\u043c \u0432\u0435\u0441\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0433\u0440\u0443\u043f\u043f\u044b. \u0410 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0433\u0440\u0443\u043f\u043f\u044b \u0432\u044b\u0431\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u043d \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0432\u0435\u0441\u0430. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0420\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044f \u0435\u0439, \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e, \u043f\u043e\u0434\u0430\u0432\u0430\u044f \u043d\u0430 \u043d\u0438\u0445 \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (\u0441\u043a\u0430\u0436\u0435\u043c, 5%). \u0410 \u0437\u0430\u0442\u0435\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u044d\u0442\u0443 \u0434\u043e\u043b\u044e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u0435\u0434\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0431\u0430\u0433\u0430 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043b\u0435\u0433\u043a\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043b\u0438\u0448\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <b>example<\/b>, \u0441\u043a\u0430\u0436\u0435\u043c <b>exampleGroup<\/b>. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <b>example<\/b> \u0441 \u0432\u0435\u0441\u043e\u043c <b>1000<\/b>. \u0418 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043c \u043d\u043e\u0434\u0443 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438 \u0433\u0440\u0443\u043f\u043f. \u0412 \u043b\u043e\u0433\u0430\u0445 \u044d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0437\u0430\u043f\u0438\u0441\u0438   <\/p>\n<pre><code class=\"javascript\">service\/locator: adding group 'exampleGroup'<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/eb0\/f31\/75a\/eb0f3175aa4ff104ba55e555836eca0b.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <b>exampleGroup<\/b>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0432 app.py \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u0440\u0443\u0447\u043a\u0435 hello:  <\/p>\n<pre><code class=\"python\"> @app.route('\/') def hello(name=None):     return &quot;HELLO! I'm version #2&quot; <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043b\u044c\u0451\u043c \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0438 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u0433\u0440\u0443\u043f\u043f\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <b>example2<\/b>.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/506\/3fb\/239\/5063fb239fc7da008bd2ceed7fa65be7.png\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0435\u0440\u0433\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435  <\/p>\n<pre><code class=\"bash\">curl &quot;http:\/\/localhost:8080\/exampleGroup\/http\/&quot; <\/code><\/pre>\n<p>  \u0422\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0447\u0435\u0440\u0435\u0434\u0443\u044e\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0441 <b>example2<\/b> \u0440\u0430\u0432\u043d\u044b\u043c <b>0<\/b>, \u0442\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043d\u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 HTTP-proxy \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u0438\u0434\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041e\u043d\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 HTTP-proxy \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u043a\u043e\u0434, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435 \u0441\u0440\u0430\u0437\u0443.<\/p>\n<h2>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e, \u043a\u0430\u043a \u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u043e\u0432\u0430\u0440 \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u0441\u043f\u0430\u0433\u0435\u0442\u0442\u0438, \u043c\u044b \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043a\u043e\u043a\u0430\u0438\u043d\u043e\u0432\u043e\u0435 \u043e\u0431\u043b\u0430\u043a\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f Cocaine \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 c\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a. \u041d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/company\/yandex\/blog\/214069\/\"> http:\/\/habrahabr.ru\/company\/yandex\/blog\/214069\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041c\u044b \u0443\u0436\u0435 <a href=\"http:\/\/habrahabr.ru\/company\/yandex\/blog\/209324\/\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438<\/a> \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043f\u0440\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0438\u0448\u0451\u043b \u0447\u0435\u0440\u0451\u0434 \u043e\u0442 \u0441\u043b\u043e\u0432 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0434\u0435\u043b\u0443 \u2014 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0431\u043b\u0430\u043a\u043e \u043d\u0430 Elliptics \u0438 Cocaine.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/company\/yandex\/blog\/214069\/\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e40\/0ef\/ca5\/e400efca5a67bf741ae2ee2468bffbbd.jpg\"\/><br \/>  <\/a>  <\/p>\n<h2>\u0421\u0445\u0435\u043c\u0430<\/h2>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u043b\u0430\u0447\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <a href=\"https:\/\/github.com\/cocaine\/cocaine-framework-python\/tree\/v0.11\/examples\/flask\">\u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 <b>flask<\/b>. <\/p>\n<p>  \u042d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043a\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<ul>\n<li><b>cocaine-runtime<\/b>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 Docker;<\/li>\n<li><b>Docker-registry<\/b> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439;<\/li>\n<li><b>Elliptics<\/b> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u043b\u0430\u043a\u0430;<\/li>\n<li><b>\u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u043d\u043e\u0434\u0430 cocaine-runtime<\/b> \u2014 \u0435\u0434\u0438\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043a\u0430\u0438\u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430;<\/li>\n<li><b>HTTP-frontend<\/b> \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c.<\/li>\n<\/ul>\n<p>  <\/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-214069","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/214069","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=214069"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/214069\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=214069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=214069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=214069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}