Dolphin replication or Dolphin cluster setup

Let's learn the easiest way to replicate Dolphins. Have a look at the following diagram:

Dolphin replication diagram

  • Public network: actually this is Internet
  • Private network: local network with high speed connection between hosts
  • Users: Internet users which access the site
  • Round Robin DNS (RRDNS): DNS server which resolves your domain to several IPS assigned to Webserver1, Webserver2, ..., WebserverN
  • Webserver1, Webserver2, ..., WebserverN: web servers where Dolphin is installed and configured the special way
  • DB Server: MySQL database server (if needed MySQL server can be replicated too using MySQL Cluster -
  • File Server: the server where actual user's data is stored, it can be integrated NAS storage or just a separate server(or even one of the web servers) with Samba files sharing

The process description

User access DNS to resolve your site domain name and get IP of one of your web server's. Since different users will be provided with different IP - the load is distributed equally across all web servers (however it maybe some intellectual RRDNS server which can monitor web server's load and distribute the load accordingly).

Then user access some of the web servers where copy of the Dolphin is installed. The web server executes PHP code located on the server itself (for the optimal performance) and asks DB server and File server only for some dynamic content like videos, photos, sounds using high speed local network.

Now you have some basic picture of the setup, let's configure Dolphin.

Dolphin configuration

The idea is to map all dynamic folders in Dolphin to the one storage located on remote File server and leave all static and cache files on the server itself.

First install Dolphin to the first server, if RRDNS already configured then to make sure you are accessing the right server add this line to your etc/hosts file:

  • x.x.x.x: is IP address of the first server
  • your domain

After installation is completed, configure it for the production environment (install modules, change template, etc) so it can be safely duplicated to the other web servers.

Then map all dynamic folders to the File server's shared folder.

Let's assume that the following folder:


is mounted folder of some shared directory from File server with read/write access.

Run the following commands to remap Dolphin folders where users upload some data:

# relocating system folders
mv media/ /mnt/nas/
ln -s /mnt/nas/media

# preparing folders for relocating necessary flash modules folders
mkdir /mnt/nas/flash
mkdir /mnt/nas/flash/board/
mkdir /mnt/nas/flash/chat
mkdir /mnt/nas/flash/photo
mkdir /mnt/nas/flash/im
mkdir /mnt/nas/flash/mp3
mkdir /mnt/nas/flash/video
mkdir /mnt/nas/flash/desktop
mkdir /mnt/nas/flash/global

# relocating files folder
mv flash/modules/board/files /mnt/nas/flash/board/
ln -s /mnt/nas/flash/board/files/ flash/modules/board/files
mv flash/modules/chat/files /mnt/nas/flash/chat/
ln -s /mnt/nas/flash/chat/files/ flash/modules/chat/files
mv flash/modules/photo/files /mnt/nas/flash/photo/
ln -s /mnt/nas/flash/photo/files/ flash/modules/photo/files
mv flash/modules/im/files /mnt/nas/flash/im/
ln -s /mnt/nas/flash/im/files/ flash/modules/im/files
mv flash/modules/mp3/files /mnt/nas/flash/mp3/
ln -s /mnt/nas/flash/mp3/files/ flash/modules/mp3/files
mv flash/modules/video/files /mnt/nas/flash/video/
ln -s /mnt/nas/flash/video/files/ flash/modules/video/files
mv flash/modules/video_comments/files /mnt/nas/flash/video_comments/
ln -s /mnt/nas/flash/video_comments/files/ flash/modules/video_comments/files

# relocating xml folder
mv flash/modules/board/xml /mnt/nas/flash/board/
ln -s /mnt/nas/flash/board/xml/ flash/modules/board/xml
mv flash/modules/chat/xml /mnt/nas/flash/chat/
ln -s /mnt/nas/flash/chat/xml/ flash/modules/chat/xml
mv flash/modules/photo/xml /mnt/nas/flash/photo/
ln -s /mnt/nas/flash/photo/xml/ flash/modules/photo/xml
mv flash/modules/im/xml /mnt/nas/flash/im/
ln -s /mnt/nas/flash/im/xml/ flash/modules/im/xml
mv flash/modules/mp3/xml /mnt/nas/flash/mp3/
ln -s /mnt/nas/flash/mp3/xml/ flash/modules/mp3/xml
mv flash/modules/video/xml /mnt/nas/flash/video/
ln -s /mnt/nas/flash/video/xml/ flash/modules/video/xml
mv flash/modules/video_comments/xml /mnt/nas/flash/video_comments/
ln -s /mnt/nas/flash/video_comments/xml/ flash/modules/video_comments/xml
mv flash/modules/desktop/xml /mnt/nas/flash/desktop/
ln -s /mnt/nas/flash/desktop/xml/ flash/modules/desktop/xml
mv flash/modules/global/xml /mnt/nas/flash/global/
ln -s /mnt/nas/flash/global/xml/ flash/modules/global/xml

# preparing folders for relocating necessary modules folders
mkdir /mnt/nas/modules
mkdir /mnt/nas/modules/avatar/
mkdir /mnt/nas/modules/forum/
mkdir /mnt/nas/modules/photos/
mkdir /mnt/nas/modules/files/
mkdir /mnt/nas/modules/desktop/
mkdir /mnt/nas/modules/profile_customize/

# relocating modules folders
mv modules/boonex/avatar/data/images /mnt/nas/modules/avatar/
ln -s /mnt/nas/modules/avatar/images/ modules/boonex/avatar/data/images
mv modules/boonex/avatar/data/tmp /mnt/nas/modules/avatar/
ln -s /mnt/nas/modules/avatar/tmp/ modules/boonex/avatar/data/tmp
mv modules/boonex/photos/data/files /mnt/nas/modules/photos/
ln -s /mnt/nas/modules/photos/files/ modules/boonex/photos/data/files
mv modules/boonex/files/data/files /mnt/nas/modules/files/
ln -s /mnt/nas/modules/files/files/ modules/boonex/files/data/files
mv modules/boonex/profile_customize/data/images /mnt/nas/modules/profile_customize/
ln -s /mnt/nas/modules/profile_customize/images/ modules/boonex/profile_customize/data/images
mv modules/boonex/forum/data/attachments /mnt/nas/modules/forum/
ln -s /mnt/nas/modules/forum/attachments/ modules/boonex/forum/data/attachments

Please note that above list is for default BoonEx modules only, if you have installed some 3rd-party modules, you need to map their dynamic folders too.

Replicating to the other servers

After first server is proved to be configured properly, archive its structure (tar -czf /dolphin-folder/ archive.tgz) and extract (tar -xzf archive.tgz) on 2nd, 3rd, ..., Nth server to the same location (if location is different you need to change inc/ file accordingly).

After extraction delete temporary files:

rm -rf plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/HTML/*
rm -rf plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/CSS/*
rm -rf plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/Test/*
rm -rf plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/URI/*
rm -rf ./cache/*
rm -rf ./cache_public/*
rm -rf ./tmp/*

Then change permissions (if necessary, depending on web server configuration) for system and modules.

If you need to make any changes after replication is completed, for example:

  • files modifications
  • installing uninstalling modules
  • changes in language file

Make it on the 1st server and then repeat archiving and extracting procedure to the other servers.

Please refer to the following doc on how to calculate proper hardware for your cluster.

Last modified 12 years ago Last modified on Nov 9, 2011, 2:02:08 AM

Attachments (2)

Download all attachments as: .zip

Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
Fork me on GitHub