One of 36_01linux Cluster Series--cluster basic concept

Source: Internet
Author: User
Tags failover inotify rsync

For a lamp website, what should I do when the user is getting more and more so that my server can't respond quickly?
1, scale on (UP)
Switch to a higher configuration, but the hardware upgrade does not mean that the ability of linear growth, when reached a certain level, will also decline, while the price of hardware will rise;
2, scale out (outward expansion)

Cluster:

Load Balancer cluster balancing

LB metrics: How much concurrency is the ability;

Need to rely on a special scheduler device, when the external request comes over, itself does not do anything, but through round Robin (rotation) to allocate more than one host of resources, complete the resource request;
When some hosts are configured higher than other hosts, by weighting the way (indicating that my configuration is higher than yours), implement ANI;


When someone posts and uploads files to my site, the scheduler assigns a server to upload. But when the next visit my Site Scheduler assigned another host to others, then how can this file be found, so there is a problem, upload the file should be placed on which host, to achieve access? The next layer of all the hosts to build an NFS server, all uploaded files on the NFS server, and assign an address, immediately make the scheduler to assign different hosts to access this file, will go to the next layer of NFS, thereby resolving the upload file storage problems.
This is another problem, when I updated my home page, upload to one of the hosts, how to implement all the host can see this new home?? Can take advantage of similar DNS master-slave replication method, using Rsync for differential backup, only to back up different files to other hosts, but this is problematic, rsync can only achieve differential backup, different synchronous backup, such as I write a scheduled task every hour from the main server rsync new files, But just after, my homepage updated, which means that in the next hour can not get the latest page, others visit my site will be two different home page, the amount, is a complex problem, then, there is no means, as long as I on a host update the operation, the other host will be immediately notified,    And then do the update operation, there, using inotify!! This is the use of rsync and inotify to achieve multiple host synchronization.

However, Rsync's ability to synchronize large files is not strong and can be used with Sersync.

Of course, the above is just to implement a cheap Web server cluster ...

This cluster, just suitable for reading more Web servers, and for the database, there is no allocation of resources, and the table can not be stored, when the business is increased, and then re-design, it is possible to scale horizontally.
Horizontal expansion:
When I visit a website, the site corresponds to a cluster, and the site of each plate corresponding to a cluster, such as news corresponding to a cluster, the blog corresponding to a cluster, the military corresponding to a cluster ....

All the other operations are done with the scheduler, so what if the scheduler is broken??
Then get one. From the scheduler, usually do not work, if the main scheduler heartbeat (heartbeat) detection stopped, how the request response is unresponsive, from the scheduler to seize the main scheduler IP address, in lieu of the main scheduler.

What if the backend server hangs up?
Health check of the back-end server, the scheduler should be able to health check the back-end server, if in a certain number or time a host hangs, should be removed from the host, the scheduler should automatically assign to this host on the request forwarded to the other host, and added a, You should also be able to allocate the requested resources to the new host.

Failover (fail over)
-client-side Connect time Failover: This Failover method only senses node failure when initiating a connection
-TAF (Transparent application Failover): After the connection is established, the application system runs, if an instance fails, the user connected to the instance is automatically migrated to

Other health instances.


High Availiability (HA) Highly available cluster
Availability =mttf/(MTTF+MTTR)
MTTF: Mean time between failures
MTTR: Mean time to repair

HB Measurement criteria: A limited time or a large proportion in the working state;
From 99% to 99.9%, nearly 10 times times the increase.
Ascension from 99%,99.9%,99.99%,99.999% means 3 days, 0.3 days, 3 hours, 3 minutes a year;
 
Split-brain: Brain fissure
When the main device is too busy to reply from the device's heartbeat request, from the device think it hangs, then take the IP address, and then turn on the service, replace the main device, when the main device back to God, found himself hung, lying trough, this can endure, two hosts simultaneously to the DAS write data or read and write the same file data, Which leads to data disturbances, my God, this can be done. This is called brain fissure.
Then, it appears, to prevent the main device is not hanging off, and then make up a knife, unplug its power, this really has such a device, two hosts connected to the same power device, when the above situation, from the device will send instructions to make the main device power off.
This is called headshot (STONITH) Shoot the other Node in the head.

Of course, directly unplug people power, too cruel, then there is a kind of don't let him access storage device not on the line, this is called Fencing: (isolation)
But there may also be a crouching groove, this can endure, you rob me Rob, the sum, finished, can't play anymore ...

So, the general real cluster, 3 nodes, odd number of, 1 always but more, is it.

HP High Performance Computing Clusters (performance)
Uses: mainly for scientific calculation, big data processing
Classification:
Vector machine
Parallel processing Cluster
Distributed File System
The mechanism of cutting large tasks into small tasks and processing them separately


Distributed File System



Das is stored much faster than NAS, so it uses Das more often;


Das:direct attached Storage Direct-attached storage (multiple hosts can share one set of storage devices)
Nas:network attached Storage Network attached storage



This writing is very comprehensive, very suitable to see!
Http://www.admin5.com/article/20120521/432182.shtml
This writing is very basic, very suitable to see!
Http://os.51cto.com/art/201405/438325.htm

This article is from the "linuxer" blog, make sure to keep this source http://x180x.blog.51cto.com/10473748/1679195

One of 36_01linux Cluster Series--cluster basic concept

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.