Linux-Nginx simple Load Balancing (1), linux-nginx

Source: Internet
Author: User
Tags nginx load balancing

Linux-Nginx simple Load Balancing (1), linux-nginx

Here we will perform simple nginx load first, and we will not talk about nginx installation here. We assume that nginx has been installed:

1) check whether the upstrea Server Load balancer module in nginx is installed by default. Go to the nginx source code directory.

./configure --help|grep upstrea 

You can see:

2) Go To The conf directory and filter the configuration file to make it clearer.

egrep -v "#|^$" nginx.conf.default > nginx.conf

3) view the Server Load balancer Module Instructions.

http://nginx.org/en/docs/http/ngx_http_upstream_module.html

4) view the document and find the example:

5) configure the configuration file in vim nginx. conf.

Upstream backend {server 183.2.174.245: 22 max_fails = 3 fail_timeout = 30 s; # ensure that the two ip addresses are accessible to server 121.201.108.43: 22 max_fails = 3 fail_timeout = 30 s; # ensure that these two ip addresses are accessible}

Note:

6) Continue Configuration:

Add to the server label # Use the polling Algorithm for load by default

proxy_pass http://http_backend;

 

7) Restart nginx

8) Round Robin

For n in 'seq 100 '; local ip address of the dorcurl; sleep 2; done

If you use a domain name, go to the host to configure it.

The following describes how to share sessions in Server Load balancer.

 

Good information:

Http://baidutech.blog.51cto.com/4114344/1033718/ parsing nginx Load Balancing

 

Related Article

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.