Configuración del equilibrador de carga

Esta tarea configura el equilibrador de carga en un0 mediante Apache HTTP Server. Sustituya un0 por cualquier otro nodo si esta configuración se debe realizar en otro nodo

  1. Conéctese a un0 y, a continuación, navegue a /etc/httpd/conf.
  2. Realice una copia de seguridad de httpd.conf.
  3. En un0, edite httpd.conf.
  4. Agregue el siguiente contenido junto a la línea Include conf.modules.d/*.conf:
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
    LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
    LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
    LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
    LoadModule ssl_module modules/mod_ssl.so
  5. Comente la línea #ServerAdmin you@example.com.
  6. Agregue Include conf/odh-ranger-lb.conf al final del archivo.
  7. Guarde httpd.conf.
  8. En la misma carpeta, abra vi odh-ranger-lb.conf.
  9. Agregue el siguiente contenido.
    Nota

    <VirtualHost *:8443> debe coincidir con el puerto por defecto del servicio Apache HTTP Server.
    <VirtualHost *:8443>
            SSLEngine On
            SSLProxyEngine On
            SSLCertificateFile /etc/security/serverKeys/<<lb_hostname>>.crt
            SSLCertificateKeyFile /etc/security/serverKeys/<<lb_hostname>>.key
     
            SSLCACertificateFile /etc/security/serverKeys/oraclerootCA.crt
            SSLProxyCACertificateFile /etc/security/serverKeys/oraclerootCA.crt
            SSLVerifyClient none
            SSLOptions +ExportCertData
            SSLProxyVerify none
            SSLProxyCheckPeerCN off
            SSLProxyCheckPeerName off
            SSLProxyCheckPeerExpire off
            ProxyRequests off
            ProxyPreserveHost off
     
            Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
     
            <Proxy balancer://rangercluster>
                   BalancerMember https://<<un0-fqdn>>:6182 loadfactor=1 route=1
                   BalancerMember https://<<un1-fqdn>>:6182 loadfactor=1 route=2
     
     
                    Order Deny,Allow
                    Deny from none
                    Allow from all
     
                    ProxySet lbmethod=byrequests scolonpathdelim=On stickysession=ROUTEID maxattempts=1 failonstatus=500,501,502,503 nofailover=Off
            </Proxy>
     
            # balancer-manager
            # This tool is built into the mod_proxy_balancer
            # module and will allow you to do some simple
            # modifications to the balanced group via a gui
            # web interface.
            <Location /balancer-manager>
                    SetHandler balancer-manager
                    Order deny,allow
                    Allow from all
            </Location>
     
     
           ProxyPass /balancer-manager !
           ProxyPass / balancer://rangercluster/
           ProxyPassReverse / balancer://rangercluster/
     
    </VirtualHost>
    • <<lb_hostname>>: sustituya por el nombre de host del equilibrador de carga (un0 en este caso)
    • <<un0-fqdn>>: sustituya por el nombre de host de administrador de Ranger existente (un0 en este caso)
    • <<un1-fqdn>>: sustituya por un nuevo nombre de host de administrador de Ranger (un1 en este caso)
    Nota

    Los certificados y las claves ya se han generado y están disponibles en el nodo. No copie el certificado en ningún otro lugar ni genere un nuevo certificado
  10. Guardar el archivo.
  11. Reinicie Apache HTTP Server.
    service httpd restart