File Synchronization Between Several Application Servers in a Cluster
This guide has been reviewed and reformatted for Ruk-Com Cloud PaaS. Screens may vary slightly by platform version.
Click or tap a screenshot to view it at its original size.
Objective
This guide explains how to use File Synchronization Between Several Application Servers in a Cluster on Ruk-Com Cloud PaaS, with ordered procedures and practical verification points.
Before you begin
- Sign in with an account permitted to manage the relevant environment.
- Confirm the target environment, region and resources before saving changes.
- Create a backup or rollback plan before changing a production system.

As traffic coming into the project increases, you must improve app performance to keep up. Some capacity for elastic scaling is automatically provided to the extent of the vertical server scaling limits.verticalset and expanding the number of nodes (e.g. horizontal scalinghorizontal) as the popularity of your service increases
For widely used apps (such as WordPress, Drupal, Joomla, Liferay, Redmine, and similar apps), distribution across multiple web server instances becomes a problem. This is because all user-supplied content is usually saved only on the node that processes the corresponding file upload request.
To help you eliminate out of sync content when creating a cluster solution for your applications, Ruk-Com Cloud PaaS provides an add-on.add-onthat hasFile SynchronizationIn order for uploaded files to have similar settings on multiple instances of the web server simultaneously, synchronization can be used. Not only within the scope of a single environment (for example, for a single horizontally scaling node), but across application servers in two separate environments, whether running the same or different stacks and applications.
So let's take a look at how to use this particular solution and how it actually works in the next steps:
Making a File Synchronization Add-on
File SyncThe solution is just one click away.add-on, by using with the bundle oflsyncddaemon and its usecronAt the same time, when used in conjunction withinotify,lsyncd will start file synchronization when it detects actual changes to the system. This reduces CPU performance significantly compared to traditional sync calls and helps keep your data up to date, which makes the solution easy to use, powerful, and affordable at the same time.

The File Sync add-on can be installed on top of the Ruk-Com Cloud managed server application stack (exceptDockerContainers). Before using the device, you will be asked to select folders to synchronize. This way, you can sync only a portion of the server app's file system that needs it. Therefore, changes are made only within the selected directory. Only applications (on the specified application server instance) can trigger synchronization.
Installing the application
In this example we will use a WordPress application which is deployed to an environment with two application servers.
Tips:The instructions below are suitable for other similar applications (such as Drupal, Joomla, Liferay, Redmine, etc.) depending on the supported programming languages: Java, PHP, Ruby, etc.
1. You can install the application.WordPressmanually or search for suitable packages inMarketplaceto deploy automatically

ClickInstalland specify required details such as environment, display name (alias), and region.

2. ClickChange Environment Topologyand use the + buttonResize horizontallyTo add another app server node to create a cluster


Tips:You can see our instructions in the documentation to add one.Special server appActivatehigh availabilityor even configureclusteredsolution easily
If you want to add a server app to a more complex environment You can see the settings.clustered solutionfor your WordPress application by following the attached link.
File synchronization test By uploading files
The Wordpress Cluster Kit v2 installation will automatically synchronize the two nodes with the following steps:
1. Go to the Wordpress admin panel by adding the suffix/wp-login.phpto your domain environment and log in using the information you received via email.
- Click the Open browser button in your environment and add /wp-login.php Append or click on the link received via email.
- Enter the Username and Password received via email.

2. Once logged in Make the required changes manually (e.g. upload images or other files, edit the theme, add pages, etc.).

3. After uploading the image, return to the Ruk-Com Cloud Dashboard and click Config next to the Server App Layer.

4. Go to pagewebroot(Click onFavorites) >ROOT > wp-contentdirectory and compare the two nodes to see that the uploaded files are automatically stored in both directories.


More:The directory that contains the uploaded files depends on the application you are using. You can find it in this list of folders:
WordPress-webroot/ROOT/wp-content
Drupal-webroot/ROOT/sites
Joomla-webroot/ROOT/images
Liferay-webroot/home/liferay/data
If you change the environment topology by adding an app server, the new nodes will be automatically synced without any manual adjustments/modifications.
File synchronization is performed automatically every time you add or change anything in your WordPress (or any other application you maintain) so that the data on your server stays the same.