Integrated Load Balancer (ILB),a feature of Oracle Solaris,provides Layer 3 and Layer 4 load-balancing capabilities for Oracle Solaris installed on SPARC and x86 based systems.
The key features of ILB include:
1.Support for stateless Direct Server Return (DSR) and Network Address Translation (NAT) modes of operation for IPv4 and IPv6.
2.Allows ILB administration through a command-line interface (CLI).
3.Provides server monitoring capabilities through health checks.
This article just show you how to create Half-NAT Load-Balancing mode with zones.The following figure shows the implementation of ILB using the Half-NAT topology.
I created three Zones with four VNICs on global zone (node01),the 192.168.1.0 subnet's default gateway is 192.168.1.1.The 192.168.0.11 is a gateway of both tomcat servers.
Half-NAT Load-Balancing.
I have finished to create VNICs、zones and installation zones,the following figtures show the configuration about them.
VNICs information:
ILB Zone:
Server1 Zone:
Server2 Zone:
Node01 (Global Zone)
If you want to communite with each zones from global zone,you must use route command with –p option to add a persistent route,here follows my instance:
Network Configuration
ilb zone:
server1 zone:
server2 zone:
Installing tomcat in each of tomcat servers:
After installation,you can access tomcat by the web browser from global zone or non-global zone!
Configure Load Balancing
ILB has two portions, the kernel and the userland. The kernel portion is automatically installed as a part of the Oracle Solaris 11 installation. But to get the userland portion of ILB, the user has to manually install the ilb present at service/network/load-balancer/ilb package.After installation,you can use ilbadm command to configure it.
1.Enable ilb service:
Installing ilb package on ilb zone:
Before you enable ilb servie,make sure that the system's Role Based Access Control(RBAC) attribute files have following entries(if the entries are not there, add them manually):
Enable the appropriate forwarding service either IPv4 or IPv6 or both of them.
2.Configuration:
I need to tell the outside world that packets destined for VIP:192.168.1.12, should be sent to vnic0.Do following steps:
Now,you can use above VIP to access tomcat from outside.
You can use following scripts to check which server was served?Save snoop.jsp to the /var/tomcat6/webapps/examples/jsp/snp directory in each of tomcat servers.
Health Checks
ILB provides the following optional types of server health checks for the user to select from:
1.Built-in ping probes
2.Built-in TCP probes
3.Built-inUDP probes
4.User-supplied tests that can run as health checks
By default,ILB does not perform any health checks. You can specify health checks for each server group when creating a load-balancing rule. You can configure only one health check per load-balancing rule. As long as a virtual service is enabled, the health checks on the server group that is associated with the enabled virtual service start automatically and repeat periodically.The health checks stop as soon as the virtual service is disabled. The previous health check states are not preserved when the virtual service is re-enabled.
When you specify a TCP,UDP, or custom test probe for running a health check, ILB sends a ping probe, by default, to determine if the server is reachable before it sends the specified TCP,
UDP, or custom test probe to the server. The ping probe is a method of monitoring server health. If the ping probe fails, the corresponding server is disabled with the health check status
of unreachable. If the ping probe succeeds, but the TCP,UDP, or custom test probe fails, the server is disabled with the health check status of dead.
I created two health check:hc1 and hc2.I specify a TCP to hc1 and custom test probe for hc2.
After create a health check, you need to add it to your load balancing rule. Unfortunately, ilbadm doesn't have a command to modify an existing load balancing rule, so you have to delete it and create it again:
When you refresh your browser,you will be directed to server2.So your server1 get into dead status . You can also see the status as dead using ilbadm show-hc-result command:
That's all for NAT-Half mode load balance in solaris 11,for more information about it from here.
Next,i'll show you how to create ILB High-Availability in solaris 11,please wait…………..
本文出自 “candon123” 博客,谢绝转载!