Load balancing nginxSLB activation management process

Published: 2017-10-11

```html

Our company's load balancing architecture has two types: EasySLB architecture and nginxSLB architecture. For EasySLB mode, please refer to the tutorial Load Balancing EasySLB Activation and Management Process   .

The following is the tutorial description for the nginxSLB architecture


Advantages of Load Balancing NginxSLB over EasySLB: 

               1. Supports independent SSL deployment, one-click deployment in the backend, and no configuration is required on the web server

               2. Supports independent multi-site deployment; multiple load balancing sites can be added independently in the backend

               3. Backend web servers do not need separate settings, and there is no need to set the origin gateway address on the web server. Web servers are not required to be in the same data center (same data center recommended)

               4. Supports multiple groups of load balancing; different backend load balancing groups can be specified for different domain names, enabling diversified functions

               5. Extended configuration based on nginx is more flexible; no remote load server is required, and backend graphical operations make configuration easier for beginners

Load Balancing NginxSLB Architecture:

                One scheduler at the frontend, three or more web servers at the backend, and one file server (web and database files are stored on the file server).Note: all servers must be deployed in the same data center and the same cluster.

Recommended server configuration:

                1. Frontend scheduler (one): 4-core CPU, 4G memory, 20M bandwidth, 50G hard disk. (All bandwidth used by load balancing is on the scheduler, so the scheduler needs sufficient bandwidth. Other servers only need to guarantee at least 1M bandwidth

                       is sufficient, and it can be increased at any time later according to usage.)

                2. Web servers (three or more): 4-core CPU, 4G memory, 1M bandwidth (intranet IP is used for data exchange, so 1M bandwidth is sufficient), 100G hard disk

                3. File server (one): 4-core CPU, 4G memory, 1M bandwidth (intranet IP is used for data exchange, so 1M bandwidth is sufficient), 100G hard disk (SSD; hard disk size depends on data)

Operating Principle of Load Balancing NginxSLB:

                The frontend uses nginx for load balancing, and the domain name is resolved to the scheduler IP. When a user enters the domain name to visit, the request first reaches the scheduler > then the scheduler distributes it to a backend web server for processing > the web server callsthe web files and database content on the file server

                > after processing, the data is fed back to the user through the scheduler. Therefore, all bandwidth is on the scheduler, and communication from the scheduler to the web servers and from the web servers to the file server all uses the intranet.


1. Activate the scheduler. When activating, you need to select the "Load Balancing NginxSLB" template, as shown in the screenshot:

image.png

Note: After the servers are activated, they need to be added to the virtual switch, and the intranet needs to be configured. Virtual Switch VPC Configuration Guide (Elastic Cloud Intranet Communication)  

2. Scheduler settings

Log in to the Management Center > Business Management > Independent IP Host Management, and viewtu.jpgThe server with this icon is the scheduler server. Click Manage at the back to enter

image.png

3.Configure and add a load balancing site

    (1) Add a "Load Balancing Group"

image.png

 (2) Add web node IPs to the "Load Balancing Group". The file server IP does not need to be added to load balancing; only web servers are added here

  image.png

image.png

image.png

(3) Add a site in the "Load Balancing Group"

image.png

image.png


4. The load balancing configuration is now complete. "Synchronize Server"

image.png

image.png

After the above operations are completed, users need to manually perform two steps:

1. Set up file sharing.

2. Create a site on the web server.



Advanced operations:

  1. Modify the domain name bound to the site

    image.png

    image.png


  2. Add multiple sites

image.png

image.png

image.png

   3. Add an https site

image.png

image.png

PS: If it is a 1-yuan certificate applied for through our company, you need to first copy the content of the crt file into the certificate box, and then copy the content of the cer file below


image.png


No https site needs to be configured on the web server; just keep port 80 access.




```