Skip to content

Commit 8a19310

Browse files
committed
clusterer_controller docs: make every cluster explicit in config examples
Reviewed all config examples so every cluster is clearly and self-containedly defined, per reviewer feedback: - Show modparam("clusterer","cluster_id",N) for each controller-managed cluster in the full-config and multi-cluster examples (previously several relied on the implicit auto-create-on-capability-registration path, so the cluster never appeared "defined" in the snippet). - Hybrid DB example: note that native cluster 10 is defined by rows in the clusterer DB table (not a modparam), and fix the misleading "this node id in cluster 10" comment (my_node_id is a single global id across all DB clusters). - Add the missing "Hybrid, no DB" (static) example to the admin guide, with the required db_mode=0 (without it my_node_info/neighbor_node_info are ignored). - Comment use_controller as the global switch throughout. No behavior change - documentation only. README regenerated.
1 parent 4348580 commit 8a19310

2 files changed

Lines changed: 171 additions & 21 deletions

File tree

‎modules/clusterer_controller/README‎

Lines changed: 100 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ CLUSTERER_CONTROLLER Module
9090

9191
1.22. Multiple clusters — same multicast IP, different ports
9292
1.23. Hybrid — DB-native cluster 10 + controller cluster 1
93-
1.24. Minimal HA cluster configuration
93+
1.24. Hybrid, no DB — static native cluster 7 + controller
94+
cluster 1
95+
96+
1.25. Minimal HA cluster configuration
9497

9598
Chapter 1. Admin Guide
9699

@@ -827,6 +830,12 @@ modparam("clusterer_controller", "password", "MyStr0ngPassw0rd!")
827830

