<?xml version="1.0" encoding="UTF-8" ?><oembed><version>1.0</version><provider_name>Jui-Nan Lin&#039;s Blog</provider_name><provider_url>https://jnlin.org</provider_url><author_name>jnlin</author_name><author_url>https://jnlin.org/author/jnlin/</author_url><title>Galera 3.x 的 Replication Relaying</title><html>Galera 3.x 為了多機房間的 Replication，設計了 gmcast.segment 這個參數。前陣子 Percona 的人出來介紹了這個參數背後的機制：&lt;a href=&quot;http://www.mysqlperformanceblog.com/2013/12/19/automatic-replication-relaying-galera-3/&quot;&gt;Automatic replication relaying in Galera 3.x (available with PXC 5.6)&lt;/a&gt;。大致摘錄如下：

&lt;ol&gt;
&lt;li&gt;同一個機房內資料庫的 gmcast.segment 參數要設為相同。&lt;/li&gt;
&lt;li&gt;機房與機房之間的 Replication 會自動找一個 node 進行 Relay，以降低 Replication 需要的頻寬。&lt;br /&gt;&lt;img src=&quot;http://jnlin.org/wp-content/images/segments.png&quot;/&gt;&lt;br /&gt;Image from: &lt;a href=&quot;http://www.mysqlperformanceblog.com/2013/12/19/automatic-replication-relaying-galera-3/&quot;&gt;Automatic replication relaying in Galera 3.x (available with PXC 5.6)&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

如果沒有設定 gmcast.segment 參數的話，同樣是三個 Node，會耗用兩倍的頻寬：&lt;br /&gt;
&lt;img src=&quot;http://jnlin.org/wp-content/images/nosegments.png&quot;/&gt;&lt;br /&gt;Image from: &lt;a href=&quot;http://www.mysqlperformanceblog.com/2013/12/19/automatic-replication-relaying-galera-3/&quot;&gt;Automatic replication relaying in Galera 3.x (available with PXC 5.6)&lt;/a&gt;

原文中另外有對作了 segment 與不作 segment 的 commit latency 進行比較，結果作了 segment 的 commit latency 並沒有比較高。如果有跨機房需求，應該要設定 gmcast.segment。
</html><type>rich</type></oembed>