Documentation

Documentation.Tutorials-Distributed-User-Location-Federation History

Hide minor edits - Show changes to output

July 18, 2023, at 05:34 PM by liviu -
Changed line 4 from:
!How To Configure a Federated User Location Cluster
to:
!How To Configure a Federated User Location Cluster (for OpenSIPS 2.4)
March 17, 2021, at 10:51 AM by liviu -
Changed line 241 from:
No! The only purpose of the SQL database is to persist the registration / dialog data on each OpenSIPS restart. This allows the SIP node to run on its own, even if the datacenter is isolated from the global platform.
to:
No! The only purpose of the SQL database is to persist the registration / dialog data on each OpenSIPS restart. This allows the SIP node to run on its own, even if its datacenter is isolated from the global platform.
March 17, 2021, at 10:50 AM by liviu -
Changed lines 231-249 from:
@]
to:
@]

!!!! FAQ

!!!!! Should I deploy MySQL on each node?

Yes, the SQL database should be local to each OpenSIPS node.

!!!!! Should I set up replication between the MySQL instances?

No! The only purpose of the SQL database is to persist the registration / dialog data on each OpenSIPS restart. This allows the SIP node to run on its own, even if the datacenter is isolated from the global platform.

!!!!! Should I put a MongoDB instance on each node?

This is left up to you to decide. The only requirement is to have a single, global NoSQL database, with all OpenSIPS nodes being able to connect to it. This way, different datacenters can publish their AoR metadata to this database.

!!!!! What is the recommended tool for the virtual IP management?

From our experience, both ''keepalived'' and ''vrrpd'' have worked very well, without any issues once the configuration was properly set up.
November 02, 2019, at 10:47 AM by liviu -
Added line 75:
modparam("clusterer", "seed_fallback_interval", 5)
September 12, 2019, at 02:03 PM by liviu -
Changed line 46 from:
* a MongoDB or Cassandra instance (you can upgrade them into a cluster later)
to:
* a Cassandra or MongoDB instance (you can upgrade them into a cluster later)
September 12, 2019, at 02:01 PM by liviu -
Changed line 46 from:
* a MongoDB instance (you can upgrade it into a cluster later)
to:
* a MongoDB or Cassandra instance (you can upgrade them into a cluster later)
September 12, 2019, at 02:01 PM by liviu -
Changed line 58 from:
# version 1: with Cassandra, make sure to create the keyspace and table beforehand:
to:
# with Cassandra, make sure to create the keyspace and table beforehand:
Changed line 69 from:
# version 2: with MongoDB, we don't need to create any database or collection...
to:
# with MongoDB, we don't need to create any database or collection...
September 12, 2019, at 01:59 PM by liviu -
Added lines 57-70:

# version 1: with Cassandra, make sure to create the keyspace and table beforehand:
# CREATE KEYSPACE IF NOT EXISTS opensips WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
# USE opensips;
# CREATE TABLE opensips.userlocation (
# id text,
# aor text,
# home_ip text,
# PRIMARY KEY (id));
loadmodule "cachedb_cassandra.so"
modparam("usrloc", "cachedb_url", "cassandra://10.0.0.5:9042/opensips.userlocation")

# version 2: with MongoDB, we don't need to create any database or collection...
loadmodule "cachedb_mongodb.so"
Deleted lines 71-72:

