Clusters, such as buying a generation to push the server down and put a piece he's quite a cluster, and load balancing is to get this big bunch of servers to work on average. He is called load Balancer, as shown in:
For example, I use 192.168.8.155 to act as a pic host 1 and PIC Host 2 with Server A, 192.168.8.166, and 192.168.8.177来 as follows:
Then start modifying the nginx.conf file under Server A (192.168.8.155) Conf directory:
upstream imgserver{ 192.168.8.166:80 weight=1 max_fails=2 fail_timeout=30s; 192.168.8.177:80 weight=1 max_fails=2 fail_timeout=30s; ~ \. (jpg|jpeg|png| gif) $ { Proxy_set_header X-forwarded-for$remote _addr; # proxy_pass http://192.168.8.166:80; Proxy_pass http://imgserver; }
Then go back to the Sbin directory with the./nginx-s reload reset under Configuration.
Then we test the access to server A to see the changes between the address and the image:
OK, configuration complete, this is the legendary load balancer and cluster.
Kill lui lei dog---linux no:41 Linux under nginx cluster and load balancer