{"id":1446,"date":"2020-07-29T13:13:53","date_gmt":"2020-07-29T11:13:53","guid":{"rendered":"https:\/\/blog.mhasin.eu\/?p=1446"},"modified":"2020-07-29T20:24:35","modified_gmt":"2020-07-29T18:24:35","slug":"debian-ha-apache2-server-pacmeker-corosync","status":"publish","type":"post","link":"https:\/\/blog.mhasin.eu\/?p=1446","title":{"rendered":"Debian HA apache2 server. (pacmeker, corosync)"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Instalacia pacemaker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install -y pacemaker corosync crmsh<\/code><\/pre>\n\n\n\n<p>Nastavenie clustru corosync:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/corosync\/corosync.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Totem Protocol Configuration\ntotem {\n  version: 2\n  cluster_name: hakase-cluster\n  transport: udpu\n \n# Interface configuration for Corosync\n  interface {\n    ringnumber: 0\n    bindnetaddr: 10.0.15.0\n    broadcast: yes\n    mcastport: 5407\n  }\n}\n \n# Nodelist - Server List\nnodelist {\n  node {\n    ring0_addr: web01\n  }\n  node {\n    ring0_addr: web02\n  }\n}\n \n# Quorum configuration\nquorum {\n  provider: corosync_votequorum\n}\n \n# Corosync Log configuration\nlogging {\n  to_logfile: yes\n  logfile: \/var\/log\/corosync\/corosync.log\n  to_syslog: yes\n  timestamp: on\n}\n \nservice {\n  name: pacemaker\n  ver: 0\n}<\/code><\/pre>\n\n\n\n<p>Hosty  web01 a web02 je potrebne nahrav <strong>v lokalnom<\/strong> DNS<\/p>\n\n\n\n<p>Po spusteni sluzieb:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"203\" src=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/07\/obr\u00e1zok-12.png\" alt=\"\" class=\"wp-image-1448\" srcset=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/07\/obr\u00e1zok-12.png 554w, https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/07\/obr\u00e1zok-12-300x110.png 300w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/figure><\/div>\n\n\n\n<p>Nastavenie corosync &amp; pacemaker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crm configure property stonith-enabled=false\ncrm configure property no-quorum-policy=ignore<\/code><\/pre>\n\n\n\n<p>Vytvorenie flating IP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pcs resource create floating_ip ocf:heartbeat:IPaddr2 ip=147.232.103.6 cidr_netmask=28 op monitor interval=5s<\/code><\/pre>\n\n\n\n<p>Zmena nastavenia v:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/systemd\/system\/multi-user.target.wants\/pacemaker.service<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>TimeoutStopSec=30s<\/code><\/pre>\n\n\n\n<p>Nastavenie apache clustra:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pcs resource create WebServer ocf:heartbeat:apache configfile=\/etc\/apache2\/apache2.conf statusurl=\"http:\/\/127.0.0.1\/server-status\" op monitor interval=20s<\/code><\/pre>\n\n\n\n<p>Nastavenie skupiny sluzieb:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crm configure group web_balancing WebServer floating_ip<\/code><\/pre>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLQUA\" \/><input type=\"hidden\" name=\"blogName\" value=\"c\/LxdwcA\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"MzQxMQMA\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"c0lNykzMU\/BwVEgsSEzOSDVSKE4tKkst0lPQAPJzU7NTi3QUkvOL8osr85I1AQ==\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLdW3L7A1NDExAwA=\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"y00syfcwNAIA\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwMtA1MNc1slQwNLYyMLcyNQYA\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"rVbbbuM2EH33Vwy0QNECq4vlpFmoll\/ahwZYBCmy2AJ9MSiKllhTJEtScpwiH9Nv6Y\/tkLIcp+s2e6lfxBmSc+Z2hp4t9WqZ6tUMf8+X19I6IgjlBDShrCNbZoqnfcOACmJtGe10XAlFtzFVNYtWS\/9ZEe2ABwsC4v2TBaDKKLuXFKjpbLtMw2k0a9gEfEPw2sAk9wi9daY\/Xvp0fEmkgpQ5mk53j4uEKrk5A\/yCxVfwTjnWwa1RTlEl4Ec0w5veEMeVnLmw+ecMYGDGoqaAHIUQATNrSTpWQEu2xLL4oMRtZ4i0WhlXQF\/rfgazV3AtcW+DCQN6igAbZRBzjAGv8uMxDwpguGxk31VYJciCpuKylsyRukbVPEuyZH6ZHLaMIjXFRBewZzaoOi+OrlxeZFeoe5w9BoduMHzBrYMY7pjB8OAtSjM5qT2+F04cydYj6o5V2TyY+s8j+QnaL70yffc89tkfo9Lf1kYNvPZRTgVdD5j78cTBxpQmeKuaf1gSqmkQPZhyao3ihgs2peEopgMxKUpn2ge14127t7ierjreMWzcTheAMN4Pi8nih\/qM9T\/SYGwTX6jHcxT4WVm3hzF7QMYUwe8MtHKGVZKhudaQAZbIDiWb1YCOb4mQqlumBxX8dHN3wuZbBVb7rpMcrOgfOKueyFTz4aPW5x1pfO+H1B2ZQQRvJGW+9cDyBxYLYsIx3jXoA6kxtWUkyMM+gpphYEEmPm8R7Hjt2jK6vLyIoGW8aV0Z5dkiAmtoGbXOaVukKcI3SdcSy2XC+hQdwgKi3y7ttUewaZ7lWZpdpaoyf\/\/1oLbxPE+0bCIgAi1GJ6GEIOL5xcWbAGKZ+x9wAAPYvYavshMvsux+jpz09nC9i0I6fYZ7p17Dtx25j0O+Cg+n779DAmcDwgYpghQbZiwNLrB+54bnRIJvsCl\/+JIhjiP6yB7miaeZwb60Tknu2phJUglWlxsiLJv9y2Gp4pGasVaC032JDaQMO9f17\/duwC3v+0YgWzE117ef7KymFgyzqjd+chpGnDejgp0116DopmgZMa7CreL61k+fHLgu5xdXSb7Ik3m2SL4Hymuc1sx1xG7L\/A0oDZ0PF4dvmLgDEeWlPef+bx0mBJl5KACB4UueKxwq+JDUh2\/a9cLxuMdRkjhPNZfsiHQ2PVYzOUyZz3\/Q3uHAUr27c0rfMVouMvvCa0wQtJ0eZVJ8VWV+ZdXhLXlelwkjNJIfxWXIyqjOp294wrEPiettb8RIauTiPL9KwjuX2mA8Ho9EZ6uYvxiw3faay\/3HA\/PziNMY1Ws\/xNcV\/qGS1Df2U\/wnPfrcnQ8=\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\" rel=\"nofollow\"><img src=\"https:\/\/blog.mhasin.eu\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/pdf_32x32.png\" alt=\"\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"Instalacia pacemaker: Nastavenie clustru corosync: Hosty web01 a web02 je potrebne nahrav v lokalnom DNS Po spusteni sluzieb: Nastavenie corosync &amp; pacemaker: Vytvorenie flating IP Zmena nastavenia v: Nastavenie apache clustra: Nastavenie skupiny sluzieb: &nbsp;&nbsp; Send article as PDF &nbsp;&nbsp;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"arc_restricted_post":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1446","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/1446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1446"}],"version-history":[{"count":7,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/1446\/revisions"}],"predecessor-version":[{"id":1456,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/1446\/revisions\/1456"}],"wp:attachment":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}