1. Yum Installation NginxYum Install Nginx2. Start NginxChkconfig nginx on service nginx startTo put the test file into the Web server:[HTML]View Plaincopy print?
html>
head>
title>welcome to nginx! title>
head>
body bgcolor="white" text="Black">
Center>H1>welcome to nginx! 192.168.232.132H1>Center>
body>
html>
To configure the Load Balancer server:Vi/etc/nginx
that both master and slave MySQL need to turn on the remote access function and set the same username and password!!#设置主从的ip地址, note: This machine is also replaced by IP address.Start AmoebaBin/launcher View LogsTail-f Logs/net.logClient testing:Mysql-h 192.168.137.3-p8066-uroot-prootConfigure Nginx Proxy#serversUpstream test.com { Ip_hash; server 127.0.0.1:8080; server 127.0.0.1:8081;}#以上是每个请求按访问
: This article describes how to use Nginx server load balancer to build a high-performance. NETweb application 2. if you are interested in PHP tutorials, refer to it. In this article, we use Nginx server load balancer to build high performance. in NETweb Application 1, we have a preliminary understanding of Nginx. next
port 80.The nginx download address is as follows:Nginx download: http://nginx.net/Download the version used in this test: nginx/Windows-0.8.22
Download and decompress the package to C:, and change the directory name to nginx.
Practice steps:
First:
On the local server (10.60.44.126), create a website using the port 808, for example:
IIS website binding settings
Second:
Create a website in the Remote IIS 10.60.44.127 using the port 808, for example:
Remote IIS binding settings
Note: The first
Build LVS Load Balancer Pre-set on Linux,centos7
Prepare five virtual machines
Four sets of Centos7
One to do scheduling one to do NFS cache
Two do Wed clusters
One windows7 begins to be configured individually
Configure Server for NFS (CENTOS7 is used to download the source code package online, but in order to do the experiment, the source code is installed with Yum inst
The previous article written the Nginx load balancer, this article realizes the high Availability (HA). The overall design of the system is to use Nginx to do load balancing, if there is an nginx single-machine failure, the whole system will not function properly. For the high-availability requirements of system architecture design, we need to solve the requireme
file, where we configure load balancingThe configuration file is given below,HTTP {Include Mime.types;Default_type Application/octet-stream;Sendfile on;Keepalive_timeout 65;Upstream localhost{#这里指定多个源服务器, IP: Port, 80-port can be written without writingServer 192.168.1.2:8080;Server 192.168.1.4:8080;}server {Listen 80;server_name localhost;Location/{#启动代理Proxy_pass http://localhost;}}}One of the upstream l
}After the modification, also modify the server listening port, the original content is as follows:server {Listen 80;server_name localhost;......The following changes are completed:server {Listen 8086;server_name 10.0.2.136;......In this way, Nginx starts listening for the local IP (10.0.2.136) 8086 port request after booting, then turns its request to the two IIS sites specified in mylocalsite and forwards the results to the client. If everything is
}After the modification, also modify the server listening port, the original content is as follows:server {Listen 80;server_name localhost;......The following changes are completed:server {Listen 8086;server_name 10.0.2.136;......In this way, Nginx starts listening for the local IP (10.0.2.136) 8086 port request after booting, then turns its request to the two IIS sites specified in mylocalsite and forwards the results to the client. If everything is
: VMware8.0, three CentOS5.6 virtual machines Server Configuration C_server 8.8.8.1 D_SERVER0 8.8.8.8 (Public network IP) D_server1 192.168.10.1 (LAN IP) R_server1 192.168.10.2(LAN IP) R_server2 192.168.10.3(LAN IP) Ensure that C_server and D_SERVER0 can communicate with each other, d_server1,r_server1 and r_server2 ca
statements that make the data change, then parses the SQL statements, analyzes their execution plan and execution costs, and chooses whether to synchronize the data or synchronize the SQL statements to other databases. This situation is useful when adjusting the table structure or changing data in bulk.3. Advantages and Disadvantages(1) Strong extensibility: When the system to higher database processing speed, as long as simply increase the database server can be extended.(2) Maintainability: W
IP
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
#禁用缓存
Proxy_buffering off;
#设置反向代理的地址
Proxy_pass http://192.168.1.1;
}
The proxy address is modified according to the actual situation.
4. Load Balancing Configuration
Nginx upstream by default is a poll-based
The following uses the reverse proxy function of Nginx to configure an Nginx load balancing server. The backend has three service nodes for providing Web Services, and load balancing of the three nodes is achieved through Nginx scheduling./Etc/nginx/conf. d/default. confUpstream myserver {Server 192.168.12.181: 80 weight = 3 max_fails = 3 fail_timeout = 20 s;Server 192.168.12.182: 80 weight = 1 max_fails =
) set the default policyThe default policy is ACCEPT. we recommend that you set the policy to ACCEPT. you can set the data packet to DROP in the filter.Iptables-t nat-P PREROUTING DROPIptables-t nat-P OUTPUT DROPIptables-t nat-P POSTROUTING DROP
D) set filtering for the filter table(Omitted. no policy is set here .)
E) configure DNAT for The nat tableIptables-t nat-a prerouting -- dst 172.16.3.109-p tcp -- dport 80-j DNAT -- to-destination 192.168.0.10-192.168.0.11Forward all packets destined fo
Five Servers192.168.155.129nginx Reverse proxy Server192.168.155.130 apache+php Server, PHP to use the MySQL function library, configuration will specify the MySQL installation path, so although later connected to the remote MySQL server, When you install PHP, you should also install MySQL to provide MySQL library (just use the library, no need to start the database and assign account), the following nginx+The same is true for PHP servers192.168.155.131 nginx+PHP Server192.168.155.132 apache+php
Common open source software for load balancing: Nginx, LVS, keepalivedCommercial hardware load devices: F5, Netscale1, LB, LVS IntroductionLB cluster is a shorthand for the load balance cluster, and translation into Chinese is a loading balancing cluster;LVS is an open source software project that implements load balan
Label: style blog HTTP Io color OS AR for SP The last two lectures are mainly about the nginx environment, which does not involve the development of the real environment. In this example, describe how to configure nginx for the Server Load balancer and WWW server and how to implement it. The following is an actual scenario: One Server Load
Nginx ~ Add Server Load balancer for docker containers, nginxdocker
As the most popular Server Load balancer and reverse proxy server, Nginx runs on linux. to achieve traffic distribution and load balancing, You need to deploy on IIS of multiple application servers, use some
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.