<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>15.9. Regras de balanceamento de carga</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Apache_CloudStack-Admin_Guide-4.1.0-pt-BR-1-" /><script type="text/javascript" src="../../../../../toc.js"></script><script type="text/javascript">
              addID('Apache_CloudStack');
              
	      addID('Apache_CloudStack.4.1.0');
              
              addID('Apache_CloudStack.4.1.0.books');
	      addID('Apache_CloudStack.4.1.0.Admin_Guide');
              </script><link rel="home" href="index.html" title="Guia do Administrador do CloudStack" /><link rel="up" href="networks.html" title="Capítulo 15. Gerenciando redes e tráfego" /><link rel="prev" href="external-firewalls-and-load-balancers.html" title="15.8. Firewalls e balanceadores de carga externos" /><link rel="next" href="guest-ip-ranges.html" title="15.10. Guest IP Ranges" /></head><body class="toc_embeded "><div id="tocdiv" class="toc"><iframe id="tocframe" class="toc" src="../../../../toc.html">This is an iframe, to view it upgrade your browser or enable iframe display.</iframe></div><p id="title"><a class="left" href="http://cloudstack.apache.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://cloudstack.apache.org/docs"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="external-firewalls-and-load-balancers.html"><strong>Anterior</strong></a></li><li class="next"><a accesskey="n" href="guest-ip-ranges.html"><strong>Próxima</strong></a></li></ul><div xml:lang="pt-BR" class="section" id="load-balancer-rules" lang="pt-BR"><div class="titlepage"><div><div><h2 class="title" id="load-balancer-rules">15.9. Regras de balanceamento de carga</h2></div></div></div><div class="para">
		Um usuário ou administrador do CloudStack pode criar regras de balanceamento de carga que distribuem o tráfego recebido em um endereço IP público por uma ou mais máquinas virtuais. Um usuário cria uma regra, especifica um algoritmo e assinala a regra a um conjunto de máquinas virtuais.
	</div><div class="note"><div class="admonition_header"><h2>Nota</h2></div><div class="admonition"><div class="para">
			Se você cria regras de balanceamento de carga enquanto usando um oferta de serviço de rede que inclui um equipamento externo de balanceamento de carga, como o NetScaler, e depois altera a oferta de serviço para um que usa o roteador virtual do CloudStack , você deve criar uma regra no firewall do roteador virtual para cada uma das regras de balanceamento de carga existentes, de forma que elas possam continuar funcionado.
		</div></div></div><div class="para">
	</div><div xml:lang="pt-BR" class="section" id="add-load-balancer-rule" lang="pt-BR"><div class="titlepage"><div><div><h3 class="title" id="add-load-balancer-rule">15.9.1. Adding a Load Balancer Rule</h3></div></div></div><div class="orderedlist"><ol><li class="listitem"><div class="para">
				Faça login na interface de usuário do CloudStack como administrador ou usuário final.
			</div></li><li class="listitem"><div class="para">
				Na barra de navegação à esquerda, selecione Network.
			</div></li><li class="listitem"><div class="para">
				Click the name of the network where you want to load balance the traffic.
			</div></li><li class="listitem"><div class="para">
				Clique em View IP Addresses.
			</div></li><li class="listitem"><div class="para">
				Clique no endereço IP para o qual você deseja criar a regra, então clique na aba Configuration.
			</div></li><li class="listitem"><div class="para">
				No nó Load Balancing do diagrama, clique em View All.
			</div><div class="para">
				In a Basic zone, you can also create a load balancing rule without acquiring or selecting an IP address. CloudStack internally assign an IP when you create the load balancing rule, which is listed in the IP Addresses page when the rule is created.
			</div><div class="para">
				To do that, select the name of the network, then click Add Load Balancer tab. Continue with <a class="xref" href="load-balancer-rules.html#config-lb">7</a>.
			</div></li><li class="listitem" id="config-lb"><div class="para">
				Fill in the following:
			</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Name</strong></span>: Um nome para a regra de balanceamento de carga.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Public Port</strong></span>: The port receiving incoming traffic to be balanced.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Private Port</strong></span>: A porta que as máquinas virtuais usarão para receber o tráfego.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Algorithm</strong></span>: Choose the load balancing algorithm you want CloudStack to use. CloudStack supports a variety of well-known algorithms. If you are not familiar with these choices, you will find plenty of information about them on the Internet.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Stickiness</strong></span>: (Optional) Click Configure and choose the algorithm for the stickiness policy. See Sticky Session Policies for Load Balancer Rules.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>AutoScale</strong></span>: Click Configure and complete the AutoScale configuration as explained in <a class="xref" href="external-firewalls-and-load-balancers.html#autoscale">Seção 15.8.5, “Configuring AutoScale”</a>.
					</div></li></ul></div></li><li class="listitem"><div class="para">
				Click Add VMs, then select two or more VMs that will divide the load of incoming traffic, and click Apply.
			</div><div class="para">
				The new load balancer rule appears in the list. You can repeat these steps to add more load balancer rules for this IP address.
			</div></li></ol></div></div><div xml:lang="pt-BR" class="section" id="sticky-session-policies-for-lb-rules" lang="pt-BR"><div class="titlepage"><div><div><h3 class="title" id="sticky-session-policies-for-lb-rules">15.9.2. Sticky Session Policies for Load Balancer Rules</h3></div></div></div><div class="para">
		Sticky sessions are used in Web-based applications to ensure continued availability of information across the multiple requests in a user's session. For example, if a shopper is filling a cart, you need to remember what has been purchased so far. The concept of "stickiness" is also referred to as persistence or maintaining state.
	</div><div class="para">
		Any load balancer rule defined in CloudStack can have a stickiness policy. The policy consists of a name, stickiness method, and parameters. The parameters are name-value pairs or flags, which are defined by the load balancer vendor. The stickiness method could be load balancer-generated cookie, application-generated cookie, or source-based. In the source-based method, the source IP address is used to identify the user and locate the user’s stored data. In the other methods, cookies are used. The cookie generated by the load balancer or application is included in request and response URLs to create persistence. The cookie name can be specified by the administrator or automatically generated. A variety of options are provided to control the exact behavior of cookies, such as how they are generated and whether they are cached.
	</div><div class="para">
		For the most up to date list of available stickiness methods, see the CloudStack UI or call listNetworks and check the SupportedStickinessMethods capability.
	</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="external-firewalls-and-load-balancers.html"><strong>Anterior</strong>15.8. Firewalls e balanceadores de carga externos</a></li><li class="up"><a accesskey="u" href="#"><strong>Acima</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Principal</strong></a></li><li class="next"><a accesskey="n" href="guest-ip-ranges.html"><strong>Próxima</strong>15.10. Guest IP Ranges</a></li></ul></body></html>
