Cluster router load blancer


What is the purpose?

Group of independent servers (usually in close proximity to one another) interconnected through a dedicated network to work as one centralized data processing resource. Clusters are capable of performing multiple complex instructions by distributing workload across all connected servers. Clustering improves the system's availability to users, its aggregate performance, and overall tolerance to faults and component failures. A failed server is automatically shut down and its users are switched instantly to the other servers.

How to do?
1>download httpd-2.2.22-win32-x86-openssl-0.9.8t.msi from internet
2>install this software
3>then give domain name and server name (either ip address or localhost)
4>give the path where you install like (C:\Apache2.2)
5>Open httpd.conf from this folder like (C:\Apache2.2\conf) and change port number in Listen 9999
6>after that run appache server
7>open this url like www.localhost:9999 then see that's it works!
8>so you think that your install is fine.
9>After install open httpd.conf
And add bellow code at last postion
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount /MPOS_WEBSERVER loadbalancer
JkMount /* loadbalancer
JkMount  /status  stat
where MPOS_WEBSERVER is project name
10>workers.properties pest in where httpd.conf is generated
11>workers.properties
worker.list=node1,node2,loadbalancer,stat
#worker.list=node1,loadbalancer,stat
worker.node1.port=8310
worker.node1.host=172.30.70.39
#worker.node1.host=localhost
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node2.port=8309
#worker.node2.host=172.30.66.55
worker.node2.host=172.30.70.22
worker.node2.type=ajp13
worker.node2.lbfactor=2
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=node1,node2
#worker.loadbalancer.balanced_workers=node1
#worker.loadbalancer.balance_workers=node1, node2
#worker.loadbalancer.sticky_session=1
worker.stat.type=status
#worker.lb.stickysessions=true
12>mod_jk.so pest in C:\Apache2.2\modules
13>open server.xml file in both place where you mention host name
14><Engine name="Catalina" defaultHost="localhost" jvmRoute="node1"> for first IP address
15> <Engine name="Catalina" defaultHost="localhost" jvmRoute="node2"> for second IP address
16>after that add both place
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8">
<Manager  className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>

<Channel className="org.apache.catalina.tribes.group.GroupChannel">
<Membership className="org.apache.catalina.tribes.membership.McastService"
address="228.0.0.4"
port="45564"
frequency="500"
dropTime="3000"/>
<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
</Sender>

<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="auto"
port="4000"
autoBind="100"
selectorTimeout="5000"
maxThreads="6"/>

<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>

<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>

</Channel>

<Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/>

<Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

<ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>

<ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

</Cluster>
18>now it was work fine
N.B:
LoadModule - this command makes the mod_jk module available for use. The extension of the module itself will vary by operating system.
JkWorkersFile - sets the path to the worker configuration file, which we will create in the next step.
JkShmFile - sets the path to the shared memory files for the module. Generally, you'll want to keep this with the logs.
JkLogFile - sets the path to the module log file.
JkLogLevel - sets the level of logging for the module. The valid values for this attribute, in descending order by verbosity, are "debug", "error" or "info".
JkMount - this is used to map a certain URL pattern to a specific worker configured in the worker configuration file. Here, we use it twice - once to enable /jkmanager as the access URL for jkstatus, a virtual monitoring worker, and once to map all requests we want to be handled by the cluster to the "lb" worker, a virtual worker that contains the load balancing capability
Location - this is a security constraint. The settings we have included allow access to the jkmanager only from the localhost

Example:




Previous
Next Post »