) 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
follows:Assuming B.Com's primary server IP is 192.168.5.149, load-balanced on 192.168.5.150 and 192.168.5.151 machinesThe domain name B.Com is now resolved to 192.168.5.149IP.Add the following code to the nginx.conf of the primary server (192.168.5.149): Upstream B.Com { server 192.168.5.150:80; server 192.168.5.151:80; } server{ listen 80; server_name b.com; location/{ proxy_pass http:/ /b.com; proxy_set_header host $host; pr
192.168.5.151:80;}server{Listen 80;server_name B.Com;Location/{Proxy_pass http://b.com;Proxy_set_header Host $host;Proxy_set_header X-real-ip $remote _addr;Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;}}Save Restart NginxSet Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the
Introduction to load Balancing clusters
The software that realizes load Balancing cluster is: LVS, keepalived, Nginx, Haproxy and so on. The LVS belong to four layer (network OSI model), Nginx belongs to seven layer, haproxy can be considered as four layer, also can be used as seven layer.
The Keepalived load balancing function is actually the LVS
:80; } server{ listen 80; server_name b.com; location/{ proxy_pass http:/ /b.com; proxy_set_header host $host; proxy_set_header x-real-ip $remote _addr; proxy_set_header x-forwarded-for $proxy _add_x_ forwarded_for; } } Save restart Nginx Set Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart N
Apache implements the Load balancer parameter "proxypass/balancer://proxy/", where "Proxypass" is the command that configures the virtual server, "/" represents the URL prefix for sending Web requests, such as: http://myserver/Or HTTP://MYSERVER/NODE1, these URLs will conform to the above filter conditions, "balancer:/
192.168.5.151:80;}server{Listen 80;server_name B.Com;Location/{Proxy_pass http://b.com;Proxy_set_header Host $host;Proxy_set_header X-real-ip $remote _addr;Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;}}Save Restart NginxSet Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the
: You can change the red font based on your actual situation;
4. Start Nginx
4.1 verify that nginx configuration is normal
#/Usr/local/nginx/sbin/nginx-t
Note: The following content is returned, otherwise it will be changed as prompted;
Nginx: the configuration file/usr/local/nginx/conf/nginx. conf syntax is OKNginx: configuration file/usr/local/nginx/conf/nginx. conf test is successful
4.2 start Nginx
#/Usr/local/nginx/sbin/nginx
4.3 stop Nginx
# Killall-9 nginx
4.4 DNS domain name resolu
This article to share the content is about Nginx and PHP installation and configuration six Nginx reverse proxy and Load Balancer Deployment Guide, has a certain reference value, the need for friends can refer to
1. Locate and open the Conf file
2. Load Balancing ConfigurationNginx upstream by default is a poll-based
Linux Cluster Server Load balancer lab notes I,Network Topology: II,Virtual Machine Configuration Create three virtual machines on one physical computer.WindowsOperating System, Configuration192.168.1.0The IP address of the CIDR block.Centos5.4. One Server Load balancer instance must be configured with two NI
(192.168.5.149): Upstream B.Com { server 192.168.5.150:80; server 192.168.5.151:80; } server{ listen 80; server_name b.com; location/{ proxy_pass http:/ /b.com; proxy_set_header host $host; proxy_set_header x-real-ip $remote _addr; proxy_set_header x-forwarded-for $proxy _add_x_ forwarded_for; } } Save restart Nginx Set Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:serv
_add_x_forwarded_for;}}Save Restart NginxSet Nginx on 192.168.5.150 and 192.168.5.151 machine, open nginx.conf Add the following code at the end:server{Listen 80;server_name B.Com;Index index.html;root/data0/htdocs/www;}Save Restart NginxAfter completing the next steps, you can implement the B.Com load balancer configuration.Does the primary server not provide s
Use httpd to configure Server Load balancer for Tomcat
Experimental System: CentOS 6.6 _ x86_64
Prerequisites: Prepare the compiling environment in advance, and disable both firewall and selinux.
Tutorial Description: There are two hosts in this experiment, and IP addresses are allocated as topology.
Experimental software: jdk-8u60-linux-x64 apache-tomcat-8.0.24 tomcat-connectors-1.2.41 httpd-2.2.15 httpd-d
I. Introduction to the Basic overviewIi. types and principles of LVSThree, LVS scheduling algorithmIv. using DR and Nat to achieve web load balancingI. Introduction to the Basic overviewLVS is a load balancing software that works at the transport level and consists of two components of the IPVSADM and kernel space of the user space Ipvs. The Ipvsadm is a command-line tool for user space, primarily for manag
2.41.0.1217-nov-2004 Stable GNU general public License (GPL)IPVS for Kernel 2.21.0.814-may-2001 Stable GNU general public License (GPL)LVS Load Balancing Scheme
Monitor LVs in a self-scripted way
Heartbeat+lvs+ldirectord is more complicated and difficult to control.
Configure LVS with the tool piranha provided by Redhat
Keepalived+lvs Solution (Recommended)
2.2 LVS Load Balancing
First, about the CentOS system introductionCentOS (Community Enterprise Operating System, Chinese means: Community Enterprise operating system) is one of the Linux distributions, it comes from Red Hat enterprise Linux is compiled according to the source code released by the open source rules. Based on Red Hat's continuous upgrade, and fixes for known bugs, CentOS
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.