[Users] Register Replication Example

Andreas Granig andreas.granig at inode.info
Wed Mar 15 19:06:37 CET 2006


Lenir wrote:
> Does anybody have any working configs/examples that they can share to get
> registration replication working?

We used replication for quite some time, but then switched to MySQL
cluster in combination with cacheless usrloc for scalability and
consistency reasons. However, replication works like follows:


if(method == "REGISTER") {
  # if replication from other SER nodes:
  if(src_ip =~ "192\.168\.100\..*") {
    save_noreply("location");
  }
  # if from UACs:
  else {
    # authorization and stuff like that goes here...
    # ...
    save("location");

    # replicate to other SER nodes:
    forward_tcp("192.168.100.10", 5060);
    forward_tcp("192.168.100.11", 5060);
    forward_tcp("192.168.100.12", 5060);
  }
  break;
}

That's it. Note that you will always have a small inconsistency if you
restart one of the nodes, even if you perform a mysql dump of locations
from another node just before startup.

Andy




More information about the Users mailing list