Multi-Server Feature Request

Support for the docker image maintained by dlandon
Post Reply
zombielinux
Posts: 3
Joined: Thu Dec 26, 2019 10:21 pm

Multi-Server Feature Request

Post by zombielinux » Tue Feb 16, 2021 9:05 pm

I've got a docker swarm set up, and as such, I set up my zoneminder containers with docker-compose (included below).

Some notes about it:

I'm using an external NFS server for event storage.
I'm using an external mariadb server as a database.

The method of adding `shm=2G` to the compose file doesn't work in swarm mode, hence the tmpfs volume. I had to dive a LONG way into docker to find that information.

Code: Select all

version: "3.8"
services:

  # Zoneminder Docker-Compose Configuration
  zoneminder-4k:
      restart: always
      hostname: node0
      image: zoneminderhq/zoneminder:latest-ubuntu18.04
      ports:
          - '30080:80/tcp'
      environment:
          - TZ=$TZ
          - ZM_DB_USER=$ZM_DB_USER
          - ZM_DB_PASS=$ZM_DB_PASS
          - ZM_DB_NAME=$ZM_DB_NAME
          - ZM_DB_HOST=$ZM_DB_HOST
          - ZM_SERVER_HOST=node0   
      volumes:
          - zoneminder_data:/var/cache/zoneminder/events:rw
          - type: tmpfs
            target: /dev/shm
            tmpfs:
              size: 6144000000 #6GB
      deploy:
        placement:
          constraints:
           - node.role==worker     
           - node.platform.arch==x86_64

  zoneminder-3M:
      restart: always
      hostname: node2
      image: zoneminderhq/zoneminder:latest-ubuntu18.04
      ports:
          - '30082:80/tcp'
      environment:
          - TZ=$TZ
          - ZM_DB_USER=$ZM_DB_USER
          - ZM_DB_PASS=$ZM_DB_PASS
          - ZM_DB_NAME=$ZM_DB_NAME
          - ZM_DB_HOST=$ZM_DB_HOST
          - ZM_SERVER_HOST=node2
      volumes:
          - zoneminder_data:/var/cache/zoneminder/events:rw
          - type: tmpfs
            target: /dev/shm
            tmpfs:
              size: 4096000000 #4GB
      deploy:
        placement:
          constraints:
           - node.role==worker     
           - node.platform.arch==x86_64

  zoneminder-1440p:
      restart: always
      hostname: node1
      image: zoneminderhq/zoneminder:latest-ubuntu18.04
      ports:
          - '30081:80/tcp'
      environment:
          - TZ=$TZ
          - ZM_DB_USER=$ZM_DB_USER
          - ZM_DB_PASS=$ZM_DB_PASS
          - ZM_DB_NAME=$ZM_DB_NAME
          - ZM_DB_HOST=$ZM_DB_HOST
          - ZM_SERVER_HOST=node1  
      volumes:
          - zoneminder_data:/var/cache/zoneminder/events:rw
          - type: tmpfs
            target: /dev/shm
            tmpfs:
              size: 4096000000 #4GB
      deploy:
        placement:
          constraints:
           - node.role==worker     
           - node.platform.arch==x86_64
           

volumes:
  zoneminder_data:
    driver: local
    driver_opts:
      device: :/srv/nfs/zoneminder
      o: addr=${NAS_HOST},rw,vers=4
      type: nfs
Right now, there are 3 main issues.

1) Accessing the WebUI from http://fqdn.org:30080/zm does not let me see the live images
2) Accessing the API from the http://fqdn.org:30080/zm using ZMNinja ALSO doesn't let me see the images.
3) There is no good way to programmatically scale the number of servers and automatically populate the database with them. This can be manually done, but would be slick if one could just scale the number of instances and have it automatically create the servers (ZM_SERVER_HOST).

I think 1 and 2 are related to this: viewtopic.php?t=29255 but I'm not sure how to make that persistent and scalable.

Magic919
Posts: 474
Joined: Wed Sep 18, 2013 6:56 am

Re: Multi-Server Feature Request

Post by Magic919 » Wed Feb 17, 2021 11:13 am


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest