Hi Shamus,

At least with Asterisk 11 which uses sqlite3, the writes seem to go directly to 
disk, for example...

shell pbx # echo '.dump' | sqlite3 --batch /mnt/kd/astdb.sqlite3 | grep 
'/foo/bar'
(nothing)

asterisk pbx*CLI> database put foo bar 0

shell pbx # echo '.dump' | sqlite3 --batch /mnt/kd/astdb.sqlite3 | grep 
'/foo/bar'
INSERT INTO "astdb" VALUES('/foo/bar','0');

asterisk pbx*CLI> database del foo bar

shell pbx # echo '.dump' | sqlite3 --batch /mnt/kd/astdb.sqlite3 | grep 
'/foo/bar'
(nothing)

So, from this simple test the /mnt/kd/astdb.sqlite3 file seems to be kept 
current in real time.  I suspect occasional rsync's should work though you may 
want to make a temp copy of /mnt/kd/astdb.sqlite3 and rsync that just in case 
the /mnt/kd/astdb.sqlite3 got written to while the rsync was still active.

Lonnie


On Dec 1, 2014, at 7:06 PM, Shamus Rask <sha...@srask.ca> wrote:

> Would appreciate any input/ideas the community has on the following…
> 
> I have 2 servers running Asterisk in a high-availability configuration (i.e. 
> one on active-standby for backup). I make extensive use of the default AstDB 
> (/var/lib/asterisk/astdb.sqlite3) in my dialplan and would like to understand 
> what is the best way to replicate this between the servers as changes are 
> made.
> 
> Currently, I’m copying the db one entry at a time over an SSH tunnel. I had 
> read somewhere that you could simply rsync them, however it appears Asterisk 
> only “reads/opens” the db at startup, so any changes made after an rsync were 
> not reflected.
> 
> Does anyone have any pointers on this? I’m especially interested in some form 
> of acknowledgment on write, so that I can ensure the AstDBs are in sync.
> 
> many thanks,
>   Shamus



------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to