Mirroring the ZM database

Support and queries relating to all previous versions of ZoneMinder
Locked
mark
Posts: 2
Joined: Thu Feb 19, 2004 1:54 am

Mirroring the ZM database

Post by mark »

Hello All,

After a little fiddling and and some good help on this forum, I now have zm up and working fine. Great program and great work Philip.

This might be a little outside the scope of this forum, but here goes.

My application calls for a server to be located remotely which can only be accessed by modem. There will be toll charges for each call, so I do not want to spend a whole lot of time checking and reviewing events. Also I want to be able to maintian a second database that will contain sensor information such as humidity, temperature and perhaps status and control of X10 events.

A second local server would periodically dialin to the remote server and transfer data to a local database. This in turn would be accessed by zm in the case of video events and a different application for the sensor information. So my question now is how difficult would it be to develop a program to mirror the two databases? Are there apps out in the Linux world to do this? At first glance this doesn't look to difficult of a task, but then again I been there and done that and then reality sets it.

Can anyone offer any suggestions, whether this would be a major undertaking or maybe just a gentle "are you crazy?" would be greatly appreciated.

Cheers
Mark
pchan
Posts: 50
Joined: Thu Jan 15, 2004 9:38 pm

Re: Mirroring the ZM database

Post by pchan »

MySQL 4+ supports replication.
http://www.mysql.com/documentation/mysq ... eplication

I haven't looked into whether that would solve your request of periodically dialing in to the server. However, MySQL file structure is very simple so I would think that at the very least, you could dial in to the server and just FTP all the database files.

Mirroring the database is easy. To do so at periodic intervals could be a little more challenging.
pchan
Posts: 50
Joined: Thu Jan 15, 2004 9:38 pm

Re: Mirroring the ZM database

Post by pchan »

In fact the FAQ says:

: Does the slave need to be connected to the master all the time?

A: No, it does not. The slave can go down or stay disconnected for hours or even days, then reconnect and catch up on the updates. For example, you can set up a master/slave relationship over a dial-up link where the link is up only sporadically and for short periods of time. The implication of this is that at any given time the slave is not guaranteed to be in sync with the master unless you take some special measures. In the future, we will have the option to block the master until at least one slave is in sync.

http://www.mysql.com/documentation/mysq ... cation_FAQ
mark
Posts: 2
Joined: Thu Feb 19, 2004 1:54 am

Re: Mirroring the ZM database

Post by mark »

Ah, this looks interesting. It looks as if I would need to use two way replication since updates could occur on both databases independently; events deleted from local database and events added to remote for example. The FAQ does caution about cross chaining, but since both databases are controlled from one source this shouldn't be a problem.

Thanks for the help

Mark
Locked