Friday 23 October 2015

Configuring a JBOSS as Domain

In this tutorial we will show all the steps to configure a JBOSS as Domain on one physical server(Machine).

The domain controller must be started before any slave servers in any server groups in the domain. Use this procedure first on the domain controller, and then on each associated host controller and each other host associated with the domain.


I am going to configure domain as below Architecture. 

I am going to configure  domain controller (DC) and two Host controllers (HC) on same machine so first need to copy configuration directory from /EAP_HOME/domain/ to other locations.

Here I have created three directories as below in /u02/local/opt/mydomain/ and copied configuration directory  from /EAP_HOME/domain/.

master, slave01, slove02

1.Configure the Domain

a. If you want make your server accessible to outside world, you need to define a property named jboss.bind.address.management  in host-master.xml file (This file located in configuration directory)

<interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:192.168.1.12}"/>
        </interface>
    </interfaces>

b. Configure the Host Name Using a System Property

<host name="master" xmlns="urn:jboss:domain:1.6">

Now we can start the domain controller with the following command.

[jbossas@middleware bin]$ pwd
/u02/local/opt/jboss-eap-6.2/bin

[jbossas@middleware bin]$./domain.sh -Djboss.domain.base.dir=/u02/local/opt/mydomain/master --host-config=host-master.xml

Admin console listening on http://192.168.1.12:9990/console


2.Configure the slave 01

a. Configure the Host Name Using a System Property in host-slave.xml (This file located in /Slave01_home/configuration directory)

<host name="slave01" xmlns="urn:jboss:domain:1.5">

b. Need to change jboss.management.native.port number, because DC using same port number. (If you are running slave on diff machine then no need to change this port number)

management-interfaces>
            <native-interface security-realm="ManagementRealm">
                <socket interface="management" port="${jboss.management.native.port:19999}"/>
            </native-interface>
        </management-interfaces>


Now we can start the Host controller (Slave 01)with the following command.

[jbossas@middleware bin]$./domain.sh -Djboss.domain.base.dir=/u02/local/opt/mydomain/slave01/ --host-config=host-slave.xml -Djboss.domain.master.address=192.168.1.12


Once slave01 successfully started , check in admin console either slave01 connected to master or not. 




during the slave starting time some files/directories created in
slave home directory.

[jbossas@middleware slave01]$ pwd
/u02/local/opt/mydomain/slave01
[jbossas@middleware slave01]$ ls -ltr
total 20
drwxr-xr-x 2 jbossas was 4096 Oct 23 01:07 log
drwxr-xr-x 3 jbossas was 4096 Oct 23 01:07 data
drwxr-xr-x 3 jbossas was 4096 Oct 23 01:07 tmp
drwxr-xr-x 4 jbossas was 4096 Oct 23 01:07 servers
drwxrwxr-x 3 jbossas was 4096 Oct 23 01:07 configuration

3.configure  slave 02

a. Configure the Host Name Using a System Property in host-slave.xml (This file located in /u02/local/opt/mydomain/slave02/configuration directory)

<host name="slave02" xmlns="urn:jboss:domain:1.5">

b. Need to change jboss.management.native.port number, because DC using same port number. (If you are running slave on diff machine then no need to change this port number)

management-interfaces>
            <native-interface security-realm="ManagementRealm">
                <socket interface="management" port="${jboss.management.native.port:29999}"/>
            </native-interface>


Now we can start the Host controller (Slave 02)with the following command.

./domain.sh -Djboss.domain.base.dir=/u02/local/opt/mydomain/slave02/ --host-config=host-slave.xml -Djboss.domain.master.address=192.168.1.12

Once slave02 successfully started , check in admin console either slave02 connected to master or not.







If already master address present in host-slave.xml file, then no need to give master address in HC start command.  

host-slave.xml

<domain-controller>
       <remote host="192.168.1.12" port="${jboss.domain.master.port:9999}" security-realm="ManagementRealm"/>
    </domain-controller>

Then run below cmd.


./domain.sh -Djboss.domain.base.dir=/u02/local/opt/mydomain/slave02/ --host-config=host-slave.xml

No comments: