Total Visitors

Wednesday, November 13, 2013

How to configure Domain and Host in JBoss 7 AS Server

1) Domain Side (Master)
eg :-(say)
Domain(Master):-10.112.98.200
Host(Slave):-10.112.98.154

Remember:- If we want to create a host then we should first create Users for the host by clicking on add-user.bat cmd.
Then its username and password is used inside the HOST side in host.xml file.
Here say username:- slave and password:- admin

On DOMAIN Side:-
Create User by running add_user.bat. eg:- username: slave password:admin
Create bat with this command:-
domain.bat -b 10.112.98.154 -Djboss.bind.address.management=10.112.98.154
Now run it...

2) Host Side (Slave)
Create a bat file:-
c:
cd C:\jboss-as-7.1.1.Final_Cluster\bin
domain.bat -b 10.112.98.200 -Djboss.domain.master.address=10.112.98.154 -Djboss.bind.address.management=10.112.98.200

3)
Open host.xml : add server identities inside managementRealm attribute and Secret value in base64 format:

Convert Host Created password into base64 decoding using online decoder and place it inside the <secret value>.

<host name="slave" xmlns="urn:jboss:domain:1.2">     <--- username (which was created on Master)

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

### Edit the <domain-controller> at host section to read:
 <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}" security-realm="ManagementRealm"/>
    </domain-controller>

Don't forget to add the the security-realm attribute otherwise you will get messages like:


[Host Controller] 16:26:06,454 ERROR [org.jboss.remoting.remote.connection] (Rem
oting "host1:MANAGEMENT" read-1) JBREM000200: Remote connection failed: javax.se
curity.sasl.SaslException: Authentication failed: all available authentication m
echanisms failed
[Host Controller] 16:26:06,469 ERROR [org.jboss.as.host.controller] (Controller
Boot Thread) JBAS010901: Could not connect to master. Aborting. Error was: java.
lang.IllegalStateException: JBAS010942: Unable to connect due to authentication
failure.

Now run your Host side...You can access the link either from Master's or Host's IP Address.

No comments:

Post a Comment