Connector
|
Supports
Sticky Sessions
|
Adapts
to Deployment Status
|
Yes
|
Yes. Detects deployment and
undeployment of applications and dynamically decides whether to direct client
requests to a server based on whether the application is deployed on that
server.
|
|
Yes
|
No. Directs client requests to the
container as long as the container is available, regardless of application
status.
|
|
Yes
|
No. Directs client requests to the
container as long as the container is available, regardless of application
status.
|
|
Yes
|
No. Directs client requests to the
container as long as the container is available, regardless of application
status.
|
|
Yes
|
No. Directs client requests to the
container as long as the container is available, regardless of application
status.
|
**Software
Details:**
(1) Jboss-as-7.1.1.Final- (JBoss Community Based)
(2) Apache HTTPServer 2.4.33 - WINDOWS
**Apache
level Configuration:**
Step 1: Download mod_jk.so module for Apache 2.4.33 from link.
Step 2: load the mod_jk module on \httpd-2.4.33-Win64\Apache24\modules location.
Screenshot :
Step 3: Create a new file called mod_jk.conf on desired location and add the below configuration.
######################################################################
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile D:\httpd-2.4.33-Win64\Apache24\conf\extra\MODJK\workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel debug
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE
#JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
# Mount your applications
JkMount /* loadbalancer
###################
# Use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker
# /examples/*=loadbalancer
#JkMountFile D:\httpd-2.4.33- Win64\Apache24\conf\extra\MODJK\uriworkermap.properties
##############
# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile D:\httpd-2.4.33-Win64\Apache24\logs\jk.shm
###############################################################
Or use below link for reference https://access.redhat.com/documentation/
Step 4: Create a new
file called workers.properties on desired location add below configuration.& provide its location on mod_jk.conf file.
##############################################################
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=192.168.XXX.XXX
worker.node1.type=ajp13
worker.node1.ping_mode=A
worker.node1.lbfactor=1
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8019
worker.node2.host=192.168.XXX.XXX
worker.node2.type=ajp13
worker.node2.ping_mode=A
worker.node2.lbfactor=1
# Load-balancing behavior
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
###############################################################
Screenshot
Step 5: (OPTIONAL) Create a new file called uriworkermap.properties on desired location and add below configuration.
###############################################################
# Simple worker configuration file
/*=loadbalancer
###############################################################
Step 6: Add the JkMount
application URls to httpd.conf &
httpd-ssl.conf (Inside Virtualhost tag).
######################################################
JkMount /* loadbalancer
######################################################
Screenshot:
Step 7 : Include
the mod_jk.conf file location in
httpd.conf file.
#################################################
Include D:\httpd-2.4.33-Win64\Apache24\conf\extra\MODJK\*.conf
#################################################
Screenshot:
NOTE:
The JkMount
directive specifies which URLs Apache HTTP Server must forward to the mod_jk
module.To
serve static content directly and only use the
load balancer for Java applications, the URL path must be JkMount /application/* [Worker.list name]
To
use mod_jk as a load balancer, use the value /*, to forward
all URLs to mod_jk.
JkMount /* [Worker.list name]
**JBoss level Configuration:**
Step 1: Add the the
AJP connector tag if not present in the standalone.xml file or uncomment it .
<connector name="ajp" protocol="AJP/1.3" scheme="http" socket- binding="ajp"/>
Screenshot:
Step 2: Also check the socket-binding port.
<socket-binding name="ajp" port="8009"/>
Screenshot:
Step 3 : Add the system-properties to provide the jvmRoute and value.
<system-properties>
<property name="jvmRoute" value="node1"/>
</system-properties>
Screenshot:
**Application –status:**
1: Check the application:
Screenshot:
2: Check
the mod-jk.log after Loglevel debug.
Now, single application equally routing the to node1 & node2 through LB for both JBoss JVM
Screenshot:
Note: Enable mod_status module
####################################################
<Location "/jkstatus">
Order deny,allow
Deny from all
Allow from localhost 192.168.XXX.XXX
</Location>
####################################################
Step 2: Edit workers.properties file and add (status) on worker & worker.list
## Status worker for managing load balancer
worker.status.type=status
# #Define list of workers that will be used
# #for mapping requests
worker.list=loadbalancer,status
Step 3: Use https://192.168.XXX.XXX/jkstatus/
mod jk troubleshooting pdf :
https://access.redhat.com/sites/mod_jk_troubleshooting_1.pdf
https://access.redhat.com/doc
Reference link:
https://stackoverflow.com/questions/30795503/jboss-eap-6-3-http
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/
No comments:
Post a Comment