|
43 | 43 | </para> |
44 | 44 | </section> |
45 | 45 |
|
| 46 | + <section id="bridge_replication" xreflabel="Cluster-Bridge Replication"> |
| 47 | + <title>Cluster-Bridge Replication</title> |
| 48 | + <para> |
| 49 | + <emphasis>(added in OpenSIPS 4.0)</emphasis> |
| 50 | + </para> |
| 51 | + <para> |
| 52 | + Cluster-Bridge Replication (or "bridge replication") allows modules to |
| 53 | + exchange data across <emphasis>different</emphasis> clusters. This |
| 54 | + is meant to serve as a topology/data flow optimization feature, and it |
| 55 | + could be useful in some OpenSIPS cluster setups with multiple data |
| 56 | + centers. In such cases, it might be desirable to minimize the amount |
| 57 | + of inter-DC replication channels, for example: |
| 58 | + </para> |
| 59 | + <para> |
| 60 | + <programlisting format="linespecific"> |
| 61 | + |
| 62 | + Before (standard, full-mesh replication): |
| 63 | + |
| 64 | + DC #1 DC #2 |
| 65 | + WAN link |
| 66 | + A <─────────> C |
| 67 | + ^ \ / ^ |
| 68 | + │ \ / │ 4 x OpenSIPS nodes, 1 x cluster |
| 69 | + │ X │ (8 inter-DC replication channels) |
| 70 | + │ / \ │ AC, AD, BC, BD, CA, CB, DA, DB |
| 71 | + v / \ v |
| 72 | + B <─────────> D |
| 73 | + WAN link |
| 74 | + cluster_id: 1 |
| 75 | + |
| 76 | + After (cluster-bridged replication): |
| 77 | + |
| 78 | + DC #1 DC #2 |
| 79 | + WAN link |
| 80 | + A ──────────> C |
| 81 | + ^ ^ |
| 82 | + │ │ 4 x OpenSIPS nodes, 2 x clusters |
| 83 | + │ │ (2 inter-DC replication channels) |
| 84 | + │ │ AC, DB |
| 85 | + v v |
| 86 | + B <────────── D |
| 87 | + WAN link |
| 88 | + cluster_id: 1 cluster_id: 2 |
| 89 | + sender: <emphasis role='bold'>wan1</emphasis> shtag sender: <emphasis role='bold'>wan1</emphasis> shtag |
| 90 | + </programlisting> |
| 91 | + |
| 92 | + </para> |
| 93 | + <para> |
| 94 | + A <emphasis>new table</emphasis> has been added to represent the |
| 95 | + inter-cluster replication bridges, named |
| 96 | + <link linkend="param_db_bridge_table">clusterer_bridge</link>: |
| 97 | + <programlisting> |
| 98 | + |
| 99 | + mysql> select * from clusterer_bridge; |
| 100 | + +----+-----------+-----------+------------+-------------------------------+ |
| 101 | + | id | cluster_a | cluster_b | send_shtag | dst_node_csv | |
| 102 | + +----+-----------+-----------+------------+-------------------------------+ |
| 103 | + | 1 | 1 | 2 | wan1 | bin:10.0.0.213,bin:10.0.0.214 | |
| 104 | + | 2 | 2 | 1 | wan1 | bin:10.0.0.210,bin:10.0.0.212 | |
| 105 | + +----+-----------+-----------+------------+-------------------------------+ |
| 106 | + 2 rows in set (0,00 sec) |
| 107 | + </programlisting> |
| 108 | + <emphasis>Example of a bi-directional bridge between clusters "1" and "2".</emphasis> |
| 109 | + </para> |
| 110 | + <para> |
| 111 | + The "send_shtag" controls the originator node for each cluster bridge defined in the table. |
| 112 | + Only the node with the "active" tag will actually send data over the network. |
| 113 | + Sharing tags can be defined using the <xref linkend="param_sharing_tag"/> module parameter. |
| 114 | + </para> |
| 115 | + <para> |
| 116 | + The "dst_node_csv" functions as a list of remote cluster nodes to try. |
| 117 | + The module will attempt a single TCP send per node, in failover fashion (always same order). |
| 118 | + </para> |
| 119 | + |
| 120 | + <para> |
| 121 | + At the time of writing, the only module using the new bridge replication |
| 122 | + feature is <ulink url='ratelimit#bridge_replication'>ratelimit</ulink>, |
| 123 | + in order to optimize its "CPS pipes broadcasting" replication mechanism. |
| 124 | + </para> |
| 125 | + </section> |
| 126 | + |
46 | 127 | <section id="dependencies" xreflabel="Dependencies"> |
47 | 128 | <title>Dependencies</title> |
48 | 129 | <section> |
@@ -170,6 +251,26 @@ modparam("clusterer", "db_url", |
170 | 251 | <programlisting format="linespecific"> |
171 | 252 | ... |
172 | 253 | modparam("clusterer", "db_table", "clusterer") |
| 254 | +... |
| 255 | + </programlisting> |
| 256 | + </example> |
| 257 | + </section> |
| 258 | + |
| 259 | + <section id="param_db_bridge_table" xreflabel="db_bridge_table"> |
| 260 | + <title><varname>db_bridge_table</varname></title> |
| 261 | + <para> |
| 262 | + The name of the table storing the inter-cluster bridge definitions. |
| 263 | + </para> |
| 264 | + <para> |
| 265 | + <emphasis> |
| 266 | + Default value is <quote>clusterer_bridge</quote>. |
| 267 | + </emphasis> |
| 268 | + </para> |
| 269 | + <example> |
| 270 | + <title>Set <varname>db_bridge_table</varname> parameter</title> |
| 271 | + <programlisting format="linespecific"> |
| 272 | +... |
| 273 | +modparam("clusterer", "db_bridge_table", "clusterer_bridge") |
173 | 274 | ... |
174 | 275 | </programlisting> |
175 | 276 | </example> |
|
0 commit comments