Este conteúdo não está disponível no idioma selecionado.
7.2. Install and Configure a Worker Node
7.2.1. Configure a JBoss Enterprise Application Server 6 Worker Node Copiar o linkLink copiado para a área de transferência!
mod_cluster subsystem. Each worker node is configured separately, so repeat this procedure for each node you wish to add to the cluster.
Worker Node Configuration
- If you use a standalone server, it must be started with the
standalone-haprofile. - If you use a managed domain, your server group must use the
haorfull-haprofile, and theha-socketsorfull-ha-socketssocket binding group. JBoss Enterprise Application Platform ships with a cluster-enabled server group calledother-server-groupwhich meets these requirements.
Note
/profile=full-ha portion of the commands.
Procedure 7.1. Configure a Worker Node
Configure the network interfaces.
By default, the network interfaces all default to127.0.0.1. Every physical host which hosts either a standalone server or one or more servers in a server group needs its interfaces to be configured to use its public IP address, which the other servers can see.To change the IP address of a JBoss Enterprise Application Platform host, you need to shut it down and edit its configuration file directly. This is because the Management API which drives the Management Console and Management CLI relies on a stable management address.Follow these steps to change the IP address on each server in your cluster to the master's public IP address.- Shut down the server completely.
- Edit either the
host.xml, which is inEAP_HOME/domain/configuration/for a managed domain, or thestandalone-ha.xmlfile, which is inEAP_HOME/standalone/configuration/for a standalone server. - Locate the
<interfaces>element. Three interfaces are configured,management,public, andunsecured. For each of these, change the value127.0.0.1to the external IP address of the host. - For hosts that participate in a managed domain but are not the master, locate the
<hostelement. Note that it does not have the closing>symbol, because it contains attributes. Change the value of its name attribute frommasterto a unique name, a different one per slave. This name will also be used for the slave to identify to the cluster, so make a note of it. Optional Step
For newly-configured hosts which need to join a managed domain, find the<domain-controller>element. Comment out or remove the<local />element, and add the following line, changing the IP address (X.X.X.X) to the address of the domain controller. This step does not apply for a standalone server.<remote host="X.X.X.X" port="${jboss.domain.master.port:9999}" security-realm="ManagementRealm"/><remote host="X.X.X.X" port="${jboss.domain.master.port:9999}" security-realm="ManagementRealm"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file and exit.
Configure authentication for each slave server.
Each slave server needs a username and password created in the domain controller's or standalone master'sManagementRealm. On the domain controller or standalone master, run theEAP_HOME/add-user.shcommand. Add a user with the same username as the slave, to theManagementRealm. When asked if this user will need to authenticate to an external JBoss AS instance, answeryes. An example of the input and output of the command is below, for a slave calledslave1, with passwordchangeme.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the
<secret>element from theadd-user.shoutput.Copy the value from the last line of theadd-user.shoutput. You need to add this value to your slave's configuration file in the next step.Modify the slave host's security realm to use the new authentication.
Re-open the slave host'shost.xmlorstandalone-ha.xmlfile and locate the<security-realms>element. Add the following block of XML code directly below the<security-realm name="ManagementRealm">line, replacing the<secret value="Y2hhbmdlbWU="/>line with the one from the previous step.<server-identities> <secret value="Y2hhbmdlbWU="/> </server-identities><server-identities> <secret value="Y2hhbmdlbWU="/> </server-identities>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save and exit the file.Restart the server.
The slave will now authenticate to the master using the its host name as the username and the encrypted string as its password.
Your standalone server, or servers within a server group of a managed domain, are now configured as mod_cluster worker nodes. If you deploy a clustered application, its sessions are replicated to all cluster nodes for failover, and it can accept requests from an external HTTPD server or load balancer. Each node of the cluster discovers the other nodes using automatic discovery, by default.