virtualbox, backup, redundant system problem... need advice!

Discussion in 'ISPConfig 3 Priority Support' started by Tomislav Aurednik, Nov 2, 2016.

  1. I've installed a multiserver setup with vms on a headless Ubuntu 14.04.5 LTS server.
    I used your howtos:

    My setup is:
    • web & db server with ISPConfig 3 CP
    • mail server
    • dns1 server
    • dns2 server that is mirror of dns1
    My backups are copying and compresing the vms while running, plus backup only the data (web server /var/www/*). I wanted then to copy the vms to different backup servers, registering them and have them running with virtual network cable unplugged (setlinkstate1 off). So if the primary servers failed all it WOULD be needed is to run the command "VBoxManage controlvm name_of_server setlinkstate1 on".

    Problems are vms take to long to copy, uses to much space and the fs curruption is allways a possible problem. I've read the your HOWTO for backing up a running vm with special lvm partitions but I can't do that on the production server.

    The next idea was not to copy the whole vms every day, but have them running disconected and only copy data with rsync as mentoined in manual.
    But the problem is the same private IPs and hostnames.

    So my I'm interested what do you guys suggest for a more or less begginer in linux and servers to do.
    Can I use rsync between 2 vms with same IPs and hostnames, with some kind of port redirecting?!
    Or should I create and install new vms with different IPs and hostnames, mirror them with ISPConfig and use rsync on them as described in manual?
    Can I use the copies of my vms and change the hostnames and IPs so I don't need to create and install new vm servers. But I don't think it's possible because off the multiserver setup.
    Or is there a simpler way that I don't know? As I said I'm a begginer at linux and servers and all I know is mostly from this forum, your HOW TOs and what google knows so it's possible that I missed some other ways to make a redudant backup system.
  2. So... no help for this. :/

    But I would like to know if a server can be a mirror and a slave? For a complete redundant system for maintenance of the live servers, ....
    For instance the serversin multiserver setup are:

    webserver (master with DB)
    mailserver (slave to

    bckwebserver (master with DB) and mirror for webserver
    bckmailserver (slave to and mirror of

    The data will be then coppied with rsync the the configurations by mirror setup. For the mysql I have no idea yet, the master-master replication is not an option for the live server.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    A mirrored server is always a slave server, but not each slave has to be a mirror :) So yes, you can mirror the master and you can also mirror a slave server to the backup servers, so your system will stay online but you won't be able to manage it when the master is down as the other slaves will not be able to fetch config changes from the master.
    Tomislav Aurednik likes this.
  4. Thanks Till, but I don't fully understand your awnser.
    So for the backup system I don't setup a new multiserver setup and then mirror them? Or just install servers and mirror them with their live server counterpart or the live master server?
  5. Ok I installed the backup server for the live master web/db server and selected it as mirror server of the master server.
    A few questions.
    Before I'm gonna try to rsync, can I manually copy the /var/www/ folder from a yesterdays backup to the backup server so the first rsync won't take to long?
    What about configs like /etc/fstab for quota, will all config from the live master server be added when I change it or will only the changes apply and I've got to add else manually?
    For the DB can I just use mysqldump on the live master server and import it into the backup or can this overite and brake my bckserver installation?
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can do that but rsync should be faster then copying it manually.

    The mirror should be setup before the first website gets added on the master server as ispconfig transfers changes only. But you can try to use the resync feature in ispconfig t transfer existing sites.

    You can do that for website databases but never for the ispconfig database as the content of a slave is not the same then on the master! That's why such a system has to be setup before the first site gets added. But you can try to use the resync function to transfer data to the slave in case that you have already sites on the master.
  7. Thanks for the awnsers Till. I really don't want to messwith the resync tool because it isn't really explaind what it does in the manual and it also says that on a multiserver setup it will resync configuration on all servers. It also doesn't say what is going to be created so I could back up the files so that it does not mess up my live servers.

    Does it create web files only on servers with the web service, mailboxes only on the servers with mail service,... or all on all server?
    Last edited: Nov 9, 2016
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The tool does the same thing then clicking the save button in a website or mailbox or ahwtever you selected to be synced. Since 3.1 you can select the server that gets resynced.
    Tomislav Aurednik likes this.
  9. Oh... such an added explanation would be nice in the manual for those of us who are not so good with linux and servers. :) I'm still using
    Thanks the resync created all client and web users on the bck server. The mirror creates new sites on the bck server and the vhost and symlinks for it. But the vhost file has the live server private IP <VirtualHost> and not that of the bck server. And if I change it to the bck server or not I can't view the site on the bck server I get only the apache page. For this testing I'm using a different public IP that I rout to the bck servers private IP and I've added the public IP and site domain to my PCs hosts file.

    Sorry for nagging you so much... but I'm battling with this backup server more than 2 weeks so maybe I'm making mistakes or just missing something.

    Thanks for all your help!
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Either use * for the vhosts or use the ipv4 mapping feature in ispconfig.
  11. Using * does not work and I don't have IPv4 mapping becouse I'm still using Need to have the bck servers running before I'm going to update to 3.1 if there are any problems on live server after update that my mail and sites still work.
    I tryed what you suggested in

    But now the mirror stopped working. I think it can't connect with mysql, becouse netstat -tap | grep mysql output is only:

    tcp 0 0 *:mysql *:* LISTEN 1585/mysqld

    and not like on other servers where it is working

    tcp 0 0 localhost:mysql *:* LISTEN 8406/mysqld
    tcp 0 0 TIME_WAIT -
    tcp 0 0 localhost:49344 localhost:mysql TIME_WAIT -
    tcp 0 0 TIME_WAIT -
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Why does it not work? I use that on all servers.
  13. I can use * but it still just shows the default apache2 site. It also doesn't show sites with ssl correctly on the live server, so I have to select the IP.

    I have the apache2.conf same as on live server so that it should folov symlinks but all I get is the default apache2 site.
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied

    <Directory /usr/share>
    AllowOverride None
    Require all granted

    <Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted

    But the problem now is that it stopped syncing becouse it does not create configs on the mirror server.
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Then there must be another global config issue on your server as * works fine with and without SSL. Maybe you used the IP address in the default vhost instead of _default_ which is normally used in an default vhost so that you override the * vhosts?

    Use the ispconfig debug mode on the slave to find out why it can not sync anymore.
  15. I don't remember exactly why but I have to select the IP becouse of the "Enable SNI" for having http and https sites on the same IP. But this is now not a priority.
    The issue is that I cant access the sites even if I manualy change the vhost settings to the IP or *. The server does not follow the symlinks. If I a2dissite 000-default.conf I just get the directory index of my /var/www/ folder. The permissions are set the same as on master server and the apache2.conf settings are the same.

    Enabling debug mode was the first thing I did. There are no warnings, errors or debug entries after I disabled and enabled the mirror as suggested in a post that I linked in post #11. And I think the problem is as said in the same post that there is no process for the mysql connection with the master server and I don't know how to restart it again.
    The master server has the 2 db users for the mirror (IP and hostname), the servers have host entries for each other in /etc/hosts.
    I've installed and configured the server with the HOWTO for perfect server. the only thing I did was to reinstall apache2 on the mirror, but I enabled all mods that are needed and it starts, restarts and reloads with no errors. The phpmyadmin on the mirror works and the mirror worked after apache2 reinstall. It stopped only after I dissabled and enabled it.
    Do you have any clue or should I try to do a complete reinstall of the mirror and we start fresh. If I should do a fresh install, do I need to remove the server from the mirror/multiserver setup and if yes how do I do that?

    edit: the master has all 3 db users... 2 ispcsrv* and 1 root for the mirror.
    Last edited: Nov 11, 2016
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    This does not matter for SNI. SNI works on IP and * in the exact same way.

    If a server is a mirror or not depends solely on the "Is mirror of server" setting under System > Server config in ispconfig. If this setting s set, then the server will get the same changes that the other server of this mirror gets and the server is not listed in ispconfig anymore as it makes not sense to list a mirror server as it get's it changes form the master anyway and can not receive individual config.
  17. Found the problem but don't know what couses it. The mirroring changes my /etc/hosts. It changes the host name for the master server to the hostname of the mirror. That is why the mysql connection fails becouse it does not find the db server.
    I found this with commenting out the ispconfig cronjob in crontab -e and mannualy starting the /usr/local/ispconfig/server/ script.
    when the script finishes it changes hosts file. And my the changes to Any idea what can couse this?
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    Ensure that you do not have the network config option enabled on any of the two servers.
  19. Under system -> Server Config -> Server Network Configuration? I checked it yesterday but unchecked it after 5 minutes. Do I have to dissable it mannualy in any config file?
  20. Thanks the mirror works again. One problem solved. The websites still don't display on the backup server. Still getting only the apache2 default site.

Share This Page