JBOSS SETUP Domain Mode
1. Download jboss-eap-6.4.0.zip extract on /app/jboss
2. Extract the zip in to /app/jboss on both [App1a and App2a ]
3. Install required JAVA version on /app/jboss/JAVA and update startServer.sh script to use this JAVA.
4. Copy attached startServer.sh, stopServer.sh and monitor_jboss.sh scripts to /app/jboss/jboss-eap-6.4/bin
+++++++++++++++++++++++startServer.sh +++++++
# Jboss Application Server Startup
export JAVA_HOME=/app/java8_64
BASEDIR=/app/jboss
export LAUNCH_JBOSS_IN_BACKGROUND=1
export JBOSS_PIDFILE=$BASEDIR/jboss-as-domain.pid
/app/jboss/jboss-eap-6.4/bin/domain.sh --domain-config=domain.xml --host-config=host.xml -Djboss.domain.base.dir=$BASEDIR -P $BASEDIR/mster.properties > $BASEDIR/start.log &
echo $! >$JBOSS_PIDFILE
++++++++++++++++++++++
5. Create jbadmin, controller userid on JBOSS .jbadmin for Admin and controller for slave to communicate to master.
Go to /app/jboss/jboss-eap-6.4/bin
Run ./add-user.sh
refer:
Give required values during runtime .Please find attachment for reference.
REFER :CreateUser
6. For JBOSS cluster setup we will use domain mode where we have Master and slaves.
Master will be controlled by domain.xml and host-master.xml
Slave will be controlled by host-slave.xml
Note: We will only change domain.xml, host-master.xml and host-slave.xml for any JBOSS config changes
7. Master configuration [App1a ]
Copy attached property file to /app/jboss/jboss-eap-6.4 and update host names, logs path and jks paths.
We will always use full-ha profile and full-ha-sockets for our setup .So change ports under full-ha accordingly as we need
Update port no’s in host-master.xml [admin port and CLI port ]
Edit domain .xml to assign roles for users if need in ; tag .PFB
++++++++++++++++++master.properties ++++++++++++++++++
jboss.bind.address=hostname1a
jboss.bind.address.management=hostname1a
jboss.bind.address.unsecure=hostname1a
jboss.socket.binding.port-offset=0
#javax.net.debug=ssl:handshake:verbose
jboss.server.log.dir=/logs/jboss/app1a
jboss.node.name=App1a
## SSL paths ##
javax.net.ssl.keyStore=/app/jboss/SSL/app.jks
javax.net.ssl.keyStorePassword=password
javax.net.ssl.trustStore=/app/jboss/SSL/app.jks
javax.net.ssl.trustStorePassword=password
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++slave.properties +++++++++++++++++
jboss.bind.address=hostname2a
jboss.bind.address.management=hostname2a
jboss.bind.address.unsecure=hostname2a
jboss.socket.binding.port-offset=0
#javax.net.debug=ssl:handshake:verbose
jboss.domain.master.address=hostname1a
jboss.domain.master.port=39999
jboss.server.log.dir=/logs/jboss/app2a
jboss.node.name=App2a
## SSL paths ##
javax.net.ssl.keyStore=/app/jboss/SSL/app.jks
javax.net.ssl.keyStorePassword=password
javax.net.ssl.trustStore=/app/jboss/SSL/app.jks
javax.net.ssl.trustStorePassword=password
+++++++++++++++++++++++++++++++++++++
REFER :refer above slave.properties for slave
8. Slave configuration [App2a ]
-->Edit host-slave.xml and add Name in [name=”slave” on the first line
<host name="slave1" xmlns="urn:jboss:domain:1.7">
-->Updates secrete value .which the password of controller id used to connect to Master.
-->add username in <domain-controller>
<domain-controller>
<remote host="${jboss.domain.master.address}" port="${jboss.domain.master.port}" security-realm="ManagementRealm" username="controller"/>
</domain-controller>
Copy attached /app/jboss/jboss-eap-6.4 and changes hostname, jboss.domain.master.port, jboss.domain.master.address and Node names
9. Starting Master/slave environment
./app/jboss/jboss-eap-6.4/bin/startServer.sh
Start Both Master first and then slave .Now in logs we can see slave connected to Master
Default JBOSS console : http://IPAddress:9990/
10. Enable SSL to JBOSS console and Application .Please find the below attachment
REFER:refer above startServer.sh & stopServer.sh
After SSL enable
JBOSS Admin URL:https://IpAddress:9990/
Application URL : https://IpAddress:8443/Conext-root
11. DataSouce Creation
Sample DS creation for MYSQL .Please find the below attachment
REFER : DataSourceCreation
12. Cluster creation
on JBOSS console click on domain tab --> click on Server Groups ADD --> Give Cluster Name --> Select full-ha profile -->select full-ha-sockets and SAVE
Now add cluster members
Select HOST [MASTER] then click on Server configurations --> ADD --> give server instance name select the cluser Name [server group ] in to which this member should add and SAVE
Select HOST [SLAVE] then click on Server configurations -->ADD give server instance name select the cluser Name [server group ] in to which this member should add and SAVE
13. Password encryption
Find the attached steps for password encryption
REFER:Password ncryption
14. Stopping Master/slave Environment
./app/jboss/jboss-eap-6.4/bin/stopServer.sh
++++++++++++++++stopServer.sh ++++++++++
/app/jboss/jboss-eap-6.4/bin/jboss-cli.sh -c --controller=hostname1a:9999 --command=/host=master:shutdown
++++++++++++++++++++++++++++++++++++++++
for slave update slave name in place of master in the above script .
Good Luck !!!