Introduction to Domain Replication
If you use Cloudmin to manage one or more systems running Virtualmin, you can have it replication domains and global Virtualmin settings (like plans and templates) from a source system to multiple destinations. This can be useful for :
- Distributing common settings like plans, styles and custom scripts to multiple Virtualmin systems to avoid having to create them manually.
- Creating a hot-spare system that gets a copy of one or more domains on a regular basis, so that it can serve if the primary system goes goes.
- Replicating websites for load-balancing purposes, so that multiple machines can serve the content for a single website.
Domain replication is most useful when the systems share home directories via NFS and possibly connect to a remote MySQL database, so that dynamic content is always up to date. In this case, Cloudmin should be configured to not replicate home directory and database content.
To limit replication to just some Virtualmin features, open the Advanced replication settings section when adding or editing and select them from the Virtualmin features to replicate field. For example, you may want to select everything except home directory content and MySQL databases if they are stored on a separate system used by both the source and destinations.
Setting Up Domain Replication
To configure Cloudmin to replicate one or more virtual servers from a source system to one or more destinations, follow these steps :
- On the left menu, go to Virtualmin Settings -> Virtual Server Replication.
- Click on Add a new replication configuration.
- Choose the machine to copy from in the Source system menu.
- Select the machines to copy to in the Destination systems field, by using the right-arrow button to move them to the right-hand list.
- Select the virtual servers to copy from the Virtualmin domains to replicate. Only those on the source system can be selected.
- Assuming you want replication to happen automatically on schedule, change the Replication enabled? field to Yes.
- Select a schedule in the When to replicate field.
- Enter an email address to notify about failures in the Send email on failure to field.
- Click the Create button.
One replication has been setup, you can change what gets copied and to where by clicking on an entry in the Virtual Server Replication list. Replication configurations can also be deleted and started manually on the same page.
Setting Up Global Configuration Replication
To instead copy global settings like plans between systems running Virtualmin, follow these steps :
- On the left menu, go to Virtualmin Settings -> Virtual Server Replication.
- Click on Add a new replication configuration.
- Choose the machine to copy from in the Source system menu.
- Select the machines to copy to in the Destination systems field, by using the right-arrow button to move them to the right-hand list.
- Open the Advanced replication settings section, and check the boxes for the global settings you want copied.
- Assuming you want replication to happen automatically on schedule, change the Replication enabled? field to Yes.
- Select a schedule in the When to replicate field.
- Enter an email address to notify about failures in the Send email on failure to field.
- Click the Create button.