Capture and Analysis processes running on wrong server

Forum for questions and support relating to the 1.29.x releases only.
Locked
notself
Posts: 5
Joined: Sun Jan 17, 2016 4:41 pm

Capture and Analysis processes running on wrong server

Post by notself »

Hi guys, I'm a bit of a newbie on zoneminder and I've read the docs and couldn't find any answer for this.

I'm running v1.29rc2 on 2 raspberry pi with 3 cameras / monitors in Mocord mode:

Image

The idea is to distribute the load as a single raspberry pi can't cope with the load. However I seem to have zmc and zma processes for camera 2 and 3 on server 1, even though both monitors are allocated to server 2 and running :

Code: Select all

user@rpi1:~ $ ps ax | grep zm
10081 ?        S      0:56 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
10116 ?        Rl   189:20 /usr/bin/zmc -m 2
10120 ?        R    245:22 /usr/bin/zma -m 2
10125 ?        S      0:04 /usr/bin/perl -wT /usr/bin/zmfilter.pl
10131 ?        S      0:03 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
10137 ?        S      0:11 /usr/bin/perl -wT /usr/bin/zmwatch.pl
10143 ?        S      0:01 /usr/bin/perl -w /usr/bin/zmupdate.pl -c
10218 ?        Rl   164:42 /usr/bin/zmc -m 3
10222 ?        R    246:24 /usr/bin/zma -m 3
10263 ?        R     92:29 /usr/bin/zmc -m 4
10267 ?        R    287:31 /usr/bin/zma -m 4

Code: Select all

user@rpi2:~ $ ps ax | grep zm
 6645 ?        S      0:49 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
 6672 ?        Sl   146:16 /usr/bin/zmc -m 3
 6676 ?        R    250:27 /usr/bin/zma -m 3
 6684 ?        S     82:19 /usr/bin/zmc -m 4
 6688 ?        R    313:17 /usr/bin/zma -m 4
 6693 ?        S      0:04 /usr/bin/perl -wT /usr/bin/zmfilter.pl
 6699 ?        S      0:02 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
 6705 ?        S      0:14 /usr/bin/perl -wT /usr/bin/zmwatch.pl
 6716 ?        S      0:01 /usr/bin/perl -w /usr/bin/zmupdate.pl -c
(the monitor IDs are: Front=2, Back=3, LivingRoom=4)

Could someone help on how to troubleshoot this? I believe it's some misconfiguration on my end, but I'm not sure where to look next.

Thanks
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Capture and Analysis processes running on wrong server

Post by knight-of-ni »

You have processes for camera 3 running on both servers. Have you tried restarting both zoneminder's, or even rebooting them, to see if things get straightened out?

Rather than guess (I am good at guessing wrong), we need a Rosetta stone, which maps exactly which monitor id belongs to which of the three cameras in your screenshot. You can see the monitor id by hovering over each camera's link in web console while looking at the bottom of your browser.

What does your Server tab look like under Options?

Showing us a good full page of your logs following a startup might help too.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
iconnor
Posts: 3269
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Capture and Analysis processes running on wrong server

Post by iconnor »

check your /etc/zm/zm.conf. If no ZM_Server_Name or ZM_Server_Host ot ZM_SERVER_ID is specified, then the multi-server code is ignored.
notself
Posts: 5
Joined: Sun Jan 17, 2016 4:41 pm

Re: Capture and Analysis processes running on wrong server

Post by notself »

@iconnor: I have both servers with ZM_SERVER_HOST set to each server's hostname.

@knnniggett: The map for the monitors was in the post, but most likely not very visible :). Here they are:

Front: 2
Back: 3
LivingRoom: 4

Now I've managed to isolate the problem a bit further. With the same setup as described above:

- Start server 1 (server 2 is off)
- Verify that server 1 only has processes for monitor 2
- Open the web interface, click on the Source link for the Back (id 3) monitor (the ip, in the screenshot above). This brings the monitor settings
- Click save without making any changes
- Now server 1 has processes for monitor 3 as well.

So this seems to only happen when we make changes to a monitor. In that case the first server will get assigned to the monitor.

I've attached the debug logs for that scenario.

Please let me know if you need more information.

Cheers
Attachments
logs.tar.gz
(12.84 KiB) Downloaded 184 times
User avatar
iconnor
Posts: 3269
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Capture and Analysis processes running on wrong server

Post by iconnor »

This is actually a bug. There will be an rc3 soon.
notself
Posts: 5
Joined: Sun Jan 17, 2016 4:41 pm

Re: Capture and Analysis processes running on wrong server

Post by notself »

Thanks guys, good to know!

For now it's just a minor inconvenience and everything else seems to be running smoothly.
User avatar
iconnor
Posts: 3269
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Capture and Analysis processes running on wrong server

Post by iconnor »

We have added some more debugging lines, can you update?
notself
Posts: 5
Joined: Sun Jan 17, 2016 4:41 pm

Re: Capture and Analysis processes running on wrong server

Post by notself »

Done. Logs attached.

Thanks
Attachments
zm.7z
(459.41 KiB) Downloaded 181 times
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Capture and Analysis processes running on wrong server

Post by knight-of-ni »

Just to make sure you are running the lastest 1.29.0 branch, can you tell us how you are installing zoneminder? I haven't released an rc3 yet, so the only way you'll get the latest changes is if you pull down the latest 1.29.0 branch using git.

I'm also curious what distro you are running on your pi: Raspian, Fedora, or something else?
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
notself
Posts: 5
Joined: Sun Jan 17, 2016 4:41 pm

Re: Capture and Analysis processes running on wrong server

Post by notself »

You're right, I'm pulling from github and creating debian packages from the release-1.29.0 branch.

I'm doing roughly the same as as what utils/do_debian_package.sh does for local builds. I'm on the latest Raspbian (based on Jessie) so I'm using distros/ubuntu1504_cmake to make the packages. The only source change I make is on distros/ubuntu1504_cmake/control file where I rename the ffmpeg dependencies (eg: libavcodec-ffmpeg-dev becomes libavcodec-dev)

The packages are then installed on 2 other RPIs running latest Raspbian as well.

I'm happy to give more info if you're interested in this particular setup.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Capture and Analysis processes running on wrong server

Post by knight-of-ni »

I was able to duplicate this behaviour if not one of the following are set in zm.conf:
ZM_SERVER_NAME
ZM_SERVER_HOST
ZM_SERVER_ID

As soon as I set ZM_SERVER_HOST in zm.conf and restart zm on all servers, then the correct zma/zmc processes started up on the right server.
Note that this is not currently in the documentation. Once we can verify this fixes the issue for you, then we simply need to update the documentation.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Capture and Analysis processes running on wrong server

Post by knight-of-ni »

Something else I noticed when looking at your log files are a lot of messages like this:
undef[31174].DB1-zm_config.cpp/118 [Fetching ZM_SERVER_ID For Name = leela1]
The name leela1 does not match any of the server names shown from your initial screenshot.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Locked