828831
Example 1.8. Global manage_shtags — applies to all clusters
829832
...
833+
# clusters 1 and 2 registered as controller-managed on the clusterer sid
834+
e
835+
modparam("clusterer", "use_controller", 1)
836+
modparam("clusterer", "cluster_id", 1)
837+
modparam("clusterer", "cluster_id", 2)
838+
830839
# Enable automatic failover for every cluster (this is also the default)
831840
modparam("clusterer_controller", "manage_shtags", 1)
832841
modparam("clusterer_controller", "cluster", "id=1,multicast=239.0.90.1:3
@@ -838,6 +847,12 @@ modparam("clusterer_controller", "cluster", "id=2,multicast=239.0.90.2:3
838847
Example 1.9. Per-cluster override — opt one cluster out of
839848
automatic failover
840849
...
850+
# clusters 1 and 2 registered as controller-managed on the clusterer sid
851+
e
852+
modparam("clusterer", "use_controller", 1)
853+
modparam("clusterer", "cluster_id", 1)
854+
modparam("clusterer", "cluster_id", 2)
855+
841856
# manage_shtags=1 globally, but cluster 2 uses its own MI/event-route sc
842857
ripts
843858
modparam("clusterer_controller", "manage_shtags", 1)
@@ -849,6 +864,12 @@ modparam("clusterer_controller", "cluster",
849864

850865
Example 1.10. Global opt-out with one cluster opting in
851866
...
867+
# clusters 1 and 2 registered as controller-managed on the clusterer sid
868+
e
869+
modparam("clusterer", "use_controller", 1)
870+
modparam("clusterer", "cluster_id", 1)
871+
modparam("clusterer", "cluster_id", 2)
872+
852873
# Disable automatic failover globally; enable it only for cluster 1
853874
modparam("clusterer_controller", "manage_shtags", 0)
854875
modparam("clusterer_controller", "cluster",
@@ -869,7 +890,10 @@ socket=bin:10.22.23.191:3857
869890
loadmodule "proto_bin.so"
870891

871892
loadmodule "clusterer.so"
872-
modparam("clusterer", "use_controller", 1)
893+
modparam("clusterer", "use_controller", 1) # enable the controller p
894+
ath (global switch)
895+
modparam("clusterer", "cluster_id", 1) # register cluster 1 as c
896+
ontroller-managed
873897
modparam("clusterer", "sharing_tag", "vip1/1=active")
874898
modparam("clusterer", "ping_interval", 4)
875899
modparam("clusterer", "ping_timeout", 1500)
@@ -914,6 +938,11 @@ modparam("clusterer_controller", "password", "MyStr0ngPassw0rd!")
914938

915939
Example 1.12. Set master_stickiness parameter
916940
...
941+
# both clusters registered as controller-managed on the clusterer side
942+
modparam("clusterer", "use_controller", 1)
943+
modparam("clusterer", "cluster_id", 1)
944+
modparam("clusterer", "cluster_id", 2)
945+
917946
# Global default (sticky) — omit entirely for the same effect
918947
modparam("clusterer_controller", "master_stickiness", 1)
919948

@@ -1181,7 +1210,12 @@ socket=bin:10.0.2.10:5566
11811210
loadmodule "proto_bin.so"
11821211

11831212
loadmodule "clusterer.so"
1184-
modparam("clusterer", "use_controller", 1)
1213+
modparam("clusterer", "use_controller", 1) # enable the controller pat
1214+
h (global switch)
1215+
modparam("clusterer", "cluster_id", 1) # cluster 1 is controller-
1216+
managed
1217+
modparam("clusterer", "cluster_id", 2) # cluster 2 is controller-
1218+
managed
11851219

11861220
loadmodule "clusterer_controller.so"
11871221
# Cluster 1 — dialog replication group, LAN segment 10.0.1.0/24
@@ -1204,7 +1238,12 @@ socket=bin:10.22.23.191:3857
12041238
loadmodule "proto_bin.so"
12051239

12061240
loadmodule "clusterer.so"
1207-
modparam("clusterer", "use_controller", 1)
1241+
modparam("clusterer", "use_controller", 1) # enable the controller pat
1242+
h (global switch)
1243+
modparam("clusterer", "cluster_id", 1) # cluster 1 is controller-
1244+
managed
1245+
modparam("clusterer", "cluster_id", 2) # cluster 2 is controller-
1246+
managed
12081247

12091248
loadmodule "clusterer_controller.so"
12101249
modparam("clusterer_controller", "cluster",
@@ -1265,15 +1304,21 @@ loadmodule "db_mysql.so"
12651304
loadmodule "proto_bin.so"
12661305

12671306
loadmodule "clusterer.so"
1268-
# native side: cluster 10 lives in the DB (nodes provisioned there)
1307+
# native side: cluster 10 is defined entirely by rows in the clusterer D
1308+
B
1309+
# table (one row per node, including a row whose node_id = my_node_id be
1310+
low
1311+
# for THIS node) - there is no cluster_id modparam for native clusters.
12691312
modparam("clusterer", "db_mode", 1)
12701313
modparam("clusterer", "db_url", "mysql://opensips:pass@localhost/opensip
12711314
s")
1272-
modparam("clusterer", "my_node_id", 5) # this node's id in cluster
1273-
10
1274-
# controller side: cluster 1 is dynamic
1275-
modparam("clusterer", "use_controller", 1)
1276-
modparam("clusterer", "cluster_id", 1)
1315+
modparam("clusterer", "my_node_id", 5) # this node's id in its nati
1316+
ve/DB clusters (global)
1317+
# controller side: cluster 1 is dynamic (no DB, no static rows)
1318+
modparam("clusterer", "use_controller", 1) # enable the controller path
1319+
(global switch)
1320+
modparam("clusterer", "cluster_id", 1) # register cluster 1 as con
1321+
troller-managed
12771322

12781323
loadmodule "clusterer_controller.so"
12791324
modparam("clusterer_controller", "cluster",
@@ -1287,21 +1332,64 @@ ed
12871332
loadmodule "dispatcher.so"
12881333
modparam("dispatcher", "cluster_id", 10) # DB-native
12891334

1335+
Example 1.24. Hybrid, no DB — static native cluster 7 +
1336+
controller cluster 1
1337+
socket=bin:10.0.0.10:5566
1338+
1339+
loadmodule "proto_bin.so"
1340+
1341+
loadmodule "clusterer.so"
1342+
# native side: cluster 7 is provisioned statically (no DB).
1343+
# db_mode=0 is REQUIRED, otherwise my_node_info/neighbor_node_info are i
1344+
gnored.
1345+
modparam("clusterer", "db_mode", 0)
1346+
modparam("clusterer", "my_node_id", 5) # this node's id in
1347+
native cluster 7
1348+
modparam("clusterer", "my_node_info", "cluster_id=7, url=bin:10.0.
1349+
0.10:5566")
1350+
modparam("clusterer", "neighbor_node_info", "cluster_id=7, node_id=6, ur
1351+
l=bin:10.0.0.11:5566")
1352+
# controller side: cluster 1 is dynamic
1353+
modparam("clusterer", "use_controller", 1) # enable the contro
1354+
ller path (global switch)
1355+
modparam("clusterer", "cluster_id", 1) # register cluster
1356+
1 as controller-managed
1357+
1358+
loadmodule "clusterer_controller.so"
1359+
modparam("clusterer_controller", "cluster",
1360+
"id=1,multicast=239.0.90.1:3333,bin_socket=bin:10.0.0.10:5566,passwo
1361+
rd=S3cret")
1362+
1363+
loadmodule "dialog.so"
1364+
modparam("dialog", "dialog_replication_cluster", 1) # controller-manag
1365+
ed (cluster 1)
1366+
1367+
loadmodule "dispatcher.so"
1368+
modparam("dispatcher", "cluster_id", 7) # native (cluster 7
1369+
)
1370+
1371+
Here my_node_id=5 is this node's id in the native cluster 7; in
1372+
cluster 1 the controller assigns an id at runtime, which may
1373+
differ.
1374+
12901375
1.12. Configuration Example
12911376

12921377
The following example shows a minimal two-module configuration
12931378
for zero-config HA clustering with dialog replication. The
12941379
loadmodule order does not matter — the dependency system
12951380
enforces correct initialization order automatically.
12961381

1297-
Example 1.24. Minimal HA cluster configuration
1382+
Example 1.25. Minimal HA cluster configuration
12981383
# Each node needs an explicit BIN socket (no wildcard)
12991384
socket=bin:10.22.23.191:3857
13001385

13011386
loadmodule "proto_bin.so"
13021387

13031388
loadmodule "clusterer.so"
1304-
modparam("clusterer", "use_controller", 1)
1389+
modparam("clusterer", "use_controller", 1) # enable the controller p
1390+
ath (global switch)
1391+
modparam("clusterer", "cluster_id", 1) # register cluster 1 as c
1392+
ontroller-managed
13051393
modparam("clusterer", "sharing_tag", "vip1/1=active")
13061394
modparam("clusterer", "ping_interval", 4)
13071395
modparam("clusterer", "ping_timeout", 1500)

‎modules/clusterer_controller/doc/clusterer_controller_admin.xml‎

Lines changed: 71 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,11 @@ modparam("clusterer_controller", "password", "MyStr0ngPassw0rd!")
984984
<title>Global <varname>manage_shtags</varname> — applies to all clusters</title>
985985
<programlisting format="linespecific">
986986
...
987+
# clusters 1 and 2 registered as controller-managed on the clusterer side
988+
modparam("clusterer", "use_controller", 1)
989+
modparam("clusterer", "cluster_id", 1)
990+
modparam("clusterer", "cluster_id", 2)
991+
987992
# Enable automatic failover for every cluster (this is also the default)
988993
modparam("clusterer_controller", "manage_shtags", 1)
989994
modparam("clusterer_controller", "cluster", "id=1,multicast=239.0.90.1:3333")
@@ -995,6 +1000,11 @@ modparam("clusterer_controller", "cluster", "id=2,multicast=239.0.90.2:3333")
9951000
<title>Per-cluster override — opt one cluster out of automatic failover</title>
9961001
<programlisting format="linespecific">
9971002
...
1003+
# clusters 1 and 2 registered as controller-managed on the clusterer side
1004+
modparam("clusterer", "use_controller", 1)
1005+
modparam("clusterer", "cluster_id", 1)
1006+
modparam("clusterer", "cluster_id", 2)
1007+
9981008
# manage_shtags=1 globally, but cluster 2 uses its own MI/event-route scripts
9991009
modparam("clusterer_controller", "manage_shtags", 1)
10001010
modparam("clusterer_controller", "cluster",
@@ -1008,6 +1018,11 @@ modparam("clusterer_controller", "cluster",
10081018
<title>Global opt-out with one cluster opting in</title>
10091019
<programlisting format="linespecific">
10101020
...
1021+
# clusters 1 and 2 registered as controller-managed on the clusterer side
1022+
modparam("clusterer", "use_controller", 1)
1023+
modparam("clusterer", "cluster_id", 1)
1024+
modparam("clusterer", "cluster_id", 2)
1025+
10111026
# Disable automatic failover globally; enable it only for cluster 1
10121027
modparam("clusterer_controller", "manage_shtags", 0)
10131028
modparam("clusterer_controller", "cluster",
@@ -1029,7 +1044,8 @@ socket=bin:10.22.23.191:3857
10291044
loadmodule "proto_bin.so"
10301045

10311046
loadmodule "clusterer.so"
1032-
modparam("clusterer", "use_controller", 1)
1047+
modparam("clusterer", "use_controller", 1) # enable the controller path (global switch)
1048+
modparam("clusterer", "cluster_id", 1) # register cluster 1 as controller-managed
10331049
modparam("clusterer", "sharing_tag", "vip1/1=active")
10341050
modparam("clusterer", "ping_interval", 4)
10351051
modparam("clusterer", "ping_timeout", 1500)
@@ -1091,6 +1107,11 @@ modparam("clusterer_controller", "password", "MyStr0ngPassw0rd!")
10911107
<title>Set <varname>master_stickiness</varname> parameter</title>
10921108
<programlisting format="linespecific">
10931109
...
1110+
# both clusters registered as controller-managed on the clusterer side
1111+
modparam("clusterer", "use_controller", 1)
1112+
modparam("clusterer", "cluster_id", 1)
1113+
modparam("clusterer", "cluster_id", 2)
1114+
10941115
# Global default (sticky) — omit entirely for the same effect
10951116
modparam("clusterer_controller", "master_stickiness", 1)
10961117

@@ -1473,7 +1494,9 @@ socket=bin:10.0.2.10:5566
14731494
loadmodule "proto_bin.so"
14741495

14751496
loadmodule "clusterer.so"
1476-
modparam("clusterer", "use_controller", 1)
1497+
modparam("clusterer", "use_controller", 1) # enable the controller path (global switch)
1498+
modparam("clusterer", "cluster_id", 1) # cluster 1 is controller-managed
1499+
modparam("clusterer", "cluster_id", 2) # cluster 2 is controller-managed
14771500

14781501
loadmodule "clusterer_controller.so"
14791502
# Cluster 1 — dialog replication group, LAN segment 10.0.1.0/24
@@ -1498,7 +1521,9 @@ socket=bin:10.22.23.191:3857
14981521
loadmodule "proto_bin.so"
14991522

15001523
loadmodule "clusterer.so"
1501-
modparam("clusterer", "use_controller", 1)
1524+
modparam("clusterer", "use_controller", 1) # enable the controller path (global switch)
1525+
modparam("clusterer", "cluster_id", 1) # cluster 1 is controller-managed
1526+
modparam("clusterer", "cluster_id", 2) # cluster 2 is controller-managed
15021527

15031528
loadmodule "clusterer_controller.so"
15041529
modparam("clusterer_controller", "cluster",
@@ -1589,13 +1614,15 @@ loadmodule "db_mysql.so"
15891614
loadmodule "proto_bin.so"
15901615

15911616
loadmodule "clusterer.so"
1592-
# native side: cluster 10 lives in the DB (nodes provisioned there)
1617+
# native side: cluster 10 is defined entirely by rows in the clusterer DB
1618+
# table (one row per node, including a row whose node_id = my_node_id below
1619+
# for THIS node) - there is no cluster_id modparam for native clusters.
15931620
modparam("clusterer", "db_mode", 1)
15941621
modparam("clusterer", "db_url", "mysql://opensips:pass@localhost/opensips")
1595-
modparam("clusterer", "my_node_id", 5) # this node's id in cluster 10
1596-
# controller side: cluster 1 is dynamic
1597-
modparam("clusterer", "use_controller", 1)
1598-
modparam("clusterer", "cluster_id", 1)
1622+
modparam("clusterer", "my_node_id", 5) # this node's id in its native/DB clusters (global)
1623+
# controller side: cluster 1 is dynamic (no DB, no static rows)
1624+
modparam("clusterer", "use_controller", 1) # enable the controller path (global switch)
1625+
modparam("clusterer", "cluster_id", 1) # register cluster 1 as controller-managed
15991626

16001627
loadmodule "clusterer_controller.so"
16011628
modparam("clusterer_controller", "cluster",
@@ -1608,6 +1635,40 @@ loadmodule "dispatcher.so"
16081635
modparam("dispatcher", "cluster_id", 10) # DB-native
16091636
</programlisting>
16101637
</example>
1638+
<example>
1639+
<title>Hybrid, no DB — static native cluster 7 + controller cluster 1</title>
1640+
<programlisting format="linespecific">
1641+
socket=bin:10.0.0.10:5566
1642+
1643+
loadmodule "proto_bin.so"
1644+
1645+
loadmodule "clusterer.so"
1646+
# native side: cluster 7 is provisioned statically (no DB).
1647+
# db_mode=0 is REQUIRED, otherwise my_node_info/neighbor_node_info are ignored.
1648+
modparam("clusterer", "db_mode", 0)
1649+
modparam("clusterer", "my_node_id", 5) # this node's id in native cluster 7
1650+
modparam("clusterer", "my_node_info", "cluster_id=7, url=bin:10.0.0.10:5566")
1651+
modparam("clusterer", "neighbor_node_info", "cluster_id=7, node_id=6, url=bin:10.0.0.11:5566")
1652+
# controller side: cluster 1 is dynamic
1653+
modparam("clusterer", "use_controller", 1) # enable the controller path (global switch)
1654+
modparam("clusterer", "cluster_id", 1) # register cluster 1 as controller-managed
1655+
1656+
loadmodule "clusterer_controller.so"
1657+
modparam("clusterer_controller", "cluster",
1658+
"id=1,multicast=239.0.90.1:3333,bin_socket=bin:10.0.0.10:5566,password=S3cret")
1659+
1660+
loadmodule "dialog.so"
1661+
modparam("dialog", "dialog_replication_cluster", 1) # controller-managed (cluster 1)
1662+
1663+
loadmodule "dispatcher.so"
1664+
modparam("dispatcher", "cluster_id", 7) # native (cluster 7)
1665+
</programlisting>
1666+
<para>
1667+
Here <varname>my_node_id=5</varname> is this node's id in the native
1668+
cluster 7; in cluster 1 the controller assigns an id at runtime, which
1669+
may differ.
1670+
</para>
1671+
</example>
16111672
</section>
16121673

16131674
<section id="configuration" xreflabel="Configuration Example">
@@ -1628,7 +1689,8 @@ socket=bin:10.22.23.191:3857
16281689
loadmodule "proto_bin.so"
16291690

16301691
loadmodule "clusterer.so"
1631-
modparam("clusterer", "use_controller", 1)
1692+
modparam("clusterer", "use_controller", 1) # enable the controller path (global switch)
1693+
modparam("clusterer", "cluster_id", 1) # register cluster 1 as controller-managed
16321694
modparam("clusterer", "sharing_tag", "vip1/1=active")
16331695
modparam("clusterer", "ping_interval", 4)
16341696
modparam("clusterer", "ping_timeout", 1500)

0 commit comments

Comments
 (0)