{"id":261871,"date":"2015-07-20T14:35:02","date_gmt":"2015-07-20T10:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=261871"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=261871","title":{"rendered":"HA-Cluster \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Pacemaker \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e LXC \u0438 Docker"},"content":{"rendered":"<p>             \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 Active\/Active \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Pacemaker, Corosync 2.x \u0438 CLVM \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 LXC \u0438 Docker. \u041e\u043f\u0438\u0448\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c. \u0418 \u043f\u0440\u0438\u043f\u043e\u043c\u043d\u044e \u0442\u0435 \u0433\u0440\u0430\u0431\u043b\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043b\u044f\u043f\u0430\u043b\u0441\u044f, \u0447\u0442\u043e, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442 \u0441\u0443\u0434\u044c\u0431\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0446\u0430\u043c.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CentOS 7 + epel \u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u043d\u0438\u0445. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Pacemaker-\u043e\u043c \u0431\u0443\u0434\u0435\u0442 PCS (pacemaker\/corosync configuration system).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c26\/72b\/d5b\/c2672bd5b53045b09bbe6e5e7db04dbb.png\"\/><\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<ol>\n<li><a href=\"#ha-1\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432<\/a><\/li>\n<li><a href=\"#ha-2\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Pacemaker \u0438 CLVM<\/a><\/li>\n<li><a href=\"#ha-3\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 LXC \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/a><\/li>\n<li><a href=\"#ha-4\">\u041f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 OpenVZ \u0432 LXC<\/a><\/li>\n<li><a href=\"#ha-5\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Docker-\u043e\u043c \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/a><\/li>\n<li><a href=\"#ha-6\">\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430<\/a><\/li>\n<li><a href=\"#ha-7\">\u0421\u0441\u044b\u043b\u043a\u0438<\/a><\/li>\n<\/ol>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432<\/h2>\n<p>  \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438\u0437 \u0434\u0432\u0443\u0445 \u0443\u0437\u043b\u043e\u0432, \u043d\u043e \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438. \u0421\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0431\u0449\u0435\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0435 \u043f\u043e SAS. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u043e\u0435 FC \u0438\u043b\u0438 iSCSI. \u041f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u043e\u043c\u0430, \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u043e\u0431\u0449\u0438\u0445 \u043d\u0443\u0436\u0434, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f Docker-\u0430. \u041c\u043e\u0436\u043d\u043e \u043e\u0434\u0438\u043d \u0442\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0430.<br \/>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c CentOS 7, epel \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0442\u044c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 bonding-\u0430 \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 multipath \u0434\u043b\u044f SAS \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 vlan-\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0441\u0442\u044b br0.VID, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 LXC. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443 \u2013 \u0432\u0441\u0451 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e.<\/p>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b LXC \u0438 Docker <a href=\"https:\/\/access.redhat.com\/articles\/881893\" title=\"https:\/\/access.redhat.com\/articles\/881893\">\u043d\u0443\u0436\u043d\u043e<\/a> \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0448\u0442\u0430\u0442\u043d\u044b\u0439 firewald.  <\/p>\n<pre><code class=\"bash\"># systemctl stop firewalld.service # systemctl disable firewalld.service # setenforce Permissive <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c selinux \u0432 \u0440\u0435\u0436\u0438\u043c <b>permissive<\/b>, \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0441\u043c\u0435\u043b\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442\u043b\u0430\u0434\u0438\u043c, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c \u043d\u0430\u0437\u0430\u0434, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c.<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u0432\u043d\u0435\u0441\u0451\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u0438\u043c\u0435\u043d\u0430 \u0432 <b>\/etc\/hosts<\/b> \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445:  <\/p>\n<pre><code class=\"bash\">#nodes, vlan 10 10.1.0.1      cluster-1 10.1.0.2      cluster-2  #nodes ipmi, vlan 314 10.1.15.1      ipmi-1 10.1.15.2      ipmi-2  #docker, vlan 12 10.1.2.10       docker 10.1.2.11       dregistry <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c STONITH (\u00abShoot The Other Node In The Head\u00bb), \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c ipmi. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>ipmitool<\/b>:  <\/p>\n<pre><code class=\"bash\"># ipmitool shell  impitool&gt; user set name 2 admin impitool&gt; user set password 2 '\u043e\u0447\u0435\u043d\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c'  # &lt;uid&gt; &lt; privilege level&gt; &lt;channel number&gt;) impitool&gt; user priv 2 4 1 <\/code><\/pre>\n<p>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f admin (id=2) \u0438 \u0434\u0430\u0451\u043c \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 (livel=4) \u043d\u0430 \u043a\u0430\u043d\u0430\u043b \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c (channel=1).<\/p>\n<p>  \u0421\u0435\u0442\u044c \u0434\u043b\u044f ipmi \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 vlan, \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0435\u0451 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043e \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c\u044e, \u0435\u0441\u043b\u0438 IPMI BMC (baseboard management controller) \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.  <\/p>\n<pre><code class=\"bash\">impitool&gt; lan set 1 ipsrc static impitool&gt; lan set 1 ipaddr 10.1.15.1 impitool&gt; lan set 1 netmask 255.255.255.0 impitool&gt; lan set 1 defgw ipaddr 10.1.15.254 impitool&gt; lan set 1 vlan id 314 # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430: impitool&gt; lan set 1 access on impitool&gt; lan set 1 auth ADMIN MD5 ipmitool&gt; channel setaccess 1 2 callin=on ipmi=on link=on privilege=4 <\/code><\/pre>\n<p>\u041d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0437\u043b\u0430\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e IP \u0440\u0430\u0437\u043d\u044b\u0435.<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\"># ipmitool -I lan -U admin -P '\u043e\u0447\u0435\u043d\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c' -H 10.1.15.1 bmc info <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Pacemaker \u0438 CLVM<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Pacemaker, \u0442\u043e \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0433\u043e. \u0425\u043e\u0440\u043e\u0448\u043e \u0438 \u043f\u043e \u0440\u0443\u0441\u0441\u043a\u0438 \u043f\u0440\u043e Pacemaker <a href=\"http:\/\/wiki.525.su\/doku.php?id=pacemaker_theory\" title=\"Pacemaker, \u0442\u0435\u043e\u0440\u0438\u044f\">\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0443\u0442<\/a>.<br \/>  \u041d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u0438\u0437 epel \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f:  <\/p>\n<pre><code class=\"bash\"># yum install pacemaker pcs resource-agents  <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 hacluster. \u041f\u043e\u0434 \u044d\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <b>PCS<\/b>, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"bash\">echo CHANGEME | passwd --stdin hacluster  <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435. <br \/>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"bash\"># pcs cluster auth cluster-1 cluster-2 -u hacluster -p CHANGEME --force  <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u201cCluster\u201d \u0438\u0437 \u0434\u0432\u0443\u0445 \u0443\u0437\u043b\u043e\u0432:  <\/p>\n<pre><code class=\"bash\"># pcs cluster setup --force --name Cluster cluster-1 cluster-2 # pcs cluster start --all  <\/code><\/pre>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"bash\"># pcs cluster status Cluster Status:  Last updated: Wed Jul  8 14:16:32 2015  Last change: Wed Jul  8 10:01:20 2015  Stack: corosync  Current DC: cluster-1 (1) - partition with quorum  Version: 1.1.12-a14efad  2 Nodes configured  17 Resources configured (\u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u043f\u0435\u0440\u0435\u0434\u0438)  PCSD Status:   cluster-1: Online   cluster-2: Online <\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441, \u0435\u0441\u043b\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d https_proxy, \u0442\u043e <b>pcs<\/b> \u043c\u043e\u0436\u0435\u0442 \u0432\u0440\u0430\u0442\u044c \u043e \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u0443\u0437\u043b\u043e\u0432, \u0432\u0438\u0434\u0438\u043c\u043e \u043f\u044b\u0442\u0430\u044f\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043a\u0441\u044e.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0434\u0435\u043c\u043e\u043d <b>pcsd<\/b>:  <\/p>\n<pre><code class=\"bash\"># systemctl start pcsd # systemctl enable pcsd <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>&quot;https:\/\/ip_\u0443\u0437\u043b\u0430:2224&quot;<\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4ff\/db1\/3f1\/4ffdb13f1d9e435b80b43ff20a268ff9.png\"\/><\/p>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041c\u0435\u043b\u043e\u0447\u044c, \u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u043e.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0443\u0437\u043b\u0430 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430, \u0442\u043e \u043a\u0432\u043e\u0440\u0443\u043c\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u0443 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"bash\"># pcs property set no-quorum-policy=ignore  <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0430\u0432\u0442\u043e-\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0443\u0437\u043b\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 <b>pacemaker<\/b>:  <\/p>\n<pre><code class=\"bash\"># systemctl enable pacemaker <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b CLVM \u0438 GFS2 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c DLM (Distributed Lock Manager). \u0418 CLVM \u0438 DLM \u0432 RHEL7 (CentOS 7) \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u044b \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b DLM \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f STONITH, \u0438\u043d\u0430\u0447\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c:  <\/p>\n<pre><code class=\"bash\"># pcs property set stonith-enabled=true # pcs stonith create cluster-1.stonith fence_ipmilan ipaddr=&quot;ipmi-1&quot; passwd=&quot;\u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0430 ipmi&quot; login=&quot;admin&quot; action=&quot;reboot&quot; method=&quot;cycle&quot; pcmk_host_list=cluster-1 pcmk_host_check=static-list stonith-timeout=10s op monitor interval=10s # pcs stonith create cluster-2.stonith fence_ipmilan ipaddr=&quot;ipmi-2&quot; passwd=&quot;\u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0430 ipmi&quot; login=&quot;admin&quot; action=&quot;reboot&quot; method=&quot;cycle&quot; pcmk_host_list=cluster-2 pcmk_host_check=static-list stonith-timeout=10s op monitor interval=10s # pcs constraint location cluster-1.stonith avoids cluster-1=INFINITY # pcs constraint location cluster-2.stonith avoids cluster-2=INFINITY <\/code><\/pre>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a, <a href=\"http:\/\/habrahabr.ru\/post\/200348\/\" title=\"pacemaker: \u043a\u0430\u043a \u0434\u043e\u0431\u0438\u0442\u044c \u043b\u0435\u0436\u0430\u0447\u0435\u0433\u043e\">\u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0443\u0442<\/a>. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0434\u0432\u0430 stonith \u0440\u0435\u0441\u0443\u0440\u0441\u0430, \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0441\u0432\u043e\u0439 \u0443\u0437\u0435\u043b \u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0443\u0437\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u0441\u0442\u0440\u0435\u043b\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<br \/>  \u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0431\u043e\u044f:  <\/p>\n<pre><code class=\"bash\"># pcs resource defaults migration-threshold=1  <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0441\u0443\u0440\u0441, \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0438\u0439 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0437\u0435\u043b \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0431\u043e\u044f, \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u043d\u0430\u0437\u0430\u0434, \u043f\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0443\u0437\u043b\u0430 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c:  <\/p>\n<pre><code class=\"bash\">#  pcs resource defaults resource-stickiness=100 <\/code><\/pre>\n<p>\u0413\u0434\u0435 \u00ab100\u00bb \u044d\u0442\u043e \u043d\u0435\u043a\u0438\u0439 \u0432\u0435\u0441, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e Pacemaker \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432 \u0440\u0430\u0437\u0433\u0430\u0440 \u0441\u043c\u0435\u043b\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u0437\u043b\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0435\u043b\u044f\u043b\u0438 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043d\u0430 \u043e\u0442\u043a\u0430\u0437 \u0440\u0435\u0441\u0443\u0440\u0441\u0430:  <\/p>\n<pre><code class=\"bash\"># pcs resource op defaults on-fail=restart <\/code><\/pre>\n<p>\u0418\u043d\u0430\u0447\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 stonith, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430 \u043e\u0442\u043a\u0430\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u00abstop\u00bb.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c CLVM \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435:  <\/p>\n<pre><code class=\"bash\"># yum install lvm2 lvm2-cluster <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c LVM \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435:  <\/p>\n<pre><code class=\"bash\"># lvmconf --enable-cluster <\/code><\/pre>\n<p>  \u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b <b>dlm<\/b> \u0438 <b>clvmd<\/b> \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435:  <\/p>\n<pre><code class=\"bash\"># pcs resource create dlm ocf:pacemaker:controld op monitor interval=30s on-fail=fence clone interleave=true ordered=true # pcs resource create clvmd ocf:heartbeat:clvm op monitor interval=30s on-fail=fence clone interleave=true ordered=true <\/code><\/pre>\n<p>\u042d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441\u0431\u043e\u044f \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0451\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 stonith (<b>on-fail=fence<\/b>). \u0420\u0435\u0441\u0443\u0440\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u043d \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c (<b>clone<\/b>). \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u0430 \u043d\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e (<b>ordered=true<\/b>). \u0415\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 clone-\u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u043e \u043d\u0435 \u0436\u0434\u0451\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0441\u0435\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445, \u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0443\u0435\u043c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c (<b>interleave=true<\/b>). \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0430 clone-\u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0443 \u043d\u0430\u0441 \u0435\u0449\u0451 \u0431\u0443\u0434\u0443\u0442. <\/p>\n<p>  \u0417\u0430\u0434\u0430\u0451\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c <b>clvmd<\/b> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 <b>dlm<\/b>. \u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u043e\u0435 \u0438\u043c\u044f <b>*-clone<\/b>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0443\u0437\u043b\u0435:  <\/p>\n<pre><code class=\"bash\"># pcs constraint order start dlm-clone then clvmd-clone # pcs constraint colocation add clvmd-clone with dlm-clone <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 <b>clvmd-clone<\/b> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <b>dlm-clone<\/b> \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u0443\u0445 \u0443\u0437\u043b\u043e\u0432 \u044d\u0442\u043e \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u043c, \u043d\u043e \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <b>*-clone<\/b> \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0437\u043b\u043e\u0432 \u0438 \u0442\u043e\u0433\u0434\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c.<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043e\u043d\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445, \u0438 \u0435\u0441\u043b\u0438 \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e, \u0442\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u043e\u043c\u043e\u0432 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. clvmd \u043f\u0440\u043e\u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442 \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432\u0441\u0435 \u0443\u0437\u043b\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435.<br \/>  \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 LVM:  <\/p>\n<pre><code class=\"bash\"># pvcreate \/dev\/mapper\/mpatha1 # pvcreate \/dev\/mapper\/mpatha2 <\/code><\/pre>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u043c LVM \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c, \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u0430 \u0442\u043e\u043c\u043e\u0432 (VG) \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u0430\u044f, \u0442\u043e \u0435\u0451 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 clvmd. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0433\u0440\u0443\u043f\u043f\u044b \u0442\u043e\u043c\u043e\u0432:  <\/p>\n<pre><code class=\"bash\"># vgcreate --clustered y shared_vg \/dev\/mapper\/mpatha1 # vgcreate --clustered y shared_vg-ex \/dev\/mapper\/mpatha2 <\/code><\/pre>\n<p>  \u041e\u0431\u0449\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u043c \u0435\u0433\u043e \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u0420\u0435\u0441\u0443\u0440\u0441 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f Pacemaker-\u0430, \u044d\u0442\u043e \u043b\u044e\u0431\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430, \u043f\u0440\u043e\u0446\u0435\u0441\u0441, ip-\u0430\u0434\u0440\u0435\u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438. \u0421\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 init-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 start, stop, monitor \u0438 \u0442\u043f. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u2013 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0443, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c\u0443 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435, \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u0433\u0440\u0443\u043f\u043f\u044b shared_vg \u0438 \u043b\u044e\u0431\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e; \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u0443\u0437\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043d\u0430 GFS2. \u0417\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0441\u043b\u0435\u0434\u0438\u0442 Pacemaker, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b GFS2. \u0413\u0440\u0443\u043f\u043f\u0430 shared_vg-ex \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0434\u0430\u043d\u0430 \u043f\u043e\u0434 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u0434\u043b\u044f Docker-\u0430. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Docker \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043c (thin provisioned), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u044d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435. \u0410 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u043e\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 LXC \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/h2>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b lxc-*, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u043f\u0430\u043a\u0435\u0442 <b>lxc<\/b>. \u0421\u0442\u0430\u0432\u0438\u043c:  <\/p>\n<pre><code class=\"bash\"># yum install lxc lxc-templates <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"bash\"># cat \/etc\/lxc\/default.conf lxc.start.auto  = 0 lxc.network.type = veth lxc.network.link = br0.10 lxc.network.flags = up # memory and swap lxc.cgroup.memory.limit_in_bytes = 256M lxc.cgroup.memory.memsw.limit_in_bytes = 256M <\/code><\/pre>\n<p>\u0422\u0438\u043f \u0441\u0435\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 <b>veth<\/b> \u2013 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 eth0, \u0432\u043d\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0446\u0435\u043f\u043b\u0435\u043d \u043a \u043c\u043e\u0441\u0442\u0443 <b>br0.10<\/b>. \u0418\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0443 \u043d\u0430\u0441 \u0432 \u0445\u043e\u0434\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0445 \u0438 \u0443\u043a\u0430\u0436\u0435\u043c. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u044f\u0434\u0440\u043e\u043c, \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 <b>lxc.cgroup.state-object-name=value<\/b>. \u0422\u0430\u043a \u0436\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043b\u0435\u0442\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>lxc-cgroup<\/b>. \u041d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/sys\/fs\/cgroup\/TYPE\/lxc\/CT-NAME\/object-name<\/code>.<br \/>  \u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c Pacemaker, \u043f\u043e\u0442\u043e\u043c\u0443 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u044f\u0432\u043d\u043e.<\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 LXC \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0436\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0451\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0442\u043e\u043c\u0435 \u0433\u0440\u0443\u043f\u043f\u044b shared_vg. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u043c\u044f VG \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:  <\/p>\n<pre><code class=\"bash\"># cat \/etc\/lxc\/lxc.conf lxc.bdev.lvm.vg = shared_vg <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u043e\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0443\u0437\u043b\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u0424\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u0449\u0438\u0435, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u0449\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445:  <\/p>\n<pre><code class=\"bash\"># lvcreate -L 500M -n lxc_ct shared_vg # mkfs.gfs2 -p lock_dlm -j 2 -t Cluster:lxc_ct \/dev\/shared_vg\/lxc_ct <\/code><\/pre>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a <b>lock_dlm<\/b>, \u0442\u0430\u043a \u043a\u0430\u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043e\u0431\u0449\u0435\u0435. \u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0434\u0432\u0430 \u0436\u0443\u0440\u043d\u0430\u043b\u0430, \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0443\u0437\u043b\u043e\u0432 (<b>-j2<\/b>). \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0438\u043c\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a, \u0433\u0434\u0435 <b>Cluster<\/b> \u2014 \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<pre><code class=\"bash\"># pcs resource create fs-lxc_ct Filesystem fstype=gfs2 device=\/dev\/shared_vg\/lxc_ct directory=\/var\/lib\/lxc clone ordered=true interleave=true # pcs constraint order start clvmd-clone then fs-lxc_ct-clone <\/code><\/pre>\n<p>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 clone-\u0440\u0435\u0441\u0443\u0440\u0441, \u0442\u0438\u043f\u0430 <b>Filesystem<\/b>, \u043f\u043e\u043b\u044f <b>device<\/b> \u0438 <b>directory<\/b> \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0447\u0442\u043e \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043a\u0443\u0434\u0430. \u0418 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u0435\u0437 clvmd \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u0433\u0434\u0435 LXC \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f. <\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440:  <\/p>\n<pre><code class=\"bash\"># lxc-create -n lxc-racktables -t oracle -B lvm --fssize 2G --fstype ext4 --vgname shared_vg -- -R 6.6 <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c <b>lxc-racktables<\/b> \u2014 \u0438\u043c\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, <b>oracle<\/b> \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d. <b>-B<\/b> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0438\u043f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. <b>lxc-create<\/b> \u0441\u043e\u0437\u0434\u0430\u0441\u0442 LVM \u0440\u0430\u0437\u0434\u0435\u043b \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0451\u0442 \u0442\u0443\u0434\u0430 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443. \u041f\u043e\u0441\u043b\u0435 &quot;&#8212;&quot; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0432\u0435\u0440\u0441\u0438\u044f.<br \/>  \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f centos \u043d\u0430 lvm \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u043e \u043c\u0435\u043d\u044f \u0443\u0441\u0442\u0440\u043e\u0438\u043b \u0438 oracle.<br \/>  \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u0431\u0430\u0437\u0435 deb \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <b>debootstrap<\/b>. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <code>\/var\/cache\/lxc\/<\/code> \u0438 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 lxc-create \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439. \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u0443\u0434\u043e\u0431\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d, \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u043c\u0438. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0442\u0443\u0442: <code>\/usr\/share\/lxc\/templates<\/code>.<br \/>  \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d &quot;<b>download<\/b>&quot;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0443\u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0432\u044b \u0441\u0438\u0441\u0442\u0435\u043c.<\/p>\n<p>  \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0433\u043e\u0442\u043e\u0432. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 lxc-*. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432 \u0444\u043e\u043d\u0435, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:  <\/p>\n<pre><code class=\"bash\"># lxc-start -n lxc-racktables -d # lxc-info -n  lxc-racktables Name:           lxc-racktables State:          RUNNING PID:            9364 CPU use:        0.04 seconds BlkIO use:      0 bytes Memory use:     1.19 MiB KMem use:       0 bytes Link:           vethS7U8J1  TX bytes:      90 bytes  RX bytes:      90 bytes  Total bytes:   180 bytes # lxc-stop -n lxc-racktables <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043b\u0438\u0431\u043e \u0432 \u0435\u0433\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>lxc-console<\/b>, \u043b\u0438\u0431\u043e \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c lvm \u0440\u0430\u0437\u0434\u0435\u043b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Pacemaker-\u0443. \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0441\u0432\u0435\u0436\u0438\u0439 \u0440\u0435\u0441\u0443\u0440\u0441-\u0444\u0430\u0439\u043b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441 <b>GitHub<\/b>-\u0430:  <\/p>\n<pre><code class=\"bash\"># wget -O \/usr\/lib\/ocf\/resource.d\/heartbeat\/lxc https:\/\/raw.githubusercontent.com\/ClusterLabs\/resource-agents\/master\/heartbeat\/lxc # chmod +x \/usr\/lib\/ocf\/resource.d\/heartbeat\/lxc <\/code><\/pre>\n<p>  \u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <code>\/usr\/lib\/ocf\/resource.d\/<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u0439\u043b\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 provider\/type. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>pcs resource list<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u2014 <code>pcs resource describe &lt;standard:provider:type|type&gt;<\/code>.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"> # pcs resource describe ocf:heartbeat:lxc ocf:heartbeat:lxc - Manages LXC containers  Allows LXC containers to be managed by the cluster. If the container is running &quot;init&quot; it will also perform an orderly shutdown. It is 'assumed' that the 'init' system will do  an orderly shudown if presented with a 'kill -PWR' signal. On a 'sysvinit' this would require the container to have an inittab file containing &quot;p0::powerfail:\/sbin\/init 0&quot; I  have absolutly no idea how this is done with 'upstart' or 'systemd', YMMV if your container is using one of them. Resource options:   container (required): The unique name for this 'Container Instance' e.g. 'test1'.   config (required): Absolute path to the file holding the specific configuration for this container e.g. '\/etc\/lxc\/test1\/config'.   log: Absolute path to the container log file   use_screen: Provides the option of capturing the 'root console' from the container and showing it on a separate screen. To see the screen output run 'screen -r {container               name}' The default value is set to 'false', change to 'true' to activate this option <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441:  <\/p>\n<pre><code class=\"bash\"># pcs resource create lxc-racktables lxc container=lxc-racktables config=\/var\/lib\/lxc\/lxc-racktables\/config # pcs constraint order start fs-lxc_ct-clone then lxc-racktables <\/code><\/pre>\n<p> \u0418 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<br \/>  \u0420\u0435\u0441\u0443\u0440\u0441 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>pcs status<\/code>. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0435 \u0443\u0434\u0430\u043b\u0441\u044f, \u0442\u043e \u0442\u0430\u043c \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>pcs resource debug-start &ltresource id&gt<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:  <\/p>\n<pre><code class=\"bash\"># pcs resource debug-start lxc-racktables Operation start for lxc-racktables (ocf:heartbeat:lxc) returned 0  &gt;  stderr: DEBUG: State of lxc-racktables: State:          STOPPED  &gt;  stderr: INFO: Starting lxc-racktables  &gt;  stderr: DEBUG: State of lxc-racktables: State:          RUNNING  &gt;  stderr: DEBUG: lxc-racktables start : 0 <\/code><\/pre>\n<p>  \u041d\u043e \u0441 \u043d\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u0435\u0435, \u043e\u043d\u0430 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0443\u0437\u043b\u0435. \u0418 \u0435\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0437\u043b\u0435, \u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u0438. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <code>&quot;--full&quot;<\/code> \u0432\u044b\u0434\u0430\u0441\u0442 \u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<br \/>  \u0425\u043e\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c Pacemaker, \u043d\u043e \u0441 \u043d\u0438\u043c \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435\u043c\u0438 <b>lxc-*<\/b> \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0443\u0437\u043b\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0441 \u043e\u0433\u043b\u044f\u0434\u043a\u043e\u0439 \u043d\u0430 Pacemaker.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440-\u0440\u0435\u0441\u0443\u0440\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0437\u0435\u043b, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432:  <\/p>\n<pre><code class=\"bash\"># pcs resource move &ltresource id&gt [destination node] <\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435, \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443 LXC \u043d\u0435\u0442 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0436\u0438\u0432\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043d\u0430 GFS2, \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043c\u043f\u044b \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442 lxc, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 migrate_to \u0438 migrate_from.<br \/>  \u041f\u0440\u043e\u0435\u043a\u0442 <a href=\"http:\/\/criu.org\/Main_Page\" title=\"http:\/\/criu.org\/Main_Page\">CRIU<\/a> \u044f \u0441\u043c\u043e\u0442\u0440\u0435\u043b, \u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 CentOS 7 \u043d\u0435 \u0441\u0443\u043c\u0435\u043b.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 OpenVZ \u0432 LXC<\/h3>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0442\u0443\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 OpenVZ (\u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0433\u043e):  <\/p>\n<pre><code class=\"bash\"># lvcreate -L 2G -n lxc-openvz shared_vg # mkfs.ext4 \/dev\/shared_vg\/lxc-openvz # mount \/dev\/shared_vg\/lxc-openvz \/mnt\/lxc-openvz # rsync -avh --numeric-ids -e 'ssh' openvz:\/vz\/private\/&lt;containerid&gt;\/ \/mnt\/lxc-openvz\/ <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u043a\u043e\u043f\u0438\u0440\u0443\u044f \u0438 \u043c\u0435\u043d\u044f\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 lxc-racktables:  <\/p>\n<pre><code class=\"bash\"># mkdir \/var\/lib\/lxc\/lxc-openvz # cp \/var\/lib\/lxc\/lxc-racktables\/config \/var\/lib\/lxc\/lxc-openvz\/ <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u044f:  <\/p>\n<pre><code class=\"bash\">lxc.rootfs = \/dev\/shared_vg\/lxc-openvz lxc.utsname = openvz #lxc.network.hwaddr <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043c\u043e\u0441\u0442. \u0422\u0430\u043a \u0436\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0442\u0438, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0432 \u0438\u0445 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <b>eth0<\/b> \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b <code>etc\/sysconfig\/network<\/code>.<\/p>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c, \u043d\u043e \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 LXC \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 centos (<code>\/usr\/share\/lxc\/templates\/lxc-centos<\/code>), \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>configure_centos<\/code> \u0438 <code>configure_centos_init<\/code> \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439. \u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>etc\/init\/power-status-changed.conf<\/code>, \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443. \u041b\u0438\u0431\u043e <b>inittab<\/b> \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432\u0438\u0434\u0430: <code>&quot;p0::powerfail:\/sbin\/init 0&quot;<\/code>(\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430).  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/init\/power-status-changed.conf<\/b><\/p>\n<div class=\"spoiler_text\"># power-status-changed \u2014 shutdown on SIGPWR<br \/>  #<br \/>  start on power-status-changed<\/p>\n<p>  exec \/sbin\/shutdown -h now \u00abSIGPWR received\u00bb<\/p><\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u043b\u0435\u043d\u044c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u043c\u0443 (\u0430 \u0437\u0440\u044f), \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/Lelik13a\/LXC\/blob\/master\/convert_centos_vz_to_lxc-ct.sh\">\u043c\u043e\u0438\u043c<\/a> (\u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a). MAC \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<br \/>  \u0423 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e \u2014 \u0435\u0451 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <code>lxc-console<\/code>. \u0421\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u044f \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0435\u0448\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <b><code>agetty<\/code><\/b> (alternative Linux getty), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0445\u043e\u0434\u0438\u043b \u0432 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0418 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 <b><code>init<\/code><\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code class=\"bash\">\/sbin\/agetty -8 38400 \/dev\/console \/sbin\/agetty -8 38400 \/dev\/tty1 <\/code><\/pre>\n<p>\u0420\u0435\u0446\u0435\u043f\u0442 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b <code>\/etc\/init\/<\/code> \u0431\u044b\u043b\u0438 \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u044b \u0438\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043d\u044b \u043f\u043e\u0434 <code>agetty<\/code>.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/init\/start-ttys.conf<\/b><\/p>\n<div class=\"spoiler_text\">#<br \/>  # This service starts the configured number of gettys.<br \/>  #<br \/>  # Do not edit this file directly. If you want to change the behaviour,<br \/>  # please create a file start-ttys.override and put your changes there.<\/p>\n<p>  start on stopped rc RUNLEVEL=[2345]<\/p>\n<p>  env ACTIVE_CONSOLES=\/dev\/tty[1-6]<br \/>  env X_TTY=\/dev\/tty1<br \/>  task<br \/>  script<br \/>  . \/etc\/sysconfig\/init<br \/>   for tty in $(echo $ACTIVE_CONSOLES); do<br \/>   [ &quot;$RUNLEVEL&quot; = \u00ab5\u00bb -a &quot;$tty&quot; = &quot;$X_TTY&quot; ] &#038;&#038; continue<br \/>   initctl start tty TTY=$tty<br \/>   done<br \/>  end script<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/init\/console.conf<\/b><\/p>\n<div class=\"spoiler_text\"># console \u2014 getty<br \/>  #<br \/>  # This service maintains a getty on the console from the point the system is<br \/>  # started until it is shut down again.<\/p>\n<p>  start on stopped rc RUNLEVEL=[2345]<br \/>  stop on runlevel [!2345]<br \/>  env container<\/p>\n<p>  respawn<br \/>  #exec \/sbin\/mingetty &#8212;nohangup &#8212;noclear \/dev\/console<br \/>  exec \/sbin\/agetty -8 38400 \/dev\/console<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/init\/tty.conf<\/b><\/p>\n<div class=\"spoiler_text\"># tty \u2014 getty<br \/>  #<br \/>  # This service maintains a getty on the specified device.<br \/>  #<br \/>  # Do not edit this file directly. If you want to change the behaviour,<br \/>  # please create a file tty.override and put your changes there.<\/p>\n<p>  stop on runlevel [S016]<\/p>\n<p>  respawn<br \/>  instance $TTY<br \/>  #exec \/sbin\/mingetty &#8212;nohangup $TTY<br \/>  exec \/sbin\/agetty -8 38400 $TTY<br \/>  usage &#8216;tty TTY=\/dev\/ttyX \u2014 where X is console id&#8217;<\/div>\n<\/div>\n<p>\u042f \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>mingetty<\/code> \u0432 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441 CentOS 6.6, \u043d\u043e \u043e\u043d \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432 \u043b\u043e\u0433\u0430\u0445:  <\/p>\n<pre><code class=\"bash\"># \/sbin\/mingetty --nohangup \/dev\/console console: no controlling tty: Operation not permitted <\/code><\/pre>\n<p>  \u0421 LXC \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <b><code>libvrt<\/code><\/b>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440 <a href=\"http:\/\/libvirt.org\/drvlxc.html\" title=\"http:\/\/libvirt.org\/drvlxc.html\">lxc:\/\/\/<\/a>, \u043d\u043e \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0430\u0441\u0435\u043d \u0438 RedHat <a href=\"https:\/\/access.redhat.com\/articles\/1365153\" title=\"https:\/\/access.redhat.com\/articles\/1365153\">\u0433\u0440\u043e\u0437\u0438\u0442\u0441\u044f<\/a> \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0437 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430.<br \/>  \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <code>libvrt<\/code> \u0432 Pacemaker-\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442 <code>ocf:heartbeat:VirtualDomain<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u044e\u0431\u043e\u0439 VM, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u044f \u0438 \u0436\u0438\u0432\u0443\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f KVM. \u0414\u0443\u043c\u0430\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Pacemaker-\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f KVM, \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c, \u043d\u043e \u043c\u043d\u0435 \u044d\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0443\u0436\u043d\u044b\u043c.<\/p>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Docker-\u043e\u043c \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/h2>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Pacemaker-\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Docker-\u043e\u043c \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 LXC, \u043d\u043e \u0435\u0441\u0442\u044c \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c Docker, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 RHEL\/CentOS 7, \u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442.  <\/p>\n<pre><code class=\"bash\"># yum install docker <\/code><\/pre>\n<p>  \u041d\u0430\u0443\u0447\u0438\u043c Docker \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 LVM. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0430\u0439\u043b <code>\/etc\/sysconfig\/docker-storage-setup<\/code> \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:  <\/p>\n<pre><code class=\"bash\">VG=shared_vg-ex <\/code><\/pre>\n<p>\u0413\u0434\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0442\u043e\u043c\u043e\u0432 Docker-\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0443\u043b. \u0422\u0443\u0442 \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b (<code>man docker-storage-setup<\/code>). <\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>docker-storage-setup<\/code>:  <\/p>\n<pre><code class=\"bash\"># docker-storage-setup   Rounding up size to full physical extent 716.00 MiB   Logical volume &quot;docker-poolmeta&quot; created.   Logical volume &quot;docker-pool&quot; created.   WARNING: Converting logical volume shared_vg-ex\/docker-pool and shared_vg-ex\/docker-poolmeta to pools data and metadata volumes.   THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)   Converted shared_vg-ex\/docker-pool to thin pool.   Logical volume &quot;docker-pool&quot; changed. # lvs | grep docker-pool   docker-pool     shared_vg-ex twi-aot---  17.98g             14.41  2.54  <\/code><\/pre>\n<p>  Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043c (thin provisioned), \u044d\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435. \u0422\u0430\u043a\u043e\u0439 \u0442\u043e\u043c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0437\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c LVM \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u043c\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 shared_vg-ex \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b (\u0438\u043b\u0438 \u0442\u043e\u043c\u0430 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438) \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>\/etc\/lvm\/lvm.conf<\/code> (\u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445):  <\/p>\n<pre><code class=\"bash\">\tauto_activation_volume_list = [ &quot;shared_vg&quot; ] <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u043c \u0442\u043e\u043c\u043e\u043c Pacemaker-\u0443:  <\/p>\n<pre><code class=\"bash\"># pcs resource create lvm-docker-pool LVM volgrpname=shared_vg-ex exclusive=yes # pcs constraint order start clvmd-clone then lvm-docker-pool # pcs constraint colocation add lvm-docker-pool with clvmd-clone <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u043c\u0430 \u0433\u0440\u0443\u043f\u043f\u044b <b>shared_vg-ex<\/b> \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c \u0443\u0437\u043b\u0435, \u0433\u0434\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0440\u0435\u0441\u0443\u0440\u0441 <b>lvm-docker-pool<\/b>.<\/p>\n<p>  Docker \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f NAT-\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 IP. \u0417\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"bash\"># cat \/etc\/sysconfig\/docker-network DOCKER_NETWORK_OPTIONS=&quot;--ip=10.1.2.10 \u2014fixed-cidr=172.17.0.0\/16&quot; <\/code><\/pre>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0441\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043f\u0443\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <b>docker0<\/b>, \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0442\u044c \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u042f \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0441\u0435\u0442\u044c \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435 \u0432\u043d\u044f\u0442\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0413\u0443\u0433\u043b \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043d\u0435 \u044f \u043e\u0434\u0438\u043d, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0432 \u0441\u0435\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e Docker \u0441\u0430\u043c \u0441\u0435\u0431\u0435 \u0432\u044b\u0431\u0440\u0430\u043b. Docker \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0441\u0442 \u043f\u0440\u0438 \u0441\u0432\u043e\u0451\u043c \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0438 \u043d\u0435 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 ip-\u0430\u0434\u0440\u0435\u0441, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0441\u0442 \u043d\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0451\u043d \u043d\u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0412 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b Docker \u0445\u043e\u0434\u0438\u043b \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0435\u043c\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u0444\u0430\u0439\u043b <code>\/etc\/systemd\/system\/docker.service.d\/http-proxy.conf<\/code> \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">[Service] Environment=&quot;http_proxy=http:\/\/ip_proxy:port&quot; &quot;https_proxy=http:\/\/ip_proxy:port&quot; &quot;NO_PROXY=localhost,127.0.0.0\/8,dregistry&quot; <\/code><\/pre>\n<p>  \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u0437\u0430 Docker \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0445 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432 \u0433\u0440\u0443\u043f\u043f\u0443. \u0412\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0433\u0440\u0443\u043f\u043f\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435. \u041d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0431\u043e\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u044b, \u0432\u0441\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441\u043e\u0431\u0435\u0440\u0451\u0442\u0441\u044f \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0437\u0435\u043b. \u0410 \u0442\u0430\u043a \u0436\u0435, \u043f\u0440\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0433\u0440\u0443\u043f\u043f\u044b, \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0442\u043e\u0436\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0441\u044f. \u041f\u0435\u0440\u0432\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 LVM \u0442\u043e\u043c:  <\/p>\n<pre><code class=\"bash\"># pcs resource group add docker lvm-docker-pool <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0440\u0435\u0441\u0443\u0440\u0441 \u2014 IP \u0430\u0434\u0440\u0435\u0441, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 Docker-\u0443:  <\/p>\n<pre><code class=\"bash\"># pcs resource create dockerIP IPaddr2 --group docker --after lvm-docker-pool  ip=10.1.2.10 cidr_netmask=24 nic=br0.12 <\/code><\/pre>\n<p>  \u041a\u0440\u043e\u043c\u0435 LVM \u0442\u043e\u043c\u0430 Docker \u0442\u0430\u043a \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Pacemaker-\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c\u0443 Dokcer-\u0443, \u0442\u043e \u0438 \u0440\u0435\u0441\u0443\u0440\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u043c.  <\/p>\n<pre><code class=\"bash\"># lvcreate -L 500M -n docker-db shared_vg # mkfs.xfs \/dev\/shared_vg\/docker-db # pcs resource create fs-docker-db  Filesystem fstype=xfs device=\/dev\/shared_vg\/docker-db directory=\/var\/lib\/docker --group docker --after dockerIP <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0430\u043c Docker-\u0434\u0435\u043c\u043e\u043d:  <\/p>\n<pre><code class=\"bash\"># pcs resource create dockerd systemd:docker --group docker --after fs-docker-db <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u044b, \u043d\u0430 \u0443\u0437\u043b\u0435, \u0433\u0434\u0435 \u043f\u043e\u0441\u0435\u043b\u0438\u043b\u0441\u044f Docker \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0443\u0441 \u0438 \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">docker info:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"># docker info Containers: 5 Images: 42 Storage Driver: devicemapper  Pool Name: shared_vg--ex-docker--pool  Pool Blocksize: 524.3 kB  Backing Filesystem: xfs  Data file:  Metadata file:  Data Space Used: 2.781 GB  Data Space Total: 19.3 GB  Data Space Available: 16.52 GB  Metadata Space Used: 852 kB  Metadata Space Total: 33.55 MB  Metadata Space Available: 32.7 MB  Udev Sync Supported: true  Library Version: 1.02.93-RHEL7 (2015-01-28) Execution Driver: native-0.2 Kernel Version: 3.10.0-229.7.2.el7.x86_64 Operating System: CentOS Linux 7 (Core) CPUs: 4 Total Memory: 3.703 GiB Name: cluster-2 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Docker-\u043e\u043c \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b, \u0437\u0430\u0432\u0435\u0434\u0451\u043c \u0438 \u043f\u043e\u0441\u0435\u043b\u0438\u043c \u0432 \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 Docker-\u0440\u0435\u0435\u0441\u0442\u0440. \u0414\u043b\u044f \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 IP \u0438 \u0438\u043c\u044f 10.1.2.11 (dregistry), \u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b.  <\/p>\n<pre><code class=\"bash\"># lvcreate -L 10G -n docker-registry shared_vg # mkfs.ext4 \/dev\/shared_vg\/docker-registry # mkdir \/mnt\/docker-registry # pcs resource create docker-registry Filesystem fstype=ext4 device=\/dev\/shared_vg\/docker-registry directory=\/mnt\/docker-registry --group=docker \u2013after=dockerd # pcs resource create registryIP IPaddr2 --group docker --after docker-registry ip=10.1.2.11 cidr_netmask=24 nic=br0.12 <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440-\u0440\u0435\u0435\u0441\u0442\u0440 \u043d\u0430 \u0443\u0437\u043b\u0435, \u0433\u0434\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d Docker:  <\/p>\n<pre><code class=\"bash\"># docker create -p 10.1.2.11:80:5000 -e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=\/var\/lib\/registry -v \/mnt\/docker-registry:\/var\/lib\/registry -h dregistry --name=dregistry registry:2 <\/code><\/pre>\n<p> \u0417\u0430\u0434\u0430\u0451\u043c \u043f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u043e\u0440\u0442\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (10.1.2.11:80 \u2192 5000). \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/mnt\/docker-registry<\/code>. \u0418\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0438 \u0438\u043c\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<br \/>  \u0412\u044b\u0432\u043e\u0434 <code>docker ps -a<\/code> \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443.<\/p>\n<p>  \u041e\u0442\u0434\u0430\u0434\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c Pacemaker-\u0443. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u0432\u0435\u0436\u0438\u0439 \u0440\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442:  <\/p>\n<pre><code class=\"bash\"># wget -O \/usr\/lib\/ocf\/resource.d\/heartbeat\/docker https:\/\/raw.githubusercontent.com\/ClusterLabs\/resource-agents\/master\/heartbeat\/docker # chmod +x \/usr\/lib\/ocf\/resource.d\/heartbeat\/docker <\/code><\/pre>\n<p>  \u0412\u0430\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445, \u0430 \u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u0438. \u0420\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442 \u00abdocker\u00bb \u0441\u0430\u043c \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044f \u0438\u0445 \u0438\u0437 \u0440\u0435\u0435\u0441\u0442\u0440\u0430. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 Docker-\u0430 \u043d\u0430 \u0443\u0437\u043b\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0441 \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u043c \u0438 \u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u043c\u0438. \u0410 Pacemaker-\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0434\u0430 \u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e. \u042f \u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0442\u043e Docker-\u043e\u043c \u0435\u0449\u0451 \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. <br \/>  \u0418\u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c Pacemaker-\u0443.  <\/p>\n<pre><code class=\"bash\"># pcs resource create dregistry docker reuse=true image=&quot;docker.io\/registry:2&quot; --group docker --after registryIP <\/code><\/pre>\n<p><b>reuse=true<\/b> \u2013 \u0432\u0430\u0436\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0438\u043d\u0430\u0447\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0451\u043d \u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. <b>image<\/b> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0440\u0435\u0435\u0441\u0442\u0440 \u0438 \u0442\u044d\u0433. \u0420\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <b>dregistry<\/b> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442.<br \/>   \u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0448 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0435\u0441\u0442\u0440 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Docker-\u0430 \u043d\u0430 \u0443\u0437\u043b\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 (<code>\/etc\/sysconfig\/docker<\/code>).  <\/p>\n<pre><code class=\"bash\">ADD_REGISTRY='--add-registry dregistry' INSECURE_REGISTRY='--insecure-registry dregistry' <\/code><\/pre>\n<p>HTTPS \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0435\u0441\u0442\u0440\u0430.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u0443 Docker-\u0430 <code>systemctl restart docker<\/code> \u043d\u0430 \u0443\u0437\u043b\u0435, \u0433\u0434\u0435 \u043e\u043d \u0436\u0438\u0432\u0451\u0442 \u0438\u043b\u0438 <code>pcs resource restart dockerd<\/code> \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0443\u0437\u043b\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u0418 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 10.1.2.11 (dregistry).<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u0432 Pacemaker-\u0435. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <b><code>pcs<\/code><\/b> \u0442\u0443\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b. \u0428\u0430\u0431\u043b\u043e\u043d\u044b \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u044b\u0435 \u043e\u043d\u0430 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435, \u0430 \u0434\u043b\u044f <i>constraint<\/i> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 <b><code>pcs<\/code><\/b> \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e. \u0411\u043b\u0430\u0433\u043e, \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u043f\u0440\u044f\u043c\u0443\u044e \u0432 xml \u0444\u0430\u0439\u043b\u0435:  <\/p>\n<pre><code class=\"bash\"># pcs cluster cib &gt; \/tmp\/cluster.xml # \u043f\u0440\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e # pcs cluster cib-push \/tmp\/cluster.xml <\/code><\/pre>\n<p>  Docker-\u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c:  <\/p>\n<ul>\n<li> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u044b docker <\/li>\n<li> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u044b docker <\/li>\n<li> \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u043e\u0442 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 <\/li>\n<\/ul>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0432\u0435\u0448\u0430\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b><code>pcs constraint<\/code><\/b>, \u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e\u0439 \u0438 \u043f\u043b\u043e\u0445\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0438 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 Nginx-\u043e\u043c. \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0435\u0441\u0442\u0440:  <\/p>\n<pre><code class=\"bash\"># docker pull nginx:latest # docker push nginx:latest # pcs resource create doc-test3 docker reuse=false image=&quot;dregistry\/nginx:latest&quot; --disabled # pcs resource create doc-test2 docker reuse=true image=&quot;dregistry\/nginx:latest&quot; --disabled # pcs resource create doc-test docker reuse=true image=&quot;dregistry\/nginx:latest&quot; --disabled <\/code><\/pre>\n<p>\u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438, \u0438\u043d\u0430\u0447\u0435 \u043e\u043d\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0442\u0443\u0442 \u043a\u0430\u043a \u043f\u043e\u0432\u0435\u0437\u0451\u0442 \u0441 \u0443\u0437\u043b\u043e\u043c.<\/p>\n<p>  \u0412 \u0441\u0432\u0435\u0436\u0435\u0432\u044b\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 xml \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0441\u0435\u043a\u0446\u0438\u044f <code>&lt;constraints&gt;<\/code>):  <\/p>\n<pre><code class=\"xml\">&lt;rsc_colocation id=&quot;docker-col&quot; score=&quot;INFINITY&quot;&gt;   &lt;resource_set id=&quot;docker-col-0&quot; require-all=&quot;false&quot; role=&quot;Started&quot; sequential=&quot;false&quot;&gt;     &lt;resource_ref id=&quot;doc-test&quot;\/&gt;     &lt;resource_ref id=&quot;doc-test2&quot;\/&gt;     &lt;resource_ref id=&quot;doc-test3&quot;\/&gt;   &lt;\/resource_set&gt;   &lt;resource_set id=&quot;docker-col-1&quot;&gt;     &lt;resource_ref id=&quot;docker&quot;\/&gt;   &lt;\/resource_set&gt; &lt;\/rsc_colocation&gt; <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0449\u0435\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 (<i>colocation set<\/i>, <b><code>id=&quot;docker-col&quot;<\/code><\/b>) \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0437\u043b\u0435 (<b><code>score=&quot;INFINITY&quot;<\/code><\/b>). \u041f\u0435\u0440\u0432\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (<b><code>id=&quot;docker-col-0&quot;<\/code><\/b>) \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438:  <\/p>\n<ul>\n<li> \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (<b><code>sequential=&quot;false&quot;<\/code><\/b>)<\/li>\n<li> \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043e\u0442 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 (<b><code>require-all=&quot;false&quot;<\/code><\/b>)<\/li>\n<li> \u0440\u043e\u043b\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (<b><code>role=&quot;Started&quot;<\/code><\/b>)<\/li>\n<\/ul>\n<p>  \u0422\u044d\u0433 <b>resource_ref<\/b> \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b><code>role=&quot;Started&quot;<\/code><\/b> \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u043d.<br \/>  \u0418 \u0432\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (<b><code>id=&quot;docker-col-1&quot;<\/code><\/b>), \u043a\u0443\u0434\u0430 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0433\u0440\u0443\u043f\u043f\u044b <b><code>docker<\/code><\/b>.<br \/>  \u041c\u043d\u0435 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <b>role<\/b> \u0432 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043d\u043e <a href=\"http:\/\/clusterlabs.org\/doc\/en-US\/Pacemaker\/1.1-pcs\/html-single\/Pacemaker_Explained\/index.html#_referencing_templates_in_constraints\" title=\"12.2. Referencing Templates in Constraints\">\u043e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0430\u043a<\/a> (\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043c\u0438).<\/p>\n<p>  <i>Ordering set<\/i>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:  <\/p>\n<pre><code class=\"xml\">&lt;rsc_order id=&quot;order_doc&quot;&gt;   &lt;resource_set id=&quot;order_doc-0&quot;&gt;     &lt;resource_ref id=&quot;docker&quot;\/&gt;   &lt;\/resource_set&gt;   &lt;resource_set id=&quot;order_doc-1&quot; require-all=&quot;false&quot; sequential=&quot;false&quot;&gt;     &lt;resource_ref id=&quot;doc-test&quot;\/&gt;     &lt;resource_ref id=&quot;doc-test2&quot;\/&gt;     &lt;resource_ref id=&quot;doc-test3&quot;\/&gt;   &lt;\/resource_set&gt; &lt;\/rsc_order&gt; <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u0435\u0435, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0433\u0440\u0443\u043f\u043f\u044b <b><code>docker<\/code><\/b>, \u0437\u0430\u0442\u0435\u043c \u0441\u043a\u043e\u043f\u043e\u043c \u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0432\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437\u0431\u043e\u044f\u0437\u043d\u0435\u043d\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\/\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c. \u042d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041d\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0437\u0435\u043b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0432\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u0412 \u0432\u044b\u0432\u043e\u0434\u0435 <b><code>pcs<\/code><\/b> \u044d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"bash\"> # pcs constraint --full | grep -i set   Resource Sets:     set docker (id:order_doc-0) set doc-test doc-test2 doc-test3 sequential=false require-all=false (id:order_doc-1) (id:order_doc)   Resource Sets:     set doc-test doc-test2 doc-test3 role=Started sequential=false require-all=false (id:docker-col-0) set docker (id:docker-col-1) setoptions score=INFINITY (id:docker-col) <\/code><\/pre>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f LXC \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <code>&lt;resources&gt;<\/code>):   <\/p>\n<pre><code class=\"xml\">&lt;template id=&quot;lxc-template&quot; class=&quot;ocf&quot; provider=&quot;heartbeat&quot; type=&quot;lxc&quot;&gt;   &lt;meta_attributes id=&quot;lxc-template-meta_attributes&quot;&gt;     &lt;nvpair id=&quot;lxc-template-meta_attributes-allow-migrate&quot; name=&quot;use_screen&quot; value=&quot;false&quot;\/&gt;   &lt;\/meta_attributes&gt;   &lt;operations&gt;     &lt;op id=&quot;lxc-template-monitor-30s&quot; interval=&quot;30s&quot; name=&quot;monitor&quot; timeout=&quot;20s&quot;\/&gt;     &lt;op id=&quot;lxc-template-start-0&quot; interval=&quot;0&quot; name=&quot;start&quot; timeout=&quot;20s&quot;\/&gt;     &lt;op id=&quot;lxc-template-stop-0&quot; interval=&quot;0&quot; name=&quot;start&quot; timeout=&quot;90s&quot;\/&gt;   &lt;\/operations&gt; &lt;\/template&gt; <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u0418 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430:   <\/p>\n<pre><code class=\"xml\">&lt;primitive id=&quot;lxc-racktables&quot; template=&quot;lxc-template&quot;&gt;   &lt;instance_attributes id=&quot;lxc-racktables-instance_attributes&quot;&gt;     &lt;nvpair id=&quot;lxc-racktables-instance_attributes-container&quot; name=&quot;container&quot; value=&quot;lxc-racktables&quot;\/&gt;     &lt;nvpair id=&quot;lxc-racktables-instance_attributes-config&quot; name=&quot;config&quot; value=&quot;\/var\/lib\/lxc\/lxc-racktables\/config&quot;\/&gt;   &lt;\/instance_attributes&gt; &lt;\/primitive&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0432\u043e\u0434 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0441\u0442\u0430\u043b \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u043e\u0440\u043e\u0442\u043e\u043a:  <\/p>\n<pre><code class=\"bash\"># pcs resource show lxc-racktables  Resource: lxc-racktables (template=lxc-template)   Attributes: container=lxc-racktables config=\/var\/lib\/lxc\/lxc-racktables\/config <\/code><\/pre>\n<p>  \u041f\u0440\u0430\u0432\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <code>pcs<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<br \/>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 LXC \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c, \u043a\u0430\u043a \u0441 Docker-\u043e\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Pacemaker-\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 <b><code>crmsh<\/code><\/b> \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <a href=\"http:\/\/download.opensuse.org\/repositories\/network:\/ha-clustering:\/Stable\/\" title=\"http:\/\/download.opensuse.org\/repositories\/network:\/ha-clustering:\/Stable\/\">opensuse.org<\/a>, \u043d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u0441\u044f \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<p>  \u041a\u043b\u0430\u0441\u0442\u0435\u0440 \u043f\u0440\u0438\u043e\u0431\u0440\u0451\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\"># pcs status<\/b><\/p>\n<div class=\"spoiler_text\">Cluster name: Cluster<br \/>  Last updated: Thu Jul 16 12:29:33 2015<br \/>  Last change: Thu Jul 16 10:23:40 2015<br \/>  Stack: corosync<br \/>  Current DC: cluster-1 (1) \u2014 partition with quorum<br \/>  Version: 1.1.12-a14efad<br \/>  2 Nodes configured<br \/>  19 Resources configured<\/p>\n<p>  Online: [ cluster-1 cluster-2 ]<\/p>\n<p>  Full list of resources:<\/p>\n<p>  cluster-1.stonith (stonith:fence_ipmilan): Started cluster-2<br \/>   cluster-2.stonith (stonith:fence_ipmilan): Started cluster-1<br \/>   Clone Set: dlm-clone [dlm]<br \/>   Started: [ cluster-1 cluster-2 ]<br \/>   Clone Set: clvmd-clone [clvmd]<br \/>   Started: [ cluster-1 cluster-2 ]<br \/>   Clone Set: fs-lxc_ct-clone [fs-lxc_ct]<br \/>   Started: [ cluster-1 cluster-2 ]<br \/>   lxc-racktables (ocf::heartbeat:lxc): Started cluster-1<br \/>   Resource Group: docker<br \/>   lvm-docker-pool (ocf::heartbeat:LVM): Started cluster-2<br \/>   dockerIP (ocf::heartbeat:IPaddr2): Started cluster-2<br \/>   fs-docker-db (ocf::heartbeat:Filesystem): Started cluster-2<br \/>   dockerd (systemd:docker): Started cluster-2<br \/>   docker-registry (ocf::heartbeat:Filesystem): Started cluster-2<br \/>   registryIP (ocf::heartbeat:IPaddr2): Started cluster-2<br \/>   dregistry (ocf::heartbeat:docker): Started cluster-2<br \/>   doc-test (ocf::heartbeat:docker): Started cluster-2<br \/>   doc-test2 (ocf::heartbeat:docker): Started cluster-2<br \/>   doc-test3 (ocf::heartbeat:docker): Stopped<\/p>\n<p>  PCSD Status:<br \/>   cluster-1: Online<br \/>   cluster-2: Online<\/p>\n<p>  Daemon Status:<br \/>   corosync: active\/disabled<br \/>   pacemaker: active\/enabled<br \/>   pcsd: active\/enabled<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\"># pcs constraint<\/b><\/p>\n<div class=\"spoiler_text\">Location Constraints:<br \/>   Resource: cluster-1.stonith<br \/>   Disabled on: cluster-1 (score:-INFINITY)<br \/>   Resource: cluster-2.stonith<br \/>   Disabled on: cluster-2 (score:-INFINITY)<br \/>   Resource: doc-test<br \/>   Enabled on: cluster-2 (score:INFINITY) (role: Started)<br \/>  Ordering Constraints:<br \/>   start dlm-clone then start clvmd-clone (kind:Mandatory)<br \/>   start clvmd-clone then start fs-lxc_ct-clone (kind:Mandatory)<br \/>   start fs-lxc_ct-clone then start lxc-racktables (kind:Mandatory)<br \/>   start clvmd-clone then start lvm-docker-pool (kind:Mandatory)<br \/>   Resource Sets:<br \/>   set docker set doc-test doc-test2 doc-test3 sequential=false require-all=false<br \/>  Colocation Constraints:<br \/>   clvmd-clone with dlm-clone (score:INFINITY)<br \/>   fs-lxc_ct-clone with clvmd-clone (score:INFINITY)<br \/>   lvm-docker-pool with clvmd-clone (score:INFINITY)<br \/>   Resource Sets:<br \/>   set doc-test doc-test2 doc-test3 role=Started sequential=false require-all=false set docker setoptions score=INFINITY<\/div>\n<\/div>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<h2>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430<\/h2>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430:  <\/p>\n<pre><code class=\"bash\"># pcs resource show &ltresource id&gt <\/code><\/pre>\n<p>  \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"bash\"># pcs resource update &ltresource id&gt op start start-delay=&quot;3s&quot; interval=0s timeout=90 <\/code><\/pre>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435, \u0442\u0430\u043a \u043a\u0430\u043a update \u0438\u0445 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0448\u0435\u0442.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441  <\/p>\n<pre><code class=\"bash\"># pcs resource restart &ltresource id&gt [node]<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0435 clone-\u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0443\u0437\u0435\u043b \u044f\u0432\u043d\u043e, \u0438\u043d\u0430\u0447\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442, \u0433\u0434\u0435 \u0432\u0437\u0434\u0443\u043c\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430:  <\/p>\n<pre><code class=\"bash\"># pcs resource failcount show &ltresource id&gt [node] # pcs resource failcount reset &ltresource id&gt [node] <\/code><\/pre>\n<p>\u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0435\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432\u043f\u0430\u043b \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 Pacemaker \u0436\u0434\u0451\u0442 \u0432\u0430\u0448\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0447\u0442\u043e-\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  \u041f\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0443:  <\/p>\n<pre><code class=\"bash\"># pcs resource cleanup [&ltresource id&gt]<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e Pacemaker \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  \u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c\/\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0440\u0435\u0441\u0443\u0440\u0441:  <\/p>\n<pre><code class=\"bash\"># pcs resource disable [&ltresource id&gt] # pcs resource enable [&ltresource id&gt]<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435\/\u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0441\u043b\u0443\u0436\u0431\u044b \u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0437\u0435\u043b:  <\/p>\n<pre><code class=\"bash\"># pcs resource move &ltresource id&gt [destination node]<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441-\u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0442\u043e \u0440\u0435\u0441\u0443\u0440\u0441 \u0431\u0443\u0434\u0435\u0442 \u0448\u0442\u0430\u0442\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0443\u0437\u043b\u0435 \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u043c. \u0415\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0437\u0435\u043b, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u043b\u0441\u044f, \u0442\u043e \u0440\u0435\u0441\u0443\u0440\u0441 \u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f \u043d\u0430\u0437\u0430\u0434. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0432 constraint \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code class=\"bash\">  Resource: docker     Enabled on: cluster-2 (score:INFINITY) (role: Started) (id:cli-prefer-docker) <\/code><\/pre>\n<p>c \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430. \u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432 \u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:  <\/p>\n<pre><code class=\"bash\"># pcs  constraint \u2013full<\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e id, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435:  <\/p>\n<pre><code class=\"bash\"># pcs constraint remove &lt;constraint id&gt;<\/code><\/pre>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430:  <\/p>\n<pre><code class=\"bash\"># pcs cluster cib &gt; \/tmp\/cluster.xml # pcs cluster cib-push \/tmp\/cluster.xml&lt;source lang=&quot;bash&quot;&gt;<\/code><\/pre>\n<h2>C\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li> <a href=\"http:\/\/wiki.525.su\/doku.php?id=pacemaker_theory\" title=\"Pacemaker, \u0442\u0435\u043e\u0440\u0438\u044f\">Pacemaker, \u0442\u0435\u043e\u0440\u0438\u044f<\/a><\/li>\n<li> <a href=\"http:\/\/clusterlabs.org\/doc\/en-US\/Pacemaker\/1.1-pcs\/html\/Clusters_from_Scratch\/index.html\" title=\"Clusters from Scratch\">Clusters from Scratch<\/a><\/li>\n<li> <a href=\"http:\/\/clusterlabs.org\/doc\/en-US\/Pacemaker\/1.1-pcs\/html-single\/Pacemaker_Explained\/index.html\">Configuration Explained<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/200348\/\">Pacemaker: \u043a\u0430\u043a \u0434\u043e\u0431\u0438\u0442\u044c \u043b\u0435\u0436\u0430\u0447\u0435\u0433\u043e<\/a><\/li>\n<li> <a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/7\/html\/Logical_Volume_Manager_Administration\/LVM_administration.html#cluster_setup\">Creating LVM Volumes in a Cluster<\/a><\/li>\n<li><a href=\"https:\/\/access.redhat.com\/articles\/1365153\">Linux Containers with libvirt-lxc (deprecated)<\/a><\/li>\n<li><a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/7\/html\/High_Availability_Add-On_Reference\/ch-overview-HAAR.html\">High Availability Add-On Reference<\/a><\/li>\n<li><a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/7\/html\/High_Availability_Add-On_Administration\/ch-startup-HAAA.html\">High Availability Add-On Administration<\/a><\/li>\n<li><a href=\"https:\/\/docs.docker.com\/\">Docker Docs<\/a><\/li>\n<li><a href=\"https:\/\/access.redhat.com\/articles\/881893\">Get Started with Docker Formatted Container Images on Red Hat Systems<\/a><\/li>\n<li><a href=\"http:\/\/vasilisc.com\/lxc-1-0-blog-post-series\">LXC 1.0.<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ClusterLabs\">GitHub ClusterLabs<\/a><\/li>\n<li><a href=\"http:\/\/criu.org\/Main_Page\" title=\"http:\/\/criu.org\/Main_Page\">CRIU<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/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\/post\/263091\/\"> http:\/\/habrahabr.ru\/post\/263091\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 Active\/Active \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Pacemaker, Corosync 2.x \u0438 CLVM \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 LXC \u0438 Docker. \u041e\u043f\u0438\u0448\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c. \u0418 \u043f\u0440\u0438\u043f\u043e\u043c\u043d\u044e \u0442\u0435 \u0433\u0440\u0430\u0431\u043b\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043b\u044f\u043f\u0430\u043b\u0441\u044f, \u0447\u0442\u043e, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442 \u0441\u0443\u0434\u044c\u0431\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0446\u0430\u043c.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CentOS 7 + epel \u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u043d\u0438\u0445. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Pacemaker-\u043e\u043c \u0431\u0443\u0434\u0435\u0442 PCS (pacemaker\/corosync configuration system).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c26\/72b\/d5b\/c2672bd5b53045b09bbe6e5e7db04dbb.png\"\/><\/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-261871","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/261871","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=261871"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/261871\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=261871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=261871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=261871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}