{"id":2950,"date":"2011-06-27T13:30:52","date_gmt":"2011-06-27T05:30:52","guid":{"rendered":"http:\/\/www.orczhou.com\/?p=2950"},"modified":"2011-10-27T20:20:30","modified_gmt":"2011-10-27T12:20:30","slug":"mysql-5-5-semi-sync-replication-setup-config","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2011\/06\/mysql-5-5-semi-sync-replication-setup-config\/","title":{"rendered":"MySQL 5.5 Semi-sync Replication\u5b89\u88c5\u914d\u7f6e\u3001\u53c2\u6570\u8bf4\u660e"},"content":{"rendered":"<p>\u4ece09\u5e7412\u6708\u4efdMySQL5.5\u7684<a href=\"http:\/\/www.orczhou.com\/index.php\/2009\/12\/mysql-55-semi-sync-replication\/\">\u7b2c\u4e00\u4e2aRelease<\/a>\uff0c\u518d\u5230\u53bb\u5e74<a href=\"http:\/\/blogs.oracle.com\/MySQL\/entry\/mysql_55_is_ga\">12\u6708\u7684\u7b2c\u4e00\u4e2aGA<\/a>\uff0cMySQL5.5\u5e73\u5747<a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/news-5-5-x.html\">\u4e00\u6708\u4e00\u4e2a\u5c0f\u7248\u672c\u53f7\u7684\u901f\u5ea6<\/a>\u5728\u9ed8\u9ed8\u66f4\u65b0\u3002\u8be5\u7248\u672c\u6700\u91cd\u8981\u7684\u7279\u6027\u76ee\u524d\u4ecd\u662fSemi-sync Replication\uff0c\u4e4b\u524d\u505a\u4e86\u4e00\u4e2a<a href=\"http:\/\/www.orczhou.com\/index.php\/2009\/12\/mysql-55-semi-sync-replication\/\">\u6982\u8ff0<\/a>\uff0c\u8fd9\u91cc\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u3001\u914d\u7f6eSemi-sync\uff0c\u540e\u7eed\u8fd8\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u5176\u6027\u80fd\u548c\u4e00\u4e9b\u57fa\u672c\u7684\u4ee3\u7801\u5b9e\u73b0\u3002<\/p>\n<div class=\"myt1\">1. Semi-sync Repication\u7684\u5386\u53f2<\/div>\n<p>Semi-sync\u6700\u65e9\u662f\u7531Google\u5b9e\u73b0\u7684\u4e00\u4e2a\u8865\u4e01\uff0c\u4ee3\u7801\u4e3b\u8981\u7531<a href=\"http:\/\/forge.mysql.com\/wiki\/ReplicationFeatures\/SemiSyncReplication\">Mark Callaghan\u3001Wei Li<\/a>\uff08@Google\uff09\u7b49\u4eba\u8d21\u732e\u3002Google\u539f\u672c\u662f\u5c06<a href=\"http:\/\/code.google.com\/p\/google-mysql-tools\/wiki\/SemiSyncReplication\">\u9700\u6c42\u63d0\u7ed9Hekki<\/a>\u7684\uff0c\u4f46\u662f\u540e\u6765\u7b49\u4e0d\u53ca\u5c31\u81ea\u5df1\u5b9e\u73b0\u4e86&#8230;&#8230;\u3002(\u73b0\u5728Mark Callaghan\u5df2\u8df3\u5230Facebook\uff0c\u9664\u4e86Google\uff0c<a href=\"http:\/\/www.linkedin.com\/pub\/mark-callaghan\/2\/249\/894\">\u4ed6\u66fe\u7ecf\u8fd8\u5728Informix\u3001Oracle\u5de5\u4f5c\u8fc7<\/a>)<\/p>\n<p>\u57285.5\u4e4b\u540e\u7531<a href=\"http:\/\/forge.mysql.com\/wiki\/ReplicationTeam\">MySQL Replication Team<\/a>\u6309\u7167Plugin\u7684\u65b9\u5f0f\u5c06\u4ee3\u7801\u79fb\u690d\u8fc7\u6765\uff0c\u5e76\u5c06Semi-sync\u72ec\u7acb\u6210MySQL\u7684\u4e00\u4e2a\u63d2\u4ef6\uff0c\u4e3b\u8981\u4ee3\u7801\u79fb\u690d\u8005\u662fZhenxing He\uff08<a href=\"http:\/\/forge.mysql.com\/wiki\/ReplicationTeam\">\u53c2\u8003<\/a>\uff09\u3002<\/p>\n<div class=\"myt1\">2. \u5b89\u88c5\u3001\u914d\u7f6eSemi-sync Replication<\/div>\n<p>\u5728\u4e24\u53f0\u4e3b\u673a\u4e0a<a href=\"http:\/\/www.orczhou.com\/index.php\/2011\/06\/compile-and-install-mysql-5-5-from-source\/\">\u5b89\u88c5\u597d<\/a>MySQL5.5\uff0c\u7f16\u8bd1\u597d\u7684\u63d2\u4ef6\u5728\u76ee\u5f55CMAKE_INSTALL_PREFIX\/lib\/plugin\u4e0b\uff08\u9ed8\u8ba4\u662f\/usr\/local\/mysql\/lib\/plugin\uff09\u3002\u4f8b\u5982\u8fd9\u91cc\u7f16\u8bd1\u662f\u6307\u5b9aCMAKE_INSTALL_PREFIX\u4e3a\/home\/mysql\/mysql\uff0c\u5219\u6709\uff1a<\/p>\n<div class=\"mycode\">$pwd<br \/>\n\/home\/mysql\/mysql\/lib\/plugin<br \/>\n$ls -a semisync_*<br \/>\nsemisync_master.so  semisync_slave.so<\/div>\n<p>\u5728\u4e3b\u5e93\u521d\u6b21\u542f\u52a8\u65f6\uff0c\u6267\u884c\u5982\u4e0b\u8bed\u53e5\u52a0\u8f7dsemisync_master\u63d2\u4ef6\uff1a<\/p>\n<div class=\"mycode\">mysql> INSTALL PLUGIN rpl_semi_sync_master SONAME &#8216;semisync_master.so&#8217;;<\/div>\n<p>\u5907\u5e93\u4e0a\u5219\u52a0\u8f7dsemisync_slave\u63d2\u4ef6\uff1a<\/p>\n<div class=\"mycode\">mysql> INSTALL PLUGIN rpl_semi_sync_slave SONAME &#8216;semisync_slave.so&#8217;;<\/div>\n<p><!--more--><\/p>\n<p>\u5728\u521d\u6b21\u52a0\u8f7d\u63d2\u4ef6\u540e\uff0cMySQL\u4f1a\u5c06\u8be5\u63d2\u4ef6\u8bb0\u5f55\u5230\u7cfb\u7edf\u8868mysql.plugin\u4e2d\uff0c\u4e0b\u6b21\u542f\u52a8\u65f6\u7cfb\u7edf\u5219\u4f1a\u81ea\u52a8\u52a0\u8f7d\u8be5\u63d2\u4ef6\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6267\u884c\u4e0a\u9762\u7684\u547d\u4ee4\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u4e3b\u5907\u5e93\u7684\u914d\u7f6e\u6587\u4ef6my.cnf\u8fd8\u9700\u8981\u65b0\u589e\u5982\u4e0b\u8bb0\u5f55\u6765\u6253\u5f00semi-sync\u3002\u4e3b\u5e93\u4e0a\uff0c\u65b0\u589e\u5982\u4e0b\u53c2\u6570\uff1a<\/p>\n<div class=\"mycode\">$vi my.cnf<br \/>\n&#8230;<br \/>\nrpl_semi_sync_master_enabled=1<br \/>\nrpl_semi_sync_master_timeout=1000<br \/>\n&#8230;<\/div>\n<p>\u5907\u5e93\u4e0a\u65b0\u589e\uff1a<\/p>\n<div class=\"mycode\">$vi my.cnf<br \/>\n&#8230;<br \/>\nrpl_semi_sync_slave_enabled=1<br \/>\n&#8230;<\/div>\n<p>\u90a3\u4e48\u4e3b\u5907\u5728\u542f\u52a8\u540e\uff0c\u4e14slave\u7ebf\u7a0b\u5f00\u59cbdump\u4e3b\u5e93\u7684\u65e5\u5fd7\u540e\uff0cSemi-sync Replication\u5c31\u4f1a\u5f00\u542f\uff0c\u4e0a\u9762\u7684\u914d\u7f6e(rpl_semi_sync_master_timeout=1000)\u8868\u793a\u4e3b\u5e93\u5728\u67d0\u6b21\u4e8b\u52a1\u4e2d\uff0c\u5982\u679c\u7b49\u5f85\u65f6\u95f4\u8d85\u8fc71000\u6beb\u79d2\uff0c\u90a3\u4e48\u5219\u964d\u7ea7\u4e3a\u666e\u901a\u6a21\u5f0f\uff0c\u4e0d\u518d\u7b49\u5f85\u5907\u5e93\u3002\u5982\u679c\u4e3b\u5e93\u518d\u6b21\u63a2\u6d4b\u5230\uff0c\u5907\u5e93\u6062\u590d\u4e86\uff0c\u5219\u4f1a\u81ea\u52a8\u518d\u6b21\u56de\u5230Semi-sync\u72b6\u6001\u3002<\/p>\n<div class=\"myt1\">3. \u5176\u4ed6\u53c2\u6570<\/div>\n<p>Semi-sync\u7684<a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/server-system-variables.html#sysvar_rpl_semi_sync_master_timeout\">\u914d\u7f6e\u53c2\u6570\u4e0d\u591a<\/a>\uff0c\u6309\u7167\u4e0a\u9762\u914d\u7f6e\u5c31\u53ef\u4ee5\u4e86\uff0c\u5176\u4ed6\u5c11\u6570\u51e0\u4e2a\u53c2\u6570\u9ed8\u8ba4\u5373\u53ef\u3002<\/p>\n<p>\u4e3b\u5e93\u4e0a\u7684\u5176\u4ed6\u53c2\u6570\uff1a<\/p>\n<pre><div class=\"mycode\">mysql> show variables like \"%rpl_semi%\";\r\n+------------------------------------+-------+\r\n| Variable_name                      | Value |\r\n+------------------------------------+-------+\r\n| rpl_semi_sync_master_enabled       | ON    |\r\n| rpl_semi_sync_master_timeout       | 1000  |\r\n| rpl_semi_sync_master_trace_level   | 32    |\r\n| rpl_semi_sync_master_wait_no_slave | ON    |\r\n+------------------------------------+-------+\r\n<\/div><\/pre>\n<p>\u5907\u5e93\u4e0a\u6709\uff1a<\/p>\n<pre><div class=\"mycode\">mysql> show variables like \"%rpl_semi%\";\r\n+------------------------------------+-------+\r\n| Variable_name                      | Value |\r\n+------------------------------------+-------+\r\n| rpl_semi_sync_master_wait_no_slave | ON    |\r\n| rpl_semi_sync_slave_enabled        | ON    |\r\n| rpl_semi_sync_slave_trace_level    | 32    |\r\n+------------------------------------+-------+\r\n<\/div><\/pre>\n<p>rpl_semi_sync_master_trace_level\u548crpl_semi_sync_slave_trace_level\u662f\u53ef\u4ee5\u7ec4\u5408\uff08\u6c42\u6216\uff09\u7684\u53c2\u6570\uff0c\u53ef\u4ee5\u662f\u4e0b\u9762\u503c\u7684\u7ec4\u5408\uff1a<\/p>\n<blockquote><p>1 = general level (for example, time function failures)<br \/>\n16 = detail level (more verbose information)<br \/>\n32 = net wait level (more information about network waits)<br \/>\n64 = function level (information about function entry and exit)<\/p><\/blockquote>\n<div class=\"myt1\">4. \u8fd0\u884c\u72b6\u6001\u67e5\u770b<\/div>\n<p>\u5907\u5e93\u4e0a\u5f88\u7b80\u5355\uff0c\u53ea\u6709\u4e00\u4e2a\u72b6\u6001\u503c\uff0c\u67e5\u770b\u5907\u5e93\u662f\u5426\u5f00\u542f\u4e86Semi-sync\u529f\u80fd\uff1a<\/p>\n<pre><div class=\"mycode\">show status like \"%rpl_semi%\";\r\n+----------------------------+-------+\r\n| Variable_name              | Value |\r\n+----------------------------+-------+\r\n| Rpl_semi_sync_slave_status | ON    |\r\n+----------------------------+-------+<\/div><\/pre>\n<p>\u4e3b\u5e93\u9700\u8981\u5173\u6ce8\u7684\u72b6\u6001\u503c\u5219\u6bd4\u8f83\u591a<\/p>\n<pre><div class=\"mycode\">mysql> show status like \"%rpl_semi%\";\r\n+--------------------------------------------+---------------+\r\n| Variable_name                              | Value         |\r\n+--------------------------------------------+---------------+\r\n| Rpl_semi_sync_master_clients               | 1             |# \u6709\u591a\u5c11\u4e2aSemi-sync\u7684\u5907\u5e93\r\n| Rpl_semi_sync_master_net_avg_wait_time     | 732           |# \u4e8b\u52a1\u63d0\u4ea4\u540e\uff0c\u7b49\u5f85\u5907\u5e93\u54cd\u5e94\u7684\u5e73\u5747\u65f6\u95f4\r\n| Rpl_semi_sync_master_net_wait_time         | 1042785285    |# \u7b49\u5f85\u7f51\u7edc\u54cd\u5e94\u7684\u603b\u6b21\u6570\r\n| Rpl_semi_sync_master_net_waits             | 1423323       |# \u603b\u7684\u7f51\u7edc\u7b49\u5f85\u65f6\u95f4\r\n| Rpl_semi_sync_master_no_times              | 0             |# \u4e00\u5171\u6709\u51e0\u6b21\u4eceSemi-sync\u8dcc\u56de\u666e\u901a\u72b6\u6001\r\n| Rpl_semi_sync_master_no_tx                 | 0             |# \u5907\u5e93\u672a\u53ca\u65f6\u54cd\u5e94\u7684\u4e8b\u52a1\u6570\r\n| Rpl_semi_sync_master_status                | ON            |# \u4e3b\u5e93\u4e0aSemi-sync\u662f\u5426\u6b63\u5e38\u5f00\u542f\r\n| Rpl_semi_sync_master_timefunc_failures     | 0             |# \u65f6\u95f4\u51fd\u6570\u672a\u6b63\u5e38\u5de5\u4f5c\u7684\u6b21\u6570\r\n| Rpl_semi_sync_master_tx_avg_wait_time      | 29059         |# \u5f00\u542fSemi-sync\uff0c\u4e8b\u52a1\u8fd4\u56de\u9700\u8981\u7b49\u5f85\u7684\u5e73\u5747\u65f6\u95f4\r\n| Rpl_semi_sync_master_tx_wait_time          | 8164966680929 |# \u4e8b\u52a1\u7b49\u5f85\u5907\u5e93\u54cd\u5e94\u7684\u603b\u65f6\u95f4\r\n| Rpl_semi_sync_master_tx_waits              | 280974820     |# \u4e8b\u52a1\u7b49\u5f85\u5907\u5e93\u54cd\u5e94\u7684\u603b\u6b21\u6570\r\n| Rpl_semi_sync_master_wait_pos_backtraverse | 5499398       |# \u6539\u53d8\u5f53\u524d\u7b49\u5f85\u6700\u5c0f\u4e8c\u8fdb\u5236\u65e5\u5fd7\u7684\u6b21\u6570\r\n| Rpl_semi_sync_master_wait_sessions         | 230           |# \u5f53\u524d\u6709\u51e0\u4e2a\u7ebf\u7a0b\u5728\u7b49\u5907\u5e93\u54cd\u5e94\r\n| Rpl_semi_sync_master_yes_tx                | 16801244      |# Semi-sync\u6a21\u5f0f\u4e0b\uff0c\u6210\u529f\u7684\u4e8b\u52a1\u6570\r\n+--------------------------------------------+---------------+<\/div><\/pre>\n<p>\u4e0a\u9762\u6bd4\u8f83\u91cd\u8981\u7684\u72b6\u6001\u503c\u6709\uff1a<\/p>\n<p>Rpl_semi_sync_master_tx_avg_wait_time\uff1a\u4e8b\u52a1\u56e0\u5f00\u542fSemi_sync\uff0c<strong>\u5e73\u5747<\/strong>\u9700\u8981\u989d\u5916\u7b49\u5f85\u7684\u65f6\u95f4<\/p>\n<p>Rpl_semi_sync_master_net_avg_wait_time\uff1a\u4e8b\u52a1\u8fdb\u5165\u7b49\u5f85\u961f\u5217\u540e\uff0c\u5230\u7f51\u7edc\u5e73\u5747\u7b49\u5f85\u65f6\u95f4<\/p>\n<p>\u4f9d\u636e\u4e0a\u9762\u4e24\u4e2a\u72b6\u6001\u503c\u53ef\u4ee5\u77e5\u9053\uff0cSemi-sync\u7684\u7f51\u7edc\u6d88\u8017\u6709\u591a\u5927\uff0c\u7ed9\u67d0\u4e2a\u4e8b\u52a1\u5e26\u6765\u7684\u989d\u5916\u7684\u6d88\u8017\u6709\u591a\u5927\u3002<\/p>\n<p>Rpl_semi_sync_master_status \u5219\u8868\u793a\u5f53\u524dSemi-sync\u662f\u5426\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<p>\u4eceRpl_semi_sync_master_no_times\u53d8\u91cf\uff0c\u53ef\u4ee5\u77e5\u9053\u4e00\u6bb5\u65f6\u95f4\u5185\uff0cSemi-sync\u662f\u5426\u6709\u8d85\u65f6\u5931\u8d25\u8fc7\uff0c\u8be5\u8ba1\u6570\u5668\u5219\u8bb0\u5f55\u4e86\u8fd9\u6837\u7684\u5931\u8d25\u6b21\u6570\u3002<\/p>\n<p>\u6bd4\u8f83\u96be\u7406\u89e3\u53c2\u6570\u6709\uff1a<\/p>\n<p><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/server-status-variables.html#statvar_Rpl_semi_sync_master_wait_pos_backtraverse\">Rpl_semi_sync_master_wait_pos_backtraverse<\/a>\uff1a\u8fd9\u4e2a\u7a0d\u5fae\u96be\u7406\u89e3\u4e00\u70b9\uff0c\u4e0d\u8fc7\u8be5\u53c2\u6570\u5e76\u4e0d\u91cd\u8981\u3002<\/p>\n<div class=\"myt1\">5. \u5173\u4e8eRpl_semi_sync_master_wait_pos_backtraverse<\/div>\n<p>\u82b1\u4e86\u4e00\u4e9b\u65f6\u95f4\u5f04\u660e\u767d\u8fd9\u4e2a\u53d8\u91cf\uff0c\u7ee7\u7eed\u8bc1\u5b9e\u4e86\u8fd9\u4e2a\u53d8\u91cf\u786e\u5b9e\u4e0d\u91cd\u8981\u3002<\/p>\n<p>\u5728semisync_master\u4e2d\uff0c\u7ef4\u62a4\u4e86\u8fd9\u6837\u7684\u4e24\u4e2a\u53d8\u91cfwait_file_name_\u548cwait_file_pos_\uff0c\u5f53\u4e3b\u5e93\u4e0a\u591a\u4e2a\u4e8b\u52a1\u90fd\u5728\u7b49\u5f85\u5907\u5e93\u7684\u54cd\u5e94\u65f6\uff0c\u8fd9\u4e24\u4e2a\u53d8\u91cf\u8bb0\u5f55\u4e86\u6240\u6709\u7b49\u5f85\u4e2d\uff0c\u6700\u5c0f\u7684\u90a3\u4e00\u4e2aBinlog\u4f4d\u7f6e\u3002\u5982\u679c\u8fd9\u65f6\uff0c\u4e00\u4e2a\u65b0\u7684\u4e8b\u52a1\u52a0\u5165\u7b49\u5f85\uff0c\u5e76\u4e14\u8be5\u4e8b\u52a1\u9700\u8981\u7b49\u5f85\u7684Binlog\u6bd4wait_file_name_\u548cwait_file_pos_\u8fd8\u5c0f\u7684\u8bdd\uff0c\u5219\u66f4\u65b0\u8fd9\u4e24\u4e2a\u503c\uff0c\u5e76\u5c06Rpl_semi_sync_master_wait_pos_backtraverse\u503c\u81ea\u589e\u4e00\u6b21\u3002<\/p>\n<p>\u4e0a\u9762\u7684\u89e3\u91ca\u53c2\u8003\u5982\u4e0b\u4ee3\u7801\u6bb5\uff08semisync_master.cc\uff09\uff1a<\/p>\n<pre><div class=\"mycode\">int cmp = ActiveTranx::compare(trx_wait_binlog_name, trx_wait_binlog_pos,\r\n                               wait_file_name_, wait_file_pos_);\r\nif (cmp <= 0)\r\n{\r\n  \/* This thd has a lower position, let's update the minimum info. *\/\r\n  strcpy(wait_file_name_, trx_wait_binlog_name);\r\n  wait_file_pos_ = trx_wait_binlog_pos;\r\n\r\n  rpl_semi_sync_master_wait_pos_backtraverse++;\r\n  if (trace_level_ &#038; kTraceDetail)\r\n    sql_print_information(\"%s: move back wait position (%s, %lu),\",\r\n                          kWho, wait_file_name_, (unsigned long)wait_file_pos_);\r\n}<\/div><\/pre>\n<p>\u7d2f\u4e86\uff0c\u542c\u9996\u6b4c\uff0c\u4f38\u4e2a\u61d2\u8170\u5427:)<\/p>\n<p><script type=\"text\/javascript\" src=\"http:\/\/www.xiami.com\/widget\/player-single?uid=318706&#038;sid=128281&#038;mode=js\"><\/script><\/p>\n<p>\u5e7f\u544a\uff1a<a href=\"http:\/\/www.orczhou.com\/index.php\/projects\/we-are-hunting-mysql-hacker\/\">\u6211\u4eec\u5bfb\u627e\u9760\u8c31\u7684\u4eba<\/a> | <a href=\"http:\/\/www.orczhou.com\/index.php\/wish-list\/\">\u611f\u8c22\u4f5c\u8005<\/a><\/p>\n<p>\u53c2\u8003\u6587\u732e\uff1a<\/p>\n<p>1. <a href=\"http:\/\/forge.mysql.com\/wiki\/ReplicationFeatures\/SemiSyncReplication\">ReplicationFeatures\/SemiSyncReplication<\/a><\/p>\n<p>2. <a href=\"http:\/\/code.google.com\/p\/google-mysql-tools\/wiki\/SemiSyncReplication\">SemiSync Replication of Google-mysql-tool<\/a><\/p>\n<p>3. <a href=\"http:\/\/code.google.com\/p\/google-mysql-tools\/wiki\/SemiSyncReplicationDesign\">SemiSyncReplicationDesign<\/a><\/p>\n<p>4. <a href=\"http:\/\/forge.mysql.com\/wiki\/ReplicationTeam\">ReplicationTeam<\/a><\/p>\n<p>5. <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/replication-semisync.html\">MySQL Manual Semisynchronous Replication<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece09\u5e7412\u6708\u4efdMySQL5.5\u7684\u7b2c\u4e00\u4e2aRelease\uff0c\u518d\u5230\u53bb\u5e7412\u6708\u7684\u7b2c\u4e00\u4e2aGA\uff0cMySQL5.5\u5e73\u5747\u4e00\u6708\u4e00\u4e2a\u5c0f\u7248\u672c\u53f7\u7684\u901f\u5ea6\u5728\u9ed8\u9ed8\u66f4\u65b0\u3002\u8be5\u7248\u672c\u6700\u91cd\u8981\u7684\u7279\u6027\u76ee\u524d\u4ecd\u662fSemi-sync Replication\uff0c\u4e4b\u524d\u505a\u4e86\u4e00\u4e2a\u6982\u8ff0\uff0c\u8fd9\u91cc\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u3001\u914d\u7f6eSemi-sync\uff0c\u540e\u7eed\u8fd8\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u5176\u6027\u80fd\u548c\u4e00\u4e9b\u57fa\u672c\u7684\u4ee3\u7801\u5b9e\u73b0\u3002 1. Semi-sync Repication\u7684\u5386\u53f2 Semi-sync\u6700\u65e9\u662f\u7531Google\u5b9e\u73b0\u7684\u4e00\u4e2a\u8865\u4e01\uff0c\u4ee3\u7801\u4e3b\u8981\u7531Mark Callaghan\u3001Wei Li\uff08@Google\uff09\u7b49\u4eba\u8d21\u732e\u3002Google\u539f\u672c\u662f\u5c06\u9700\u6c42\u63d0\u7ed9Hekki\u7684\uff0c\u4f46\u662f\u540e\u6765\u7b49\u4e0d\u53ca\u5c31\u81ea\u5df1\u5b9e\u73b0\u4e86&#8230;&#8230;\u3002(\u73b0\u5728Mark Callaghan\u5df2\u8df3\u5230Facebook\uff0c\u9664\u4e86Google\uff0c\u4ed6\u66fe\u7ecf\u8fd8\u5728Informix\u3001Oracle\u5de5\u4f5c\u8fc7) \u57285.5\u4e4b\u540e\u7531MySQL Replication Team\u6309\u7167Plugin\u7684\u65b9\u5f0f\u5c06\u4ee3\u7801\u79fb\u690d\u8fc7\u6765\uff0c\u5e76\u5c06Semi-sync\u72ec\u7acb\u6210MySQL\u7684\u4e00\u4e2a\u63d2\u4ef6\uff0c\u4e3b\u8981\u4ee3\u7801\u79fb\u690d\u8005\u662fZhenxing He\uff08\u53c2\u8003\uff09\u3002 2. \u5b89\u88c5\u3001\u914d\u7f6eSemi-sync Replication \u5728\u4e24\u53f0\u4e3b\u673a\u4e0a\u5b89\u88c5\u597dMySQL5.5\uff0c\u7f16\u8bd1\u597d\u7684\u63d2\u4ef6\u5728\u76ee\u5f55CMAKE_INSTALL_PREFIX\/lib\/plugin\u4e0b\uff08\u9ed8\u8ba4\u662f\/usr\/local\/mysql\/lib\/plugin\uff09\u3002\u4f8b\u5982\u8fd9\u91cc\u7f16\u8bd1\u662f\u6307\u5b9aCMAKE_INSTALL_PREFIX\u4e3a\/home\/mysql\/mysql\uff0c\u5219\u6709\uff1a $pwd \/home\/mysql\/mysql\/lib\/plugin $ls -a semisync_* semisync_master.so semisync_slave.so \u5728\u4e3b\u5e93\u521d\u6b21\u542f\u52a8\u65f6\uff0c\u6267\u884c\u5982\u4e0b\u8bed\u53e5\u52a0\u8f7dsemisync_master\u63d2\u4ef6\uff1a mysql> INSTALL PLUGIN rpl_semi_sync_master SONAME &#8216;semisync_master.so&#8217;; \u5907\u5e93\u4e0a\u5219\u52a0\u8f7dsemisync_slave\u63d2\u4ef6\uff1a mysql> INSTALL PLUGIN rpl_semi_sync_slave SONAME &#8216;semisync_slave.so&#8217;;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[6],"tags":[69,68,70,71],"class_list":["post-2950","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-mysql5-5","tag-semi-sync","tag-semi-sync-replication","tag-71"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=2950"}],"version-history":[{"count":39,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2950\/revisions"}],"predecessor-version":[{"id":3247,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2950\/revisions\/3247"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=2950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=2950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=2950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}