Page 1 of 1

Splitting ZoneMinder onto multiple machines, is it possible?

Posted: Wed Jan 25, 2006 2:47 pm
by Simon
I currently have two Linux based servers and was wondering if I could I split up Zone Minder onto them. Here is the current configuration:

System A is a database and web server and has an ImpactVCB card in it. This system currently has Zone Minder installed and running.

System B is my MythTV system and supports a number of nfs boot clients. It has a PVR-500 dual MPEG4 tuner card for MythTV. For storage it has two sata 400gb drives configured in a stripe set.

I would like to split up Zoneminder so the video capture part for the cameras is done on system B while the database, and web front end live on system A. Is this possible with Zone Minder? I guess one issue would be serving up the images from the System B when the frontend is on System A.

Thanks. :wink:

Posted: Wed Jan 25, 2006 8:51 pm
by cordel
It might be a bit of a challenge but I don't see why it could not be done. Except for getting live images.

Build and install on System B and set to use DB on System A
Create nfs on system B for the events folder.
Mount System B events
Move or copy the web.
set zm.conf on System A to access db localhost and you will have to change some setting in a few of the php files.

I think it should work but I have never tried. You might be able to leave zms on system B and create a nfs for this as well and be able to stream live or use apache to serve it from there.

Regards,
Corey

Posted: Wed Jan 25, 2006 10:34 pm
by candlerb
I have something similar running which is described in a nearby thread: http://www.zoneminder.com/forums/viewtopic.php?t=5549

Server A is a database and web server. It happens to have a USB camera attached.

Server B is a remote ZM installation. It has another USB camera attached.

Users point their web browsers at Server A, where they can view images and events from both cameras.

There are outline details of how to make this work in that thread. Basically server B acts as a remote IP camera for server A. You configure server B with a basic ZM installation and a local camera (or video capture card in your case), then configure server A with a remote camera pointing at http://serverB/cgi-bin/zms?...etc. This gives a motion JPEG stream, which server A captures and processes continuously (this is done in the background by the zmc process, whether or not anyone is actually looking at the images). Any users viewing will see streams from Server A, served from its local buffer of the images being streamed from Server B.

This approach does require that images from both cameras are recorded and analysed for motion on Server A, which means Server A will become a bottleneck as more and more remote cameras are added.

Anyway, is that close to what you want? Regards, Brian.

Posted: Tue Feb 07, 2006 9:24 pm
by Simon
I haven't checked this thread in a while as I have been putting some thought in how to place things on the machines I have available. I really apprecaite the two responses. I am going to give the above configuration I layed out above a shot. The second system is only running MythTV, and in my testing even with two frontends active it is less than 5% utilized. In the mean time I have upgraded from an ImpactVCB to a Spectra 8 and now capturing at twice the resolution with a 20-30fps frame rate on 2 cameras is really killing my first system.

I'm going to invest some time on this on the weekend and I'll be sure to post the outcome.

Posted: Tue Apr 25, 2006 8:35 pm
by Simon
cordel wrote: Build and install on System B and set to use DB on System A
Create nfs on system B for the events folder.
Mount System B events
Move or copy the web.
set zm.conf on System A to access db localhost and you will have to change some setting in a few of the php files.

I think it should work but I have never tried. You might be able to leave zms on system B and create a nfs for this as well and be able to stream live or use apache to serve it from there.
I finally got around to trying this using your comments as a rough guide. I however cannot get the web front end to work. The back end works fine and the logs indiciate it is capturing as exepcted:

Apr 25 16:33:05 localhost zmc_dvideo2[8151]: INF [Frontdoor: 18000 - Capturing at 30.30 fps]
Apr 25 16:33:06 localhost zmc_dvideo3[8154]: INF [Backyard: 18000 - Capturing at 29.41 fps]

However when using the frontend you can't bring up the camera at all. I think this is because the frontend is doing something to try to detect if zmc is working and because it's not on the same system it doesn't work. As a result the source for both cameras is in red and you can't click on the name.

Any pointers where I should look?

Thx.

Posted: Sat Mar 21, 2009 5:26 am
by anupmankar
I tried something similar and it worked for me.

Initially I was trying to run zma for different cameras on 2 different machines. So I introduced a new column in the Monitors table for the IP address of the host where the cameras will be analyzed and streamed from.

Then in zmpkg.pl I checked whether the host IP of the camera is the same as local IP, though only for zma. What this did was reduced the number of zma's running on 1 machine. Now each machine is running zma only for those cameras that it is hosting.

Then I mounted the events directory for machine B on machine A. So now the events dir for A has another directory which is named after the IP address of B (/zm/events/w.x.y.z/) where w.x.y.z is B's IP.

Then in funcs.php I modified getEventPath which returns the $event_path value. This code checks if the host IP of the camera is the same as $_Server['Http_Host']. If not it will return something like "/zm/events/IP address of machine B/..." instead of just "/zm/events/..."

Now I cud see the frames and thumbnails for events stored on machine B from machine A.

Next I modified getStreamSrc to check the host IP against @_server['http_host']. If the camera is hosted on the same machine it returns URL starting with ZM_BASE_URL else it returns a URL with the IP address of the other machine.

This way I am able to view event videos directly from machine B.

However I have tested the getStreamSrc code only for "source=event". Need to check it for "view=watch" so that I need not run zmc for remotely hosted cameras.