Steps toward Frigate HA #5309
quenthal
started this conversation in
Show and tell
Replies: 1 comment
-
are you still using this method without issue? do you also use storage replication? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've planned to enable high availability to some of my proxmox containers and virtual machines - including Frigate. I'm in no way script wizard, and there is probably lots of better ways to achieve this, but this is how I solved this by figuring it out, partially with help of ChatGPT.
Everything probably would have been easy if all hosts/ nodes were equal regarding detecters. However, each server on my environment has different detectors. As (at least with my setup) Frigate will eventually crash if it is configured to multiple detectors while some of those detectors are missing, I decided I start with replacing config.yml automatically on startup depending on which version of Coral my host has. I have Coral USB on host 1 and Coral PCI on host 2. This can easily be adjusted to CPU/nVidia detectors as well.
I started with normal setup on hosts and with LXC configs.
Make sure that Coral PCI-drivers are installed. Make sure that both USB and PCIE Corals are passed thru to Frigate LXC even though only one of them is really installed on each server. This is to make sure that LXC config is identical even if differect Coral is used on different hosts, ie. I have both of these lines in the lxc config (apex_0 for PCIE Coral, and passing thru usb/002 as a whole in my case for USB Coral):
Naturally docker is identical as well, as it runs within LXC, ie. it has both usb and PCIE passed thru from LXC:
... --device /dev/bus/usb:/dev/bus/usb --device /dev/apex_0 --device /dev/dri/renderD128 -v /config/config.yml:/config/config.yml:ro ...
As can be seen on step 3, I'm passing thru /config/config.yml from LXC host to docker. I've infact 3 config yamls, with single difference; the detector part. With /config/config_pci.yml:
..and with /config/config_usb.yml:
Otherwise the configs are similar.
So i begun by creating the script itself by
nano /config/checkDetector.sh
:Then I made it runnable by
chmod +x /config/checkDetector.sh
After that I made it run as a service before docker
nano /etc/systemd/system/checkFrigateDetector.service
:Then I enabled it:
After all this, whenever LXC container is (re)started, it checks if USB Coral is installed before docker is started. If it is, config using it will be replacing the config that frigate will use. If it is not, it is defaulted to use config using pci-e/m.2 version of Coral and that will replace the config Frigate will use after start.
Beta Was this translation helpful? Give feedback.
All reactions