JBoss 7 domain expand (new server machine outside the controller)

This post is the continuation of JBoss installation domain.

On the basis of the previous article, we will expand the domain to a new server on another machine increasing service availabilities.

The new machine will be called clu02 (IP 192.168.128.221), it will connect to clu01 (Domain Controller (DC) IP 192.168.128.220) and the final structure will be:

Steps to follow:

1- (clu01) create user (the name must match the name of the host, in this case host2):

Source   
[jboss@controller bin]$ ./add-user.sh
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a
Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : host2
Password :
Re-enter Password :
About to add user 'host2' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'host2' to file '/vol/jboss-as-7.1.1.Final/standalone/configuration/mgmt-users.properties'
Added user 'host2' to file '/vol/jboss-as-7.1.1.Final/domain/configuration/mgmt-users.properties'

User/password defined: host2/host2user

2- (clu01) Obtain password in encrypted version Base64 with the Base64Password:

Source   
[jboss@clu01 Base64EncryptPassword]$ ./Base64Password.sh host2user
=========================================================
Your  Clear Text Password is :     host2user
Base64 Encrypted Password is :     aG9zdDJ1c2Vy
=========================================================

3- (clu02) Edit the file:

Source   
<JBOSS_HOME>/domain/configuration/host.xml

Assigned to the host name (first lines), which is equal host2 assign the user created:

Source   
<host name="host2" xmlns="urn:jboss:domain:1.2">

We define password of host2 user:

Source   
<security-realm name="ManagementRealm">
<authentication>
<properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
</authentication>
<server-identities>
<!-- Replace this with either a base64 password of your own, or use a vault with a vault expression -->
<secret value="aG9zdDJ1c2Vy"/>
</server-identities>
</security-realm>

We define where is the domain controller:

Source   
<domain-controller>
<!-- <local/> -->
<!-- Alternative remote domain controller configuration with a host and port -->
<!-- <remote host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9999}"/> -->
<remote host="192.168.128.220" port="9999" security-realm="ManagementRealm"/>
</domain-controller>

Modify listener interfaces:

Source   
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:192.168.128.221}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:192.168.128.221}"/>
</interface>
<interface name="unsecure">
<!-- Used for IIOP sockets in the standard configuration.
To secure JacORB you need to setup SSL -->
<inet-address value="${jboss.bind.address.unsecure:192.168.128.221}"/>
</interface>
</interfaces>

We define the server:

Source   
<servers>
<server name="node3" group="ha-server-group" auto-start="true">
<!-- server-two avoids port conflicts by incrementing the ports in
the default socket-group declared in the server-group -->
<socket-bindings port-offset="100"/>
</server>
</servers>

4- (clu02) start server:

Source   
<JBOSS_HOME>/bin/domain.sh

5- (clu01) in the log we should see something like:

Source   
[org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-13,null) ISPN000094: Received new cluster view: [host1-controller:node1/web|3] [host1-controller:node1/web, host1-controller:node2/web, host2:node3/web]

Indicating that it has recognized the new server.

All applications that were deployed in the group should now be served by the new server, for example:

http://192.168.128.221:8180/ClusterWebApp/

In this situation we can only put a balancer in front.

Leave a Reply