{"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 class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">Hosty  web01 a web02 je potrebne nahrav <strong>v lokalnom<\/strong> DNS<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">Nastavenie corosync & 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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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=\"rVbNbuM2EL77KQZaoGiB1Y+VpFmoUS7toQEWQYostkAvxkiiJdYUyZKUHKfIw\/RZ+mI7pGwnadI2TlYXaYacv2\/+NDvTUAu0tozWOq6EqlexRoOtQd1F52epPp\/R8zVuXUjrUGDNETTWrMcVM8W9qGFPhGvVMNLuX+eoHfCgQUC8udcAtTLKbmQNteltd5aG26TWsBf4dImkcWSSe+ODdWbY63u5axKlgpS5Ot3J7j+SWsnlMz79j8Z38Ek51sOVUU7VSsCPpIa3g0HHlZy5cPjnDGBkxhKngJyIEAEzC4k9K6DDFVoWb5l07AxKq5VxBQyNHmYwewcXks6WhCXUDy3AUhmyOcVAonx\/zRsFMFy2cugrSiBkgVNx2UjmsGmINc+SLJmfJNsjo7CpCegCNswGVu\/JyZWT4+yUeHezu+DQJYUvuHUQwzUzFB58JGomd2xv3xMPHMkWk9U1q7J5UPWfV\/IH1n4ZlBn6x7HP\/piYXlobNfLGR7lL6GIk7KcbWx07mOCjav+hSai2JetBlVMLIpdcsB0MezId0aREPVM+xJ1k7cbS907U8Z5R4fa6ADLj\/bAEFt\/mZ8r\/vkOmMvGJujuwO35W1m1gAhZwQg9+Z6CVM6ySjCx1Bkc4o8ZRsj0fKaYVCqn6s3TLgp8ur182Hq4UWO1rVXKwYrjlrLpvwYaPT2R5j63vmAD4vp9Q8FbWzBcsWH7LYoEmXON9S+5hQwkpI4G3mwgaRnAEGj3aEax547oyOjk5jqBjvO1cGeXZUQTW1GXUOadtkaZkvk36Di2XCRtScojSTn67dNDegk3zLM\/S7DRVlfn7r1u1iud5omUbAQrSGD0IJQQRz4+PPwQjlrmvYAcogPV7eJOe+CjLbubUyV4ffa+jAKdHeHDqPXzb400c8Cq8OX3zHbV9NpLZQEWQUplNqaEPyt+B03jXVd9Qlf\/wmoVB62Dfjsx3smaGqtk6JbnrYiaxEqwplygsm\/3LZaniqddjrQSvNyXVljLswDb6vHEjSfmwloImAwF6cfXiOHRtwTCrBuOntGHovBoV9Cy4BlUvi46hcRUdFRdXftLlwHU5Pz5N8qM8mWdHyfdQ84Y2A3M92lWZfwClofdI0KAP031EUZ7YAyP7rScYaQps04YwvmZr0myjfdZs32k\/CMfjgSZa4nzvumSN0tl0XwPJdtgdvlc\/0dxUg7t2Sl+zujzK7Ov\/F5D86Xa\/DVi8KZ+\/smq77R5nc2cjVKZfFmUAbGLnu3f4yaDCRjfYwYhpgFDfz\/PTJGzi1Abl8XQlejb3+VuwsKtBc7l5OrcPa9LWqEH7NbOo6EdR1r5T7qF5UPSPPf0C\" \/> \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\">\u00a0\u00a0<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">\u00a0\u00a0<\/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 &#038; pacemaker: Vytvorenie flating IP Zmena nastavenia v: Nastavenie apache clustra: Nastavenie skupiny sluzieb: \u00a0\u00a0 Send article as PDF \u00a0\u00a0\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}]}}