Vous êtes sur la page 1sur 5

Instalación del Balanceador

1. Instala el servidor Apache Web Server, en el nodo destinado al balanceador. (En su ultima
version 2.4.6).
Con la cuenta root, ejecuta:
# yum install httpd
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.unimagdalena.edu.co
* extras: mirror.unimagdalena.edu.co
* updates: mirror.unimagdalena.edu.co
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-80.el7.centos.1 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-80.el7.centos.1 for package: httpd-2.4.6-
80.el7.centos.1.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-80.el7.centos.1.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-80.el7.centos.1 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================
Package Arch Version Repository
Size
======================================================================
Installing:
httpd x86_64 2.4.6-80.el7.centos.1
updates 2.7 M
Installing for dependencies:
httpd-tools x86_64 2.4.6-80.el7.centos.1
updates 90 k
mailcap noarch 2.1.41-2.el7 base
31 k

Transaction Summary
======================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 2.8 M
Installed size: 9.6 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/mailcap-2.1.41-2.el7.noarch.rpm: Header V3
RSA/SHA256 Signature, key ID f4a80eb5: NOKEY ] 34 kB/s | 46 kB 00:01:23 ETA
Public key for mailcap-2.1.41-2.el7.noarch.rpm is not installed
(1/3): mailcap-2.1.41-2.el7.noarch.rpm
| 31 kB 00:00:02
Public key for httpd-2.4.6-80.el7.centos.1.x86_64.rpm is not installed71%
[==========================================- ] 382 kB/s | 2.0 MB
00:00:02 ETA
(2/3): httpd-2.4.6-80.el7.centos.1.x86_64.rpm
| 2.7 MB 00:00:04
(3/3): httpd-tools-2.4.6-80.el7.centos.1.x86_64.rpm
| 90 kB 00:00:04
------------------------------------------------------------------------------------------------------------------------
---
Total 574 kB/s |
2.8 MB 00:00:05
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-3.1611.el7.centos.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : httpd-tools-2.4.6-80.el7.centos.1.x86_64 1/3
Installing : mailcap-2.1.41-2.el7.noarch 2/3
Installing : httpd-2.4.6-80.el7.centos.1.x86_64 3/3
Verifying : mailcap-2.1.41-2.el7.noarch 1/3
Verifying : httpd-tools-2.4.6-80.el7.centos.1.x86_64 2/3
Verifying : httpd-2.4.6-80.el7.centos.1.x86_64 3/3
Installed:
httpd.x86_64 0:2.4.6-80.el7.centos.1
Dependency Installed:
httpd-tools.x86_64 0:2.4.6-80.el7.centos.1 mailcap.noarch 0:2.1.41-2.el7
Complete!
2. Inicia el servidor Apache Web Server
#systemctl start httpd.service
Verifica que el software se instalo correctamente, abre la url http://localhost en un navegador:
Figura 1. Apache Web Server

1.1 Configuracion del Balanceador


1. Descomprime el archico mod_cluster-1.3.1.Final-linux2-x64-so.tar.gz, en /root
Usando la cuenta root ejecuta:
#tar zxvf mod_cluster-1.3.1.Final-linux2-x64-so.tar.gz
#ls -l
drwxr-xr-x 2 carlos carlos 4096 Shin 19 09:35 ./
drwxrwxr-x 3 carlos carlos 4096 Shin 19 09:35 ../
-rwxr-xr-x 1 carlos carlos 55594 Keg 8 2015 mod_advertise.so*
-rw-r--r-- 1 carlos carlos 191978 Shin 19 09:35 mod_cluster-1.3.1.Final-linux2-x64-so.tar.gz
-rwxr-xr-x 1 carlos carlos 44275 Keg 8 2015 mod_cluster_slotmem.so*
-rwxr-xr-x 1 carlos carlos 240201 Keg 8 2015 mod_manager.so*
-rwxr-xr-x 1 carlos carlos 169627 Keg 8 2015 mod_proxy_cluster.so*
2. Copia los archivos *.so a la carpeta etchttpd/modules
#cp *.so etchttpd/modules
3. Crea el archivo modcluster.conf en la carpeta /etc/httpd/conf.d, con el siguiente contenido.
#touch modcluster.conf
#vi modcluster.conf
LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so

MemManagerFile cache/mod_cluster

<IfModule manager_module>
Listen 6666
<VirtualHost *:6666>
DirectoryIndex disabled
<Directory />
# add ip of JBoss nodes to join this proxy here
Require ip 172.16.8.146
Require ip 172.16.8.156
</Directory>
ServerAdvertise off
EnableMCPMReceive
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
# add ip of clients allowed to access mod_cluster-manager
Require ip 127.0.0.1
</Location>
</VirtualHost>
</IfModule>

3. Reinicia el servidor Apache Web Server


#systemctl stop httpd.service
#systemctl start httpd.service

1.2 Configuracion de mod-cluster en los nodos


1. Edita el archivo standalone-ha.xml y agrega el contenido indicado, en cada nodo.
En la seccion <socket-binding-group name="standard-sockets", agrega lo siguiente:
...
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="$
{jboss.socket.binding.port-offset:0}">
...
<outbound-socket-binding name="proxy1">
<remote-destination host="172.16.88.175" port="6666"/>
</outbound-socket-binding>

</socket-binding-group>
...
2. Actualiza la lista de proxys
En la seccion <subsystem xmlns="urn:jboss:domain:modcluster:2.0">, agrega lo siguiente:
...
<subsystem xmlns="urn:jboss:domain:modcluster:2.0">
<mod-cluster-config advertise-socket="modcluster" proxies="proxy1" connector="ajp">

3. Reinicia cada nodo del cluster
En cada nodo, con la cuenta root, ejecuta:
#systemctl stop jboss-eap
#systemctl start jboss-eap

1.3 Despliegue de la aplicación de prueba


1. Copia la aplicación numerico.war en el directorio de despliegue de cada nodo

Como root ejecuta:

#cp numerico.war opt/Middleware/EAP-7.1/standalone/deployments

Nota: La aplicación numerico.war, fue proporcionada por el personal de tyg

2. Verifica que la aplicación es accesible desde el balanceador.


Abre en el navegador la url: http://172.16.88.175/numerico/primos.jsp
Figura 2.- Balanceo de aplicación de prueba

Vous aimerez peut-être aussi