Load balancing nginxSLB activation management process
Published: 2017-10-11
Our company's load balancing architecture has two types: EasySLB architecture and nginxSLB architecture,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, no configuration 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 require no separate settings; there is no need to set an origin-pull 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 load balancing groups; different backend load balancing groups can be specified for different domain names to achieve diversified functions
5. nginx-based extended configuration is more flexible; no remote load server is required; graphical backend operations make configuration easier for beginners
Load Balancing NginxSLB Architecture:
One frontend scheduler, three or more backend web servers, and one file server (the file server stores web and database).Note: All servers must be provisioned 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 should guarantee at least 1M bandwidth
that is enough; later it can be increased at any time based on usage)
2. Web servers (three or more): 4-core CPU, 4G memory, 1M bandwidth (private network 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 (private network IP is used for data exchange, so 1M bandwidth is sufficient), 100G hard disk (SSD; hard disk size depends on data)
Load Balancing NginxSLB Operating Principle:
The frontend uses nginx for load balancing. 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 backend web servers for processing》web server calls the web files on the file server and
database content》after processing, the data is fed back to the user through the scheduler. Therefore, all bandwidth is on the scheduler. From the scheduler to the web servers, and from the web servers to the file server, all use the private network.
1. Provision the scheduler. When provisioning, you need to select the "Load Balancing NginxSLB" template, as shown in the screenshot:

Note: After the servers are provisioned, they need to be added to the virtual switch and the private network must be configured, Virtual Switch VPC Configuration Instructions (Elastic Cloud Private Network Communication)
2. Scheduler settings
Log in to Management Center》Business Management》Independent IP Host Management, and view
This icon is the scheduler server; click Manage after it to enter

3.Configure and add load balancing sites
(1) Add a "Load Balancing Group"

(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



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


4. At this point, the load balancing configuration is complete. "Synchronize Server"


After the above operations are complete, users need to manually perform two steps:
2. Create a site on the web server.
Advanced operations:
Modify the domain name bound to the site


2. Add multiple sites



3. Add an https site


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

The web server does not need to be configured with an https site; just keep port 80 access.
