[Serusers] ser mysql/cache sync

Greger V. Teigre greger at teigre.com
Sun Jul 10 10:49:34 CEST 2005


Jack Wei wrote:
> i am running a cluster with 2 sers.  i start the 1st ser and several
> users registers.  the users show up in both the cache and the mysql
> db.  then i start the 2nd ser, and it loads the db into the cache.
> when the cache entries in the 2nd server times out, the entries are
> deleted from the db.  however, when the users registers in the 1st
> ser, they aren't entered into the db.  how do i fix this problem?
>
> the db_mode is set to "2" w/ timer_interval at "10".  i've even tried
> setting the db_mode to "1", but that didn't help.

Write-through DB mode will write all usrloc changes to the DB. However, all 
locations are cached in ser memory. This means that there is no way a 
secondary ser can reload a location from DB. If a location is not found in 
memory, it is assumed not there.  A new caching approach has been discussed 
previously on this list (or was it serdev?).

You can do the following:
- Use write-through DB mode to the shared SQL DB
- Use t_replicate to the secondary ser
- On the secondary ser, call save_memory() instead of save() (as the 
location has already been saved in DB)

This only works for deployment scenarios where EUCs are not NATed.  The 
reason is that the secondary ser will have another public IP address than 
the primary and restricted NATs will not accept incoming packets from other 
IPs than the one the EUC has registered to.

The way to solve this is to either route all INVITEs coming to the secondary 
through the primary (ex. using Path) or to set up LVS (or similar) where 
both SERs have the same IP address.  However, currently LVS does not do 
Call-id based load balancing and people who report this scenario have 
patched LVS or use a commercial load balancing solution.

g-) 




More information about the sr-users mailing list