loadmodule "cachedb_mongodb.so"
August 09, 2018, at 05:52 PM by liviu -
Changed line 114 from:
To achieve HA, notice how we group nodes in pairs using the "sip_addr" column. It now contains the Virtual IP address sitting in front of each pair. In federation mode, the user location will only replicate contact information to nodes with equal "sip_addr" values, in order to achieve the "hot backup" feature. Next, the "flags" column is set to "seed" on the active node, and NULL on the backup. This allows you to restart the backup node and automatically have it sync'ed up via cluster transfer. The "flags" column is ignored when using a local SQL database in order to achieve [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_restart_persistency|restart persistency]].
to:
To achieve HA, notice how we group nodes in pairs using the "sip_addr" column. It now contains the Virtual IP address sitting in front of each pair. In federation mode, the user location will only replicate contact information to nodes with equal "sip_addr" values, in order to achieve the "hot backup" feature. Next, the "flags" column is set to "seed" on the active node, and NULL on the backup. This allows you to restart the backup node and automatically have it sync'ed up via cluster transfer. The "flags" column is ignored when using a local SQL database for [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_restart_persistency|restart persistency]].
August 09, 2018, at 05:51 PM by liviu -
Changed line 114 from:
To achieve HA, notice how we group nodes in pairs using the "sip_addr" column. It now contains the Virtual IP address sitting in front of each pair. In federation mode, the user location will only replicate contact information to nodes with equal "sip_addr" values, in order to achieve the "hot backup" feature. Next, the "flags" column is set to "seed" on the active node, and NULL on the backup. This allows you to restart the backup node and automatically have it sync'ed up via cluster transfer. Alternatively, we could have set "seed" for all nodes, and use a local SQL database for [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_restart_persistency|restart persistency]].
to:
To achieve HA, notice how we group nodes in pairs using the "sip_addr" column. It now contains the Virtual IP address sitting in front of each pair. In federation mode, the user location will only replicate contact information to nodes with equal "sip_addr" values, in order to achieve the "hot backup" feature. Next, the "flags" column is set to "seed" on the active node, and NULL on the backup. This allows you to restart the backup node and automatically have it sync'ed up via cluster transfer. The "flags" column is ignored when using a local SQL database in order to achieve [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_restart_persistency|restart persistency]].
May 31, 2018, at 06:36 PM by liviu -
Changed line 80 from:
||%block black% 15 || 1 || 2 || bin:10.0.0.179 || 1 || 3 || 50 || 10.0.0.179 || seed || NULL ||
to:
||%block black% 15 || 1 || 3 || bin:10.0.0.179 || 1 || 3 || 50 || 10.0.0.179 || seed || NULL ||
May 31, 2018, at 06:36 PM by liviu -
Changed line 62 from:
modparam("clusterer", "current_id", 2)
to:
modparam("clusterer", "current_id", 3)
May 31, 2018, at 03:26 PM by liviu -
Changed line 188 from:
We then enable these branch flags for some or all contacts before calling [[|save()]]:
to:
We then enable these branch flags for some or all contacts before calling [[http://www.opensips.org/html/docs/modules/2.4.x/registrar#func_save|save()]]:
May 31, 2018, at 02:31 PM by liviu -
Deleted line 36:
Adding a "hot backup" node for each cluster member
May 31, 2018, at 02:30 PM by liviu -
Changed line 24 from:
Instead of full-mesh replicating user location data to the entire cluster (i.e. just like the [[asdasdasd|"full sharing"]] clustering strategy does), the nodes will only publish some light, metadata "AoR availability" records into a shared NoSQL database, as in this picture:
to:
Instead of full-mesh replicating user location data to the entire cluster (i.e. just like the [[http://www.opensips.org/Documentation/Tutorials-Distributed-User-Location-Full-Sharing|"full sharing"]] clustering strategy does), the nodes will only publish some light, metadata "AoR availability" records into a shared NoSQL database, as in this picture:
May 31, 2018, at 02:28 PM by liviu -
Changed line 214 from:
To silence these errors, you can hook the following MI commands into your active->backup and backup->active transitions of the VIP:
to:
To silence these errors, you can hook the [[http://www.opensips.org/html/docs/modules/2.4.x/nathelper.html#mi_nh_enable_ping|nh_enable_ping]] MI command into your active->backup and backup->active transitions of the VIP:
May 31, 2018, at 02:24 PM by liviu -
Changed line 1 from:
!!!!! Documentation -> [[Documentation.Tutorials | Tutorials ]] -> How To Configure Federated User Location Cluster
to:
!!!!! Documentation -> [[Documentation.Tutorials | Tutorials ]] -> How To Configure a Federated User Location Cluster
May 31, 2018, at 02:12 PM by liviu -
Changed lines 206-207 from:
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: ERROR:core:proto_udp_send: sendto(sock,0x812ae0,294,0,0xbffd8800,16): Invalid argument(22) [1.2.3.4:38911]
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: CRITICAL:core:proto_udp_send: invalid sendtoparameters#012one possible reason is the server is bound to localhost and#012attempts to send to the net
to:
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: ERROR:core:proto_udp_send: sendto(sock,0x812ae0,294,0,0xbffd8800,16): Invalid
argument(22) [1.2.3.4:38911]
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: CRITICAL:core:proto_udp_send: invalid sendtoparameters#012one possible reason
is the server is bound to localhost and#012attempts to send to the net
Added lines 212-218:
@]

To silence these errors, you can hook the following MI commands into your active->backup and backup->active transitions of the VIP:

[@
opensipsctl fifo nh_enable_ping 1 # run this on the machine that takes over the VIP (new active)
opensipsctl fifo nh_enable_ping 0 # run this on the machine that gives up the VIP (new passive)
May 31, 2018, at 02:09 PM by liviu -
Added lines 199-209:
@]

\\

However, when we enable HA for federated clustering, '''both''' the active and the passive node will attempt to generate pings. Depending on your VIP implementation, your passive node may spew errors such as:

[@
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: ERROR:core:proto_udp_send: sendto(sock,0x812ae0,294,0,0xbffd8800,16): Invalid argument(22) [1.2.3.4:38911]
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: CRITICAL:core:proto_udp_send: invalid sendtoparameters#012one possible reason is the server is bound to localhost and#012attempts to send to the net
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: ERROR:nathelper:msg_send: send() to 1.2.3.4:38911 for proto udp/1 failed
May 30 06:09:58 localhost /usr/sbin/opensips[18833]: ERROR:nathelper:nh_timer: sip msg_send failed
May 31, 2018, at 02:06 PM by liviu -
Added lines 174-198:
@]

!!!! NAT pinging

Some setups require periodic SIP OPTIONS pings originated by the registrar towards some of the contacts in order to keep the NAT bindings alive. Here is an example configuration:

[@
loadmodule "nathelper.so"
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "sipping_from", "sip:pinger@localhost")
modparam("nathelper", "sipping_bflag", "SIPPING_ENABLE")
modparam("nathelper", "remove_on_timeout_bflag", "SIPPING_RTO")
modparam("nathelper", "max_pings_lost", 5)
@]

We then enable these branch flags for some or all contacts before calling [[|save()]]:

[@
...
setbflag(SIPPING_ENABLE);
setbflag(SIPPING_RTO);

if (!save("location"))
sl_reply_error();
...
May 31, 2018, at 01:36 PM by liviu -
Changed line 149 from:
At OpenSIPS script level, we can easily distinguish calls coming in from fellow cluster nodes using [[http://www.opensips.org/html/docs/modules/2.4.x/clusterer#func_cluster_check_addr|clusterer_check_addr()]]:
to:
At OpenSIPS script level, we can easily distinguish calls coming in from fellow cluster nodes using [[http://www.opensips.org/html/docs/modules/2.4.x/clusterer#func_cluster_check_addr|cluster_check_addr()]]:
May 31, 2018, at 01:36 PM by liviu -
Changed lines 145-174 from:
http://opensips.org/pub/images/federation-forking.jpg
to:
http://opensips.org/pub/images/federation-forking.jpg

\\

At OpenSIPS script level, we can easily distinguish calls coming in from fellow cluster nodes using [[http://www.opensips.org/html/docs/modules/2.4.x/clusterer#func_cluster_check_addr|clusterer_check_addr()]]:

\\

[@
route {
...

$var(lookup_flags) = "m";

if (cluster_check_addr("1", "$si")) {
xlog("$rm from cluster, doing local lookup only\n");
} else {
xlog("$rm from outside, doing global lookup\n");
$var(lookup_flags) = $var(lookup_flags) + "g";
}

if (!lookup("location", "$var(lookup_flags)")) {
t_reply("404", "Not Found");
exit;
}

...
}

@]
May 31, 2018, at 01:22 PM by liviu -
Changed line 141 from:
The "g" (global) flag indicates that the lookup() will not only perform the local lookup operation, but also do a NoSQL DB lookup and prepare additional branches for each returned result. Thus, we will fork the INVITE to both the callee's local contacts and to any cluster member that has previously advertised the AoR. Below is an example of a call that gets forked to a device local to the current PoP and to a remote PoP, where the callee has registered a 2nd device.
to:
The "g" (global) flag indicates that the lookup() will not only perform the local lookup operation, but also do a NoSQL DB lookup and prepare additional branches for each returned result. Thus, we will fork the INVITE to both the callee's local contacts and to any cluster member that has previously advertised the AoR. Below is an example of a call that gets forked to a device local to the current PoP (branch #1) and to a remote PoP (branch #2), where the callee has registered a 2nd device.
May 31, 2018, at 01:21 PM by liviu -
Changed lines 136-138 from:
# local lookup, using lookup("location")
# global lookup, using lookup("location", "g")
to:
# local lookup, using [[http://www.opensips.org/html/docs/modules/2.4.x/registrar#func_lookup|lookup("location")]]
# global lookup, using [[http://www.opensips.org/html/docs/modules/2.4.x/registrar#func_lookup|lookup("location", "g")]]
Changed lines 145-147 from:
http://opensips.org/pub/images/federation-forking.jpg

\\
to:
http://opensips.org/pub/images/federation-forking.jpg
May 31, 2018, at 01:18 PM by liviu -
Changed lines 117-118 from:
!!!!! Registration flows
to:
!!!! Registration flows
Changed lines 132-135 from:
!!!!! Call flows

When calling
to:
!!!! Call flows

When looking up an AoR, we have two options:

# local lookup, using lookup("location")
# global lookup, using lookup("location", "g")

\\

The "g" (global) flag indicates that the lookup() will not only perform the local lookup operation, but also do a NoSQL DB lookup and prepare additional branches for each returned result. Thus, we will fork the INVITE to both the callee's local contacts and to any cluster member that has previously advertised the AoR. Below is an example of a call that gets forked to a device local to the current PoP and to a remote PoP, where the callee has registered a 2nd device.
May 31, 2018, at 01:02 PM by liviu -
Changed lines 10-11 from:
!!!! Basic Setup
to:
!!!! Description
Changed line 41 from:
!!!!! Configuration
to:
!!!! Configuration
May 31, 2018, at 01:02 PM by liviu -
Added lines 116-140:

!!!!! Registration flows

The registration flow has two steps:

# UAs register to their configured registrar
# if a new AoR is created, the registrar publishes the AoR's availability in the NoSQL cluster

We need not change anything in the default script in order to achieve the above. The [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_working_mode_preset|working_mode_preset]] or [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_cluster_mode|cluster_mode]] module parameters take care of this.

\\

http://opensips.org/pub/images/federation-registration.jpg

\\

!!!!! Call flows

When calling

\\

http://opensips.org/pub/images/federation-forking.jpg

\\
May 31, 2018, at 12:06 PM by liviu -
Changed line 88 from:
Notice how we set the "flags" column to "seed" for both nodes. This ensures that the user location can safely boot with an empty dataset and be happy with it. If we had left "flags" set to NULL for a node, when that node starts up, its user location module would have started looking for a healthy donor node, from which to request a full user location data transfer via cluster sync. Also, the "sip_addr" column is equal to the SIP listener where we would like to receive traffic for the AoRs we've advertised as our own inside the NoSQL database.
to:
Notice how we set the "flags" column to "seed" for both nodes. This ensures that the user location can safely boot with an empty dataset and be happy with it. If we had left "flags" set to NULL for a node, when that node starts up, its user location module would have started looking for a healthy donor node, from which to request a full user location data transfer via cluster sync. Also, the "sip_addr" column is equal to the SIP listener where we would like to receive traffic for the AoRs we've advertised as our own inside the NoSQL database. This is a usrloc-specific use case for "sip_addr" - other cluster-enabled modules may use this column differently or ignore it altogether.
May 30, 2018, at 08:04 PM by liviu -
Changed lines 49-52 from:
The relevant OpenSIPS config sections required in order to achieve the above:
to:
Below are the relevant OpenSIPS config sections:

\\
May 30, 2018, at 08:01 PM by liviu -
Deleted lines 1-21:
This page has been visited {$PageCount} times.

!How To Configure a Federated User Location Cluster
%block text-align=right% '''by Liviu Chircu'''

(:toc-float Table of Content:)
----

!!!! Basic Setup

The "federation" clustering strategy for the OpenSIPS user location is a complete, high-end solution, offering:

* excellent horizontal scalability
* minimal network interaction between cluster nodes
* small NoSQL DB records, thus maximizing the scaling potential of the NoSQL cluster
* ability to place the clustered registrars at the edge of your platform, directly facing clients, while maintaining global reachability for all SIP Addresses-of-Record and all of their Contacts
* optional NAT pinging support
* optional restart persistency support
* optional "hot backup" HA support

\\!!!!! Documentation -> [[Documentation.Tutorials | Tutorials ]] -> How To Configure Federated User Location Cluster
May 30, 2018, at 08:01 PM by liviu -
Added lines 22-42:
\\!!!!! Documentation -> [[Documentation.Tutorials | Tutorials ]] -> How To Configure Federated User Location Cluster
This page has been visited {$PageCount} times.

!How To Configure a Federated User Location Cluster
%block text-align=right% '''by Liviu Chircu'''

(:toc-float Table of Content:)
----

!!!! Basic Setup

The "federation" clustering strategy for the OpenSIPS user location is a complete, high-end solution, offering:

* excellent horizontal scalability
* minimal network interaction between cluster nodes
* small NoSQL DB records, thus maximizing the scaling potential of the NoSQL cluster
* ability to place the clustered registrars at the edge of your platform, directly facing clients, while maintaining global reachability for all SIP Addresses-of-Record and all of their Contacts
* optional NAT pinging support
* optional restart persistency support
* optional "hot backup" HA support
Added lines 85-86:
\\
Changed line 101 from:
%green%'''clusterer table example'''
to:
%green%'''clusterer table example (no HA)'''
Added lines 108-109:
\\
Changed line 128 from:
%green%'''clusterer table example'''
to:
%green%'''clusterer table example (with HA)'''
Deleted lines 133-141:



!!!! Basic Setup



!!!!! OpenSIPS #1 configuration
May 30, 2018, at 07:58 PM by liviu -
Changed lines 64-65 from:
Example clusterer table (no HA):
to:
Example clusterer table with no HA (2 active nodes):
Changed lines 83-84 from:
Example clusterer table (with HA):
to:
Notice how we set the "flags" column to "seed" for both nodes. This ensures that the user location can safely boot with an empty dataset and be happy with it. If we had left "flags" set to NULL for a node, when that node starts up, its user location module would have started looking for a healthy donor node, from which to request a full user location data transfer via cluster sync. Also, the "sip_addr" column is equal to the SIP listener where we would like to receive traffic for the AoRs we've advertised as our own inside the NoSQL database.

Example clusterer table provisioning with HA (2 active nodes + 2 passive nodes):
Changed lines 108-112 from:
Notice how in the (no HA) provisioning we set the "flags" column to "seed" for both nodes. This ensures that the user location can safely boot with an empty dataset and be happy with it. If we had left "flags" set to NULL for a node, when that node starts up, its user location module would have started looking for a healthy donor node, from which to request a full user location data transfer via cluster sync. Also, the "sip_addr" column is equal to the SIP listener where we would like to receive traffic for the AoRs we've advertised as our own inside the NoSQL database.

\\

In the (with HA) provisioning data, notice how we group nodes in pairs using the "sip_addr" column. It now contains the Virtual IP address sitting in front of each pair. In federation mode, the user location will only replicate contact information to nodes with equal "sip_addr" values, in order to achieve the "hot backup" feature. Next, the "flags" column is set to "seed" on the active node, and NULL on the backup. This allows you to restart the backup node and automatically have it sync'ed up via cluster transfer. Alternatively, we could have set "seed" for all nodes, and use a local SQL database for [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_restart_persistency|restart persistency]].
to:
To achieve HA, notice how we group nodes in pairs using the "sip_addr" column. It now contains the Virtual IP address sitting in front of each pair. In federation mode, the user location will only replicate contact information to nodes with equal "sip_addr" values, in order to achieve the "hot backup" feature. Next, the "flags" column is set to "seed" on the active node, and NULL on the backup. This allows you to restart the backup node and automatically have it sync'ed up via cluster transfer. Alternatively, we could have set "seed" for all nodes, and use a local SQL database for [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_restart_persistency|restart persistency]].
May 30, 2018, at 07:55 PM by liviu -
Added lines 1-119:
!!!!! Documentation -> [[Documentation.Tutorials | Tutorials ]] -> How To Configure Federated User Location Cluster
This page has been visited {$PageCount} times.

!How To Configure a Federated User Location Cluster
%block text-align=right% '''by Liviu Chircu'''

(:toc-float Table of Content:)
----

!!!! Basic Setup

The "federation" clustering strategy for the OpenSIPS user location is a complete, high-end solution, offering:

* excellent horizontal scalability
* minimal network interaction between cluster nodes
* small NoSQL DB records, thus maximizing the scaling potential of the NoSQL cluster
* ability to place the clustered registrars at the edge of your platform, directly facing clients, while maintaining global reachability for all SIP Addresses-of-Record and all of their Contacts
* optional NAT pinging support
* optional restart persistency support
* optional "hot backup" HA support

\\

Instead of full-mesh replicating user location data to the entire cluster (i.e. just like the [[asdasdasd|"full sharing"]] clustering strategy does), the nodes will only publish some light, metadata "AoR availability" records into a shared NoSQL database, as in this picture:

\\

http://opensips.org/pub/images/federation-basic.jpg

\\

This setup also supports a "hot backup" node for each member of the cluster, allowing for near-instant failover in case the active node crashes or goes offline. This is achieved using a Virtual IP, sitting in front of each pair of servers, as in this diagram:

\\

http://opensips.org/pub/images/federation-ha.jpg
Adding a "hot backup" node for each cluster member

\\

!!!!! Configuration

For the smallest possible setup, you will need:

* two OpenSIPS instances
* a MySQL instance
* a MongoDB instance (you can upgrade it into a cluster later)

The relevant OpenSIPS config sections required in order to achieve the above:
[@
loadmodule "usrloc.so"
modparam("usrloc", "use_domain", 1)
modparam("usrloc", "working_mode_preset", "federation-cachedb-cluster")
modparam("usrloc", "location_cluster", 1)
modparam("usrloc", "cachedb_url", "mongodb://10.0.0.5:27017/opensipsDB.userlocation")

loadmodule "cachedb_mongodb.so"

loadmodule "clusterer.so"
modparam("clusterer", "current_id", 2)
modparam("clusterer", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
@]

Example clusterer table (no HA):

[@
INSERT INTO clusterer(id, cluster_id, node_id, url, state, no_ping_retries, priority, sip_addr, flags, description) VALUES \
(NULL, 1, 1, 'bin:10.0.0.177', 1, 3, 50, '10.0.0.177', 'seed', NULL), \
(NULL, 1, 3, 'bin:10.0.0.179', 1, 3, 50, '10.0.0.179', 'seed', NULL);
@]

[[<<]]
||border=1
|| '''id''' || '''cluster id''' || '''node_id''' || '''url''' || '''state''' || '''no_ping_retries''' || '''priority''' || '''sip_addr''' || '''flags''' || '''description''' ||
||%block black% 14 || 1 || 1 || bin:10.0.0.177 || 1 || 3 || 50 || 10.0.0.177 || seed || NULL ||
||%block black% 15 || 1 || 2 || bin:10.0.0.179 || 1 || 3 || 50 || 10.0.0.179 || seed || NULL ||
||
%green%'''clusterer table example'''
[[<<]]

\\

Example clusterer table (with HA):

[@
INSERT INTO clusterer(id, cluster_id, node_id, url, state, no_ping_retries, priority, sip_addr, flags, description) VALUES \
(NULL, 1, 1, 'bin:10.0.0.177', 1, 3, 50, '10.0.0.223', 'seed', NULL), \
(NULL, 1, 2, 'bin:10.0.0.178', 1, 3, 50, '10.0.0.223', 'NULL', NULL), \
(NULL, 1, 3, 'bin:10.0.0.179', 1, 3, 50, '10.0.0.224', 'seed', NULL), \
(NULL, 1, 4, 'bin:10.0.0.180', 1, 3, 50, '10.0.0.224', 'NULL', NULL);
@]

[[<<]]
||border=1
|| '''id''' || '''cluster id''' || '''node_id''' || '''url''' || '''state''' || '''no_ping_retries''' || '''priority''' || '''sip_addr''' || '''flags''' || '''description''' ||
||%block black% 14 || 1 || 1 || bin:10.0.0.177 || 1 || 3 || 50 || 10.0.0.223 || seed || NULL ||
||%block black% 15 || 1 || 2 || bin:10.0.0.178 || 1 || 3 || 50 || 10.0.0.223 || NULL || NULL ||
||%block black% 16 || 1 || 3 || bin:10.0.0.179 || 1 || 3 || 50 || 10.0.0.224 || seed || NULL ||
||%block black% 17 || 1 || 4 || bin:10.0.0.180 || 1 || 3 || 50 || 10.0.0.224 || NULL || NULL ||
||
%green%'''clusterer table example'''
[[<<]]

\\

Notice how in the (no HA) provisioning we set the "flags" column to "seed" for both nodes. This ensures that the user location can safely boot with an empty dataset and be happy with it. If we had left "flags" set to NULL for a node, when that node starts up, its user location module would have started looking for a healthy donor node, from which to request a full user location data transfer via cluster sync. Also, the "sip_addr" column is equal to the SIP listener where we would like to receive traffic for the AoRs we've advertised as our own inside the NoSQL database.

\\

In the (with HA) provisioning data, notice how we group nodes in pairs using the "sip_addr" column. It now contains the Virtual IP address sitting in front of each pair. In federation mode, the user location will only replicate contact information to nodes with equal "sip_addr" values, in order to achieve the "hot backup" feature. Next, the "flags" column is set to "seed" on the active node, and NULL on the backup. This allows you to restart the backup node and automatically have it sync'ed up via cluster transfer. Alternatively, we could have set "seed" for all nodes, and use a local SQL database for [[http://www.opensips.org/html/docs/modules/2.4.x/usrloc.html#param_restart_persistency|restart persistency]].



!!!! Basic Setup



!!!!! OpenSIPS #1 configuration

Page last modified on July 18, 2023, at 05:34 PM