Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Com balanceamento via Broker é possível dividir a carga com 2 ou mais AppServers, resolvendo assim problemas de lentidão causados por muitos acessos em um curto intervalo de tempo.

...

Nós vamos construir uma aplicação MeuRH exemplo com 5 AppServers: Broker HTTP, Broker RESTWorker 1Worker 2Worker 3.

Image Modified


Nossa aplicação funcionará com https HTTPS na porta 4430 e rest REST na porta 9090.

Logo, o Broker HTTP é quem subirá a porta 4430 e o Broker REST é quem subirá a porta 9090, então repassam às portas HTTP e REST dos Workers.

...

Bloco de código
titleappserver.ini do broker http
linenumberstrue
[GENERAL]
ConsoleLog=1
ConsoleLogDate=0 

[BALANCE_HTTP]
LOCAL_SERVER_PORT=4430
REMOTE_SERVER_01=192.168.0.50 4431
REMOTE_SERVER_02=192.168.0.50 4432
REMOTE_SERVER_03=192.168.0.50 4433
SSL_METHOD=SSL/TLS
SSL_CERTIFICATE=D:\totvs\ambientes-protheus\12-1-27-meurh\protheus\protheus_data\certs\totvs.pem
SSL_KEY=D:\totvs\ambientes-protheus\12-1-27-meurh\protheus\protheus_data\certs\totvs.key
SSL_PASSPHRASE=
SSL_ENCRYPT_UPSTREAM=1
SERVICE_NAME=AppServer-MeuRH-BrokerHTTP
SERVICE_DISPLAY_NAME="AppServer - MeuRH - Broker HTTP" 

[tech.totvs.com.br:4430/01]
ENABLE=1
PATH=D:\totvs\ambientes-protheus\12-1-27-meurh\protheus\protheus_data\web\PortalMeuRH01
DEFAULTPAGE=index.html


Para o Broker REST vamos utilizar como base o appserver.ini mostrado abaixo.

Bloco de código
titleappserver.ini do broker rest
linenumberstrue
[GENERAL]
ConsoleLog=1
ConsoleLogDate=0 

[BALANCE_WEBSERVICESWEB_SERVICES]
LOCAL_SERVER_PORT=9090
REMOTE_SERVER_01=192.168.0.50 9091
REMOTE_SERVER_02=192.168.0.50 9092
REMOTE_SERVER_03=192.168.0.50 9093
SSL_METHOD=SSL/TLS
SSL_CERTIFICATE=D:\totvs\ambientes-protheus\12-1-27-meurh\protheus\protheus_data\certs\totvs.pem
SSL_KEY=D:\totvs\ambientes-protheus\12-1-27-meurh\protheus\protheus_data\certs\totvs.key
SSL_PASSPHRASE=
SSL_ENCRYPT_UPSTREAM=1
SERVICE_NAME=AppServer-MeuRH-BrokerREST
SERVICE_DISPLAY_NAME="AppServer - MeuRH - Broker REST" 

...