Knowledgebase

Highavailability/Global Loadbalancing of clusters

Posted by nokia3310, 01-11-2013, 08:57 PM
I know this website 1channel.ch which has like 4 servers in 4 different datacenters across the globe (czech republic, estonia, sweden, germany). What happens is as i am browsing this website the server changes meaning he is balancing the server load in realtime among the datacenters. How is he doing this? What softwares or applications are needed to achieve this? Any expert advice as to the best practices in achieving this will be ethernally appreciated. Thanks.

Posted by MemoryX2, 01-11-2013, 09:01 PM
He could be using cPanel, and a DNS only server to direct traffic. Basically, one server (DNS only) tells all the web traffic which server to connect to in case one server is experiencing a heavy load etc.. Last edited by MemoryX2; 01-11-2013 at 09:02 PM. Reason: clarification

Posted by nokia3310, 01-11-2013, 09:13 PM
you sure it is that simple? How does the servers stay replicated in realtime? How do they share the same IP addresses? when the load is transfered to the other servers? in realtime?

Posted by MemoryX2, 01-11-2013, 10:48 PM
Well, it probably isn't that simple. Lets say there are 6 servers. Server 1 could run only the MySQL databases. Servers 2-5 could each have copies of the static content and access server 1 for databases queries. Server 6 could run the DNS to tell which server to connect to, servers 2-5. I know this is one way it could be done. I do not know how to run multiple servers with the same IP address.

Posted by nokia3310, 01-11-2013, 11:53 PM
Does this give any helpful information on the possible setup?

Posted by MemoryX2, 01-11-2013, 11:59 PM
Probably if I knew more. Those are all A records so I would assume that those are individual servers, or IP addresses associated with the domain at the very least.

Posted by luki, 01-12-2013, 02:22 AM
Well, it isn't quite as easy. For a true distributed setup, you need to distribute the data. That can be done using a proper distributed file system (one that hopefully handles link failures without much trouble and reconciles changes upon connection restoration) or at the application level. Neither one is simple, but if the application is developed in house then the latter is probably the easier solution of the two. Basically, each location has a complete set of the data. Whenever a piece of data changes (new picture, file, entry, ...) those changes need to be replicated to all other nodes quickly (though not necessarily synchronously). The application can handle that. For databases, single-master/many-slaves replication may work. All updates are sent to the master and the slaves read a change log from the master and apply it. The issue is that the master is a single point of failure. In short, you need to put quite a bit of thought into engineering a proper solution IF the data are changing frequently. For mostly static data, replication is easy and can be done with just rsync.

Posted by assistanz247, 01-12-2013, 08:29 AM
You can do this using DNS failover services from zoneedit.com or other similar providers.

Posted by zsuatt, 01-12-2013, 09:13 AM
As someone pointed out, he seems to be using a round-robin dns setup, where all his servers are listed as an A-records. So every time you resolve you will get a different server. Looking at the site, it seems like it is written in PHP, and it is making use of PHP sessions. He is most likely storing these sessions in a database available on all servers in order to seamlessly switch servers without users noticing. Synchronizing static files across the servers are easy with rsync, or even some sort of distributed filesystem. The difficulty is the database, since it needs to be fault tolerant and perform well. I guess it could be something like MariaDB in a multi master cluster setup could be used...

Posted by fluidrhino, 01-12-2013, 10:05 AM
Multiple servers configured in round robin DNS means that a visitor will be directed to one of his 6 servers at random. That means the only challenge left is keeping things in sync. Keeping things in sync is an interesting problem, but not a particularly difficult one to address. If you're not constrained by someone elses hosting environment (ie, you're not using shared hosting!) you can solve this using a variety of platforms. MongoDB could be a good solution, or perhaps Percona XtraDB Cluster. MongoDB would probably be better in this specific case because GridFS would be ideal for storing image assets. For keeping static assets in sync that aren't really part of your data, rather "the app" itself, using a configuration management system like Puppet or Chef would make life a lot easier.

Posted by nokia3310, 01-12-2013, 01:59 PM
I have been wondering what "MySQL Cluster" http://dev.mysql.com/downloads/cluster/7.2.html is for...is that what MySQL Cluster can be used for as well?



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Suggest me a reseller (Views: 545)


Language:

Client Login

Email

Password

Remember Me

Search