v2.0
SECTION I
CONFIGURE DOMAIN , SERVER GROUP AND DEFAULT INSTANCE BY USING DEFAULT PROFILE. DO
NOT USE HA , FULL & FULL-HA
..........................................................................................................
3
2.1. CONFIGURE DOMAIN WITH NAME AS SERVER1 ......................................................................................
3
2.2. CONFIGURE SERVER GROUP AND ONE JBOSS INSTANCE .......................................................................
3
3.
HTTP PARAMETER TUNING
.....................................................................................................................
4
3.1. Use the default standard http connector ............................................................................................
4
3.2. Set Max Connections to 50 for http connector ...................................................................................
4
3.3. Configure AJP Connector .................................................................................................................
5
ADD A SOCKET TO THE SOCKET BINDING GROUP.
..........................................................................................
8
TO ADD A SOCKET TO THE SOCKET BINDING GROUP, ISSUE THE FOLLOWING COMMAND, REPLACING THE
PROTOCOL AND PORT WITH THE ONES YOU NEED. .............................................................................................
8
ADD THE SOCKET BINDING TO THE WEB SUBSYSTEM.
....................................................................................
8
ISSUE THE FOLLOWING COMMAND TO ADD A CONNECTOR TO THE WEB SUBSYSTEM , SUBSTITUTING THE SOCKET
BINDING NAME AND PROTOCOL WITH THE ONES YOU NEED . ..............................................................................
8
4.
JVM CONFIGURATION
...........................................................................................................................
8
4.1. Configure JVM at group level. Even if you add additional instances, new JVM settings would get
replicated. ....................................................................................................................................................
8
STACK SIZE ADDITION CANNOT BE DONE FROM MANAGED CONSOLE
..........................................................
9
ADDING THE PIECE IN BETWEEN GROUP LINES ................................................................................................
10
5.
REMOVE THE EXAMPLEDS WHICH IS IN-MEMORY BASED DATASOURCE. ...........................................
11
5.1.
ExampleDS Datasource in in-memory based Datasource which comes default with JBoss EAP 6.0.
Do not remove h2 driver. ...........................................................................................................................
11
6.
CONFIGURE NON-XA
DATASOURCE....................................................................................................
11
6.1. Configure Non-XA datasource with below attributes .......................................................................
11
7.
DBMS SECURITY SETUP
.......................................................................................................................
14
7.1.
Application authentication with Database. ......................................................................................
14
8.
DEPLOY THE APPLICATION AS ROOT CONTEXT ..................................................................................
17
9.
CONFIGURE XA DATASOURCE
.............................................................................................................
18
SECTION II .....................................................................................................................................................
19
10.
CONFIGURE TWO HOST CONTROLLERS ............................................................................................
19
10.1.
Configure two groups. ................................................................................................................
19
11.
CONFIGURE TCP BASED CLUSTERED ENVIRONMENT SETUP. ..........................................................
22
12.
CONFIGURE APACHE BASED LOAD BALANCER. ................................................................................
23
13.
CONFIGURE JMS...............................................................................................................................
26
There would be 2 sections and each section is 50% of marks. You have to achieve 210 Marks out of
300.
CAUTION: User would not be provided with root access. To perform all the activities, jboss account is
given all kind of privileges. NO NEED of using sudo command even to copy apache modules to
/etc/httpd/modules.
CAUTION: After each and every topic, test the configuration question would help you to assist that your
configuration is complete and successful. IF you get the result based on test the configuration, then you
are would be getting cent percent marks for that topic
Section I
Step #1:
Step #3:
$ java jar jboss-eap-installer-6.0.0.GA.jar
Step#4:
Solution:
Step#1:
cp R /opt/ex248/domain server1
Step#2:
Start in background
asecret
NOTE: Delete existing default groups and server instances, which come as pre-built.
http://localhost:9990
Step#2:
Step#3:
Step #1:
$ cd /home/jboss/jboss-eap-6.0/bin
$ ./jboss-cli.sh -c --controller=localhost:9999
[domain@localhost:9999 connector=http] pwd
/profile=default/subsystem=web/connector=http [domain@20.22.205.12:9999
connector=http] :read-resource
}
}
Step #2:
Option #1:
Step#1:
Go to http://localhost:9990/console
Go to Profiles tab and then select default profile as show in below picture snapshot.
Hit on Web Subsystem and hit servlet/Http tab and add ajp connector. Please step which are
shown in diagram.
undefined
}
}
Step #1:
T o add a connector to the web subsystem, it needs to have a socket binding. The socket binding is
added to the socket binding group used by your server or server group. The following steps assume
that your server group is Prod-Group and that your socket binding group is standard-sockets.
[domain@localhost:9999/]/socket-binding-group=standardsockets/socketbinding=ajp:add(port=8009)
[domain@localhost:9999/]/profile=default/subsystem=web/connector= ajp:add(socketbindi
ng=ajp,protoco l="AJP/1.3",enabl ed= true,scheme= "http" )
4. JVM Configuration
Configure JVM at group level. Even if you add additional instances, new JVM settings would get
replicated.
Group_level JVM with heap size
1182m
Perm Gen with size
512m
Stack Size
256k
Option#1:
Setup from Manage Domain Console
CAUTION: You should good hands-on on adding directly to domain.xml file, which might result in XML
parsing exceptions or errors and your domain might not start. ALSO, do take backup before editing it and
then requires restart of domain after changes.
Edit domain.xml
10
INFORMATION:
Go to Runtime tab (top right side of console ) and deploy postgresql.jar driver from
Step#3:
12
13
Step#5: Similarly hit pool tab and set the min-pool to 10 and max-pool to 25.
Step#6: Set Transaction-read-commited
Step#7:
Enter Select * from webDS This sql statement would be given in exam. All you have to do is to copy
and paste and hit the button to test it. You should get result after hitting it.
14
15
16
Step#2:
(or)
It can be done by modifying domain.xml
Search for /profile=default and then search for virtual and change the enable-welcome=true to false.
17
9. Configure XA Datasource
Jndi name: java:jboss/datasources/transactDS
Username:
web
Database:
TrasactDB
Password:
apps
Solution:
Step#1: Go to profile tab and select default profile. Go to connector subsystem and then select
Datasources tab and then hit XA datasources configuration tab.
Name: TransactDS
JndiName:
java:jboss/datasources/transactDS
18
Section II
10.
19
NOTE: All the JBoss instances should get started automatically, as soon as the host-controller
or server is restarted. Manual starting of JBoss instances should be avoided.
Solution:
Step#1: Configure two host controllers.
Step#2: cd /opt/ex248/
Step#3: cp R domain Machine1
Step#4: cp R domain Machine2
Important Step:
Step#5: vi /opt/ex248/Machine1/configuration/domain.xml
Search for full-ha profile and then search for hornet-server, delete the messaging subsystem.
Save and quit.
Step#6: vi /opt/ex248/Machine1/configuration/host.xml
Change#1: Search for name=master and replace with value as host1 . This should be first line in
host.xml
<host name="master" xmlns="urn:jboss:domain:1.3"> Replace as below
</server>
<server name="server-two" group="main-server-group" auto-start="true"> <!-- server-two avoids port conflicts by incrementing
the ports in
20
Change#2: Remove <local/> and un-comment lines related to Master domain controller.
<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}" securityrealm="ManagementRealm"/> -->
</domain-controller>
Above one should look like below
<domain-controller>
<remote host="192.168.7.20" port="9999" security-realm="ManagementRealm"/> </domain-controller>
21
Create two groups Clustered and Mailbox and Clustered group should have Clustered_s1 &
Clustered_s2 Jboss instances. Similarly Mailbox group should have two jboss instances called
mail_s1 and mail_s2.
Step#11:
remove Messaging
NOTE: Make sure you select check box to true, to start the instances automatically.
11.
Most of the cloud vendor do NOT allow UDP communication. In such scenarios we have have to configure
Clustering JBoss JGroups to use TCP instead of UDP.
By default, cluster nodes monitor each other's status using the UDP protocol. Some networks only allow TCP to
be used. In this situation, you can add the TCPPING protocol stack to your configuration and use it as the default
mechanism. These configuration options are available in the command-line based Management CLI.
The mod_cluster subsystem also uses UDP communication by default, and you can choose to use TCP here as
well.
IMPORTANT: Setup Instances on Host/Master Controller itself based on the examination question.
$ cd /opt/ex248/Machine1/configuration $ vi domain.xml
22
9999 /] cd /profile=full-ha/subsystem=jgroups/stack=tcp/protocol=MPING/property
9999/] ./initial_hosts/:add(value="192.168.7.20[7600],192.168.7.21[7600]")
12.
Solution:
Step#1: jboss account is given full access.
$ /etc/httpd/conf/apachectl stop
$ /etc/httpd/conf/apachectl start
$ ps ef | grep httpd
Step #2: Copy mod-cluster modules to /etc/httpd/modules
$ cd /home/student/JB248/opt/jboss-eap-6.0/modules/native/lib64/httpd/modules $ sudo cp *
/etc/httpd/modules ( NOTE: no need of using sudo command )
$ cp * /etc/httpd/modules
Step #3: Perform below changes in httpd.conf (These changes are already completed in exam )
IMPORTANT: IF in Redhat JBoss 248 examination: Setup httpd based loadbalancer and the
said URL should work after examination: http://192.168.0.20/cluster_test
23
Include conf.d/*.conf
</Location>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
EnableMCPMReceive
ServerAdvertise Off This indicates using TCP Protocol
<Location /modcluster-manager> SetHandler mod_cluster-manager Order deny,allow
Deny from all Allow from all
</Location>
</VirtualHost>
24
Once it is done, it will ask for reload. Goahead and restart jboss server instances. Step #5:
Restart Httpd
$ /etc/httpd/bin/apachectl stop $ /etc/httpd/bin/apachectl start
Step#6: Access the mod-cluster manager page.
http://192.168.7.20/modcluster-manager
You should be able to see all the JBoss nodes of full-ha profile.
IMPORTANT: Configure stick session
25
13.
Configure JMS.
Create JMS Connection Factory. Also, make sure, you have deleted existing Connection Factory for
Mailbox group.
NOTE: make sure that connection Factory should be accessible to external users.
Solution:
Step #1: Create Connection Factory
TrasactDS
Connection Factory should be accessible to external users, then it should be netty connector type.
Queue testQueue Create Queue with name as testQueue
ApplicationRealm
$ ./add-user.sh
What type of user do you wish to add?
Management User (mgmt-users.properties)
Application User (application-users.properties) (a): b
Enter the details of the new user to add. Realm (ApplicationRealm) :
Username : jmsClient Password :
Re-enter Password :
What roles do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)
[ ]: tester
About to add user 'jmsClient' for realm 'ApplicationRealm' Is this correct yes/no? yes
Added user 'jmsClient' to file '/opt/ex248/standalone/configuration/application-users.properties' Added user 'jmsClient'
to file '/opt/ex248/domain/configuration/application-users.properties'
Added user 'jmsClient' with roles tester to file '/opt/ex248/standalone/configuration/application-roles.properties' Added
user 'jmsClient' with roles tester to file '/opt/ex248/domain/configuration/application-roles.properties'
$ cp /opt/ex248/domain/configuration/application-roles.properties /opt/ex248/Machine1/domain/configuration $
cp /opt/ex248/domain/configuration/application-users.properties /opt/ex248/Machine1/domain/configuration
$ cp /opt/ex248/domain/configuration/application-roles.properties /opt/ex248/Machine2/domain/configuration $
cp /opt/ex248/domain/configuration/application-users.properties /opt/ex248/Machine2/domain/configuration
26
27
28