{"id":194918,"date":"2013-09-26T02:40:02","date_gmt":"2013-09-25T22:40:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=194918"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=194918","title":{"rendered":"<span class=\"post_title\">Mysql \u041e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u043b\u0438 \u041a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u044b \u0441 Mysql-slave<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443: \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u043e\u0432 \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u044a\u0435\u0437\u0436\u0430\u044e\u0442 \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0435 \u0438 \u0447\u0442\u043e-\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e <s>\u0432\u043f\u0430\u0440\u0438\u0432\u0430\u044e\u0442<\/s> \u043f\u0440\u043e\u0434\u0430\u044e\u0442.<br \/>  \u0422.\u043a. \u0438\u043c \u043d\u0443\u0436\u043d\u044b \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u0430 \u0438 \u0446\u0435\u043d\u0430\u0445, \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043d\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u0441\u043b\u0438\u0432\u0430\u044e\u0442 \u0441\u0435\u0431\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>  \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043a \u0437\u0430\u0434\u0430\u0447\u0435:<br \/>   \u2014 \u0427\u0430\u0441\u0442\u043e\u0442\u0430 \u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u0430 \u043d\u0430 \u0441\u0432\u044f\u0437\u044c \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u043e\u0432 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430, \u0440\u043e\u0432\u043d\u043e \u043a\u0430\u043a \u0438 \u0434\u0438\u043b\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<br \/>   \u2014 \u0414\u043e\u043b\u0436\u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u044b \u043e\u043d\u0438 \u0442\u0430\u043a\u0438\u0435 \u00ab\u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u044b\u00bb.<br \/>   \u2014 \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430 \u0431\u0430\u0437\u0435 Mysql master-slave replication. <\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434\u044b \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f: <\/p>\n<p>   \u2014 \u0414\u043b\u044f \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430(slave) \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e \u043a\u0440\u043e\u043d\u0443, \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 mysql.<br \/>   \u2014 \u0422.\u043a. \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a master \u0431\u0430\u0437\u0435 \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u044b, binlog \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0430\u043a \u0434\u043e\u043b\u0433\u043e \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 slave \u043d\u0435 \u0441\u043a\u0430\u0447\u0430\u044e\u0442 \u0435\u0433\u043e \u0441\u0435\u0431\u0435.<\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435:<br \/>   \u2014 \u0418\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440, \u043a\u0430\u043a\u0438\u0435 slave \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0436\u0435 \u00ab\u0441\u043a\u0430\u0447\u0430\u043b\u0438\u00bb. \u0410 \u0442\u043e\u0447\u043d\u0435\u0435 \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u0430\u043c\u044b\u0439 \u00ab\u043b\u0435\u043d\u0438\u0432\u044b\u0439\u00bb slave. <br \/>   \u2014 \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 binlog \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0432\u0435\u043b\u0430\u0441\u044c \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e slave \u043a\u0430\u043a \u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440, \u0432 \u043a\u0430\u043a\u043e\u043c \u043c\u0435\u0441\u0442\u0435 slave \u0435\u0433\u043e \u0443\u0436\u0435 \u0434\u043e\u0433\u043d\u0430\u043b.<\/p>\n<p>  \u0422\u043e\u0447\u043d\u0435\u0435 \u0438\u043c\u0435\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438:<br \/>  1. \u041d\u0430 slave \u0443\u0437\u043d\u0430\u0442\u044c \u0430 \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c binlog.<br \/>  2. C\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u0430\u043a \u0442\u043e \u043c\u0430\u0441\u0442\u0435\u0440\u0443.<br \/>  3. \u041d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b binlog.<\/p>\n<p>  \u0422.\u043a. \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f(\u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0437\u0430\u0434\u0430\u0447\u0438). \u041e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b.<br \/>  \u041d\u0438\u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u0438\u0437 \u00abshow slave status\u00bb \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430\u0445\u2026 \u0447\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c\u2026<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435 \u0432 \u0440\u0435\u043f\u043b\u0438\u0446\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0431\u0430\u0437\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443 \u0438 \u0440\u0430\u0437 \u0432 \u043c\u0438\u043d\u0443\u0442\u0443 \u043f\u0438\u0448\u0435\u043c \u0442\u0443\u0434\u0430 timestamp.<br \/>  \u042d\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0432 binlog, binlog \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0434\u043e\u0435\u0437\u0436\u0430\u044e\u0442 \u0434\u043e slave \u0438 \u043a\u043e\u043c\u0438\u0442\u0438\u0441\u044f. \u041d\u0430 slvae \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0434\u043e \u043a\u0430\u043a\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u044b \u0434\u043e\u0433\u043d\u0430\u043b\u0438 \u043c\u0430\u0441\u0442\u0435\u0440 \ud83d\ude42 <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/823\/12e\/81c\/82312e81c50b95ca57f2b60f6d90625d.png\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435 (!!! \u0432 \u0440\u0435\u043f\u043b\u0438\u0446\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435) \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u043c 1 \u0437\u0430\u043f\u0438\u0441\u044c:  <\/p>\n<pre><code class=\"sql\">CREATE TABLE `master_tick` (   `id` mediumint(9) NOT NULL,   `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,   PRIMARY KEY (`id`) ); INSERT INTO  master_tick  SET time=NOW(); <\/code><\/pre>\n<p>  \u0438 \u0432\u0435\u0448\u0430\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435(\u0438\u043c\u044f \u0411\u0414 \u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435):  <\/p>\n<pre><code class=\"sql\">CREATE EVENT master_tick ON SCHEDULE EVERY 1 MINUTE DO UPDATE my_db.master_tick set time=NOW(); <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043d\u0443\u0442\u0443 \u043f\u043e\u043b\u0435 master_tick \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 binlog.<\/p>\n<p>  \u0434\u0430 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 my.cnf   <\/p>\n<pre><code>event_scheduler=1 <\/code><\/pre>\n<p>  \u0430 \u0447\u0442\u043e\u0431 \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f:  <\/p>\n<pre><code class=\"sql\">SET GLOBAL event_scheduler=ON; <\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430 slave \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0434\u043e\u0433\u043d\u0430\u043b\u0438 \u043c\u0430\u0441\u0442\u0435\u0440 \u0438 \u043d\u0430\u0434\u043e \u043a\u0430\u043a-\u0442\u043e \u043f\u0440\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0442\u0435\u0440.<\/p>\n<p>  \u0421\u043e slave \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440 \u043f\u0438\u0441\u0430\u0442\u044c, \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 MYSQL \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u00ab\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e\u00bb \u0442\u0430\u0431\u043b\u0438\u0446\u0443 ENGINE=FEDERATE;<\/p>\n<p>  \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430 slave \u043f\u043e event \u043f\u0438\u0441\u0430\u0442\u044c \u0432 FEDERATE \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/954\/30f\/238\/95430f2383ba2afaf904ab600d640d2a.png\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430 <b>master<\/b> \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u041d\u0415 \u0440\u0435\u043f\u043b\u0438\u0446\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0431\u0430\u0437\u0435,   <\/p>\n<pre><code class=\"sql\">CREATE TABLE `slaves` (   `server_id` int(11) NOT NULL,   `master_tick_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,   UNIQUE KEY `server_id` (`server_id`) ) <\/code><\/pre>\n<p>  \u041d\u0430 <b>slave<\/b> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043a \u043d\u0435\u0439:  <\/p>\n<pre><code class=\"sql\"> CREATE TABLE `slaves` (   `slave_server_id` int(11) NOT NULL,   `master_tick_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,   UNIQUE KEY `server_id` (`server_id`) ) ENGINE=FEDERATED  CONNECTION='mysql:\/\/user:passwd@mysql_master.mydomain.com:3306\/test\/slaves' <\/code><\/pre>\n<p>  \u041d\u0430 <b>slave<\/b> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b master_tick \u0432 slaves, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c server_id, \u0447\u0442\u043e\u0431 \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0442\u043e \u0438\u0437 slave \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438.  <\/p>\n<pre><code class=\"sql\">CREATE  PROCEDURE `copy_master_tick_time`() BEGIN   DECLARE master_tick_time timestamp;   SET @master_tick_time = (select time from my_db.master_tick);   DELETE FROM test.slaves where server_id=@@server_id;   INSERT INTO test.slaves set   server_id=@@server_id, master_tick_time=@master_tick_time; END <\/code><\/pre>\n<p>  \u041d\u0430 <b>slave<\/b> \u0434\u043e\u0431\u0430\u0432\u0438\u043c EVENT:  <\/p>\n<pre><code class=\"sql\">CREATE  EVENT `copy_master_tick` ON SCHEDULE  EVERY 30 SECOND STARTS '2013-01-01 00:00:00'  DO call copy_master_tick_time() <\/code><\/pre>\n<p>  \u0412\u0441\u0435. <\/p>\n<p>  \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u043d\u0430 master \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043b\u043e\u0433\u0438.<br \/>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u043e \u043a\u0440\u043e\u043d\u0443 Bash script:<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  a=`mysql -e &quot;select MIN(master_tick_time) from slaves;&quot;` mysql -e &quot;PURGE BINARY LOGS BEFORE $a&quot;  <\/code><\/pre>\n<p>  P.S. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 binlog_format = &#8216;ROW&#8217;;    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/194918\/\"> http:\/\/habrahabr.ru\/post\/194918\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443: \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u043e\u0432 \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u044a\u0435\u0437\u0436\u0430\u044e\u0442 \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0435 \u0438 \u0447\u0442\u043e-\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e <s>\u0432\u043f\u0430\u0440\u0438\u0432\u0430\u044e\u0442<\/s> \u043f\u0440\u043e\u0434\u0430\u044e\u0442.<br \/>  \u0422.\u043a. \u0438\u043c \u043d\u0443\u0436\u043d\u044b \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u0430 \u0438 \u0446\u0435\u043d\u0430\u0445, \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043d\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u0441\u043b\u0438\u0432\u0430\u044e\u0442 \u0441\u0435\u0431\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>  \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043a \u0437\u0430\u0434\u0430\u0447\u0435:<br \/>   \u2014 \u0427\u0430\u0441\u0442\u043e\u0442\u0430 \u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u0430 \u043d\u0430 \u0441\u0432\u044f\u0437\u044c \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u043e\u0432 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430, \u0440\u043e\u0432\u043d\u043e \u043a\u0430\u043a \u0438 \u0434\u0438\u043b\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<br \/>   \u2014 \u0414\u043e\u043b\u0436\u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u044b \u043e\u043d\u0438 \u0442\u0430\u043a\u0438\u0435 \u00ab\u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u044b\u00bb.<br \/>   \u2014 \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430 \u0431\u0430\u0437\u0435 Mysql master-slave replication. <\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434\u044b \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f: <\/p>\n<p>   \u2014 \u0414\u043b\u044f \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430(slave) \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e \u043a\u0440\u043e\u043d\u0443, \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 mysql.<br \/>   \u2014 \u0422.\u043a. \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a master \u0431\u0430\u0437\u0435 \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u044b, binlog \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0430\u043a \u0434\u043e\u043b\u0433\u043e \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 slave \u043d\u0435 \u0441\u043a\u0430\u0447\u0430\u044e\u0442 \u0435\u0433\u043e \u0441\u0435\u0431\u0435.<\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435:<br \/>   \u2014 \u0418\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440, \u043a\u0430\u043a\u0438\u0435 slave \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0436\u0435 \u00ab\u0441\u043a\u0430\u0447\u0430\u043b\u0438\u00bb. \u0410 \u0442\u043e\u0447\u043d\u0435\u0435 \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u0430\u043c\u044b\u0439 \u00ab\u043b\u0435\u043d\u0438\u0432\u044b\u0439\u00bb slave. <br \/>   \u2014 \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 binlog \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c.<\/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-194918","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/194918","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=194918"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/194918\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194918"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}