zoneminder multi server database questions

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
lorenjz
Posts: 40
Joined: Fri Feb 28, 2020 12:25 am

zoneminder multi server database questions

Post by lorenjz »

I've been wanting to have a multi server setup for a while, the first time I attempted all of this think I went about it the wrong way. This time I have one machine running well, no errors and acting like it should with all of the cameras that I would like to start with. The big issue that I'm facing is with the database. Yesterday I had a second server configured successfully like the first. When I started the process to connect the second server to the first, it became apparent that the second server couldn't connect to the database. When I started to reread the wiki I noticed that I had missed the part about installing mariadb server software.



When I tried to install mariadb I received an error "Unable to correct problems, you have held broken packages." When I saw this error I started to dig back into the mysql config. Should mysql be able to accept incoming connections from another machine? I changed the file /etc/mysql/my.cnf to include the line bind-address = 0.0.0.0 After accomplishing this step I still wasn't able to connect.

I feel like getting mariadb up and running would be the way to go but wanted to check here before I messed anything up to terribly. Does anyone have any thoughts or suggestions?
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zoneminder multi server database questions

Post by Magic919 »

What have you done about the error?
-
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: zoneminder multi server database questions

Post by iconnor »

If you have a working zm server, then you already have a mysql server in place. The second server needs to be configured to point to it. You don't install a second mysql server. Edit /etc/zm/zm.conf on the second server and fill in teh db_host value appropriately. You may have to edit the config of the mysql server because by default it only listens on localhost.
lorenjz
Posts: 40
Joined: Fri Feb 28, 2020 12:25 am

Re: zoneminder multi server database questions

Post by lorenjz »

  • I've double checked to make sure that I typed in the user correctly when adding in mysql on the first server by typing "SELECT USER, HOST FROM mysql.user;" and it shows that the user for the second machine is in the list.
  • I also checked to see if it had privilege for the database with "SHOW GRANTS FOR 'zmuser'@192.168.1.60 and it lists zm.* as one of the entries.
  • I've checked the logs to see if there were any entries to see if there were any entries listing a connection attempt or a reason to block that host
  • flushed privileges
  • restarted mysql service
  • Double checked the zm.conf file to ensure that ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS were all set correctly
did I miss something?
lorenjz
Posts: 40
Joined: Fri Feb 28, 2020 12:25 am

Re: zoneminder multi server database questions

Post by lorenjz »

Apparently I had edited the wrong config file for mysql. It seems to be working now. Thanks for the help!
liliana89
Posts: 4
Joined: Mon Aug 28, 2023 4:49 am

Re: zoneminder multi server database questions

Post by liliana89 »

Try fixing any broken packages by running sudo apt --fix-broken install. This command will attempt to resolve any dependency issues automatically.
house of hazards
Post Reply