2 Replies Latest reply on Nov 19, 2005 12:31 AM by chaitanya

    doubts regarding clustering in jboss

    chaitanya Novice


      i am setting up clustering in jboss-4.0.3 in my system;

      i created two nodes namely node1 and node2 as u see below;to get loadbalancing done i am using apache 2.0;

      C:\jboss-4.0.3\server
      all
      default
      minimal
      node1(copy of all instance)
      node2(another copy of all instance)


      i followed this url http://www.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss;


      i have some doubts regarding clustering;

      1.How do i ensure that these nodes are in Cluster?

      2.How do i ensure that loadbalancing is working correctly between nodes?

      3.If i deploy EAR in C:\jboss\server\node1\farm directory

      http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFarmDeployment


      Second node is not pulling up the EAR i deployed in node1?




      my workers.properties(apache2/conf)

      # Define list of workers that will be used
      # for mapping requests
      worker.list=load_lb,status

      # Define Node1
      # modify the host as your host IP or DNS name.
      worker.node1.port=18009
      worker.node1.host=213.24.48.114---------- my localsystem IP
      worker.node1.type=ajp13
      worker.node1.lbfactor=1
      #worker.node1.local_worker=1 (1)
      worker.node1.cachesize=10

      # Define Node2
      # modify the host as your host IP or DNS name.
      worker.node2.port=18010
      worker.node2.host= 213.24.48.114--------- my localsystem IP
      worker.node2.type=ajp13
      worker.node2.lbfactor=1
      #worker.node2.local_worker=1 (1)
      worker.node2.cachesize=10

      # Load-balancing behaviour
      worker.load_lb.type=lb
      worker.load_lb.balance_workers=node1,node2
      worker.load_lb.sticky_session=1
      #worker.load_lb.local_worker_only=1
      #worker.list=load_lb

      # Status worker for managing load balancer
      worker.status.type=status


      mod-jk.conf
      **********

      # 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 conf/workers.properties

      # Where to put jk logs
      JkLogFile logs/mod_jk.log

      # Set the jk log level [debug/error/info]
      JkLogLevel info

      # 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 /transport/* load_lb

      # You can 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 conf/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 logs/jk.shm

      # Add jkstatus for managing runtime data
      <Location /jkstatus/>
      JkMount status
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1


      uriworkermap.properties
      *********************


      # Simple worker configuration file
      #

      # Mount the Servlet context to the ajp13 worker
      /transport=load_lb
      /transport/*=load_lb


      jboss/server/node1/deploy/cluster-service.xml
      ******************************************


      what is "mcast_addr" shoud i give?





      <!-- Name of the partition being built -->
      ${jboss.partition.name:DefaultPartition}

      <!-- The address used to determine the node name -->
      ${jboss.bind.address}

      <!-- Determine if deadlock detection is enabled -->
      False

      <!-- Max time (in ms) to wait for state transfer to complete. Increase for large states -->
      30000

      <!-- The JGroups protocol configuration -->

      <!--
      The default UDP stack:
      - If you have a multihomed machine, set the UDP protocol's bind_addr attribute to the
      appropriate NIC IP address, e.g bind_addr="192.168.0.2".
      - On Windows machines, because of the media sense feature being broken with multicast
      (even after disabling media sense) set the UDP protocol's loopback attribute to true
      -->

      <UDP mcast_addr="${jboss.partition.udpGroup:228.1.2.3}" mcast_port="45566"
      ip_ttl="8" ip_mcast="true"
      mcast_send_buf_size="800000" mcast_recv_buf_size="150000"
      ucast_send_buf_size="800000" ucast_recv_buf_size="150000"
      loopback="false"/>
      <PING timeout="2000" num_initial_members="3"
      up_thread="true" down_thread="true"/>
      <MERGE2 min_interval="10000" max_interval="20000"/>
      <FD shun="true" up_thread="true" down_thread="true"
      timeout="2500" max_tries="5"/>
      <VERIFY_SUSPECT timeout="3000" num_msgs="3"
      up_thread="true" down_thread="true"/>
      <pbcast.NAKACK gc_lag="50" retransmit_timeout="300,600,1200,2400,4800"
      max_xmit_size="8192"
      up_thread="true" down_thread="true"/>
      <UNICAST timeout="300,600,1200,2400,4800" window_size="100" min_threshold="10"
      down_thread="true"/>
      <pbcast.STABLE desired_avg_gossip="20000"
      up_thread="true" down_thread="true"/>
      <FRAG frag_size="8192"
      down_thread="true" up_thread="true"/>
      <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
      shun="true" print_local_addr="true"/>
      <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>


      <!-- Alternate TCP stack: customize it for your environment, change bind_addr and initial_hosts -->
      <!--

      <TCP bind_addr="thishost" start_port="7800" loopback="true"/>
      <TCPPING initial_hosts="thishost[7800],otherhost[7800]" port_range="3" timeout="3500"
      num_initial_members="3" up_thread="true" down_thread="true"/>
      <MERGE2 min_interval="5000" max_interval="10000"/>
      <FD shun="true" timeout="2500" max_tries="5" up_thread="true" down_thread="true" />
      <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false" />
      <pbcast.NAKACK down_thread="true" up_thread="true" gc_lag="100"
      retransmit_timeout="3000"/>
      <pbcast.STABLE desired_avg_gossip="20000" down_thread="false" up_thread="false" />
      <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="false"
      print_local_addr="true" down_thread="true" up_thread="true"/>
      <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>

      -->

      jboss:service=Naming



      jboss-4.0.3/server/node1/deploy/tc5-cluster-service.xml
      ******************************************

      Should i change anything in this xml??




      jboss:service=Naming
      jboss:service=TransactionManager

      <!-- Configure the TransactionManager -->
      org.jboss.cache.JBossTransactionManagerLookup

      <!--
      Isolation level : SERIALIZABLE
      REPEATABLE_READ (default)
      READ_COMMITTED
      READ_UNCOMMITTED
      NONE
      -->
      REPEATABLE_READ

      <!--
      Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC
      -->
      REPL_ASYNC

      <!-- Name of cluster. Needs to be the same for all clusters, in order
      to find each other
      -->
      Tomcat-Cluster

      <!-- JGroups protocol stack properties. Can also be a URL,
      e.g. file:/home/bela/default.xml

      -->


      <!--
      The default UDP stack:
      - If you have a multihomed machine, set the UDP protocol's bind_addr attribute to the
      appropriate NIC IP address, e.g bind_addr="192.168.0.2".
      - On Windows machines, because of the media sense feature being broken with multicast
      (even after disabling media sense) set the UDP protocol's loopback attribute to true
      -->

      <UDP mcast_addr="${jboss.partition.udpGroup:230.1.2.7}" mcast_port="45577"
      ip_ttl="8" ip_mcast="true"
      mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
      ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
      loopback="false"/>
      <PING timeout="2000" num_initial_members="3"
      up_thread="false" down_thread="false"/>
      <MERGE2 min_interval="10000" max_interval="20000"/>
      <FD_SOCK/>
      <VERIFY_SUSPECT timeout="1500"
      up_thread="false" down_thread="false"/>
      <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
      max_xmit_size="8192" up_thread="false" down_thread="false"/>
      <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
      down_thread="false"/>
      <pbcast.STABLE desired_avg_gossip="20000"
      up_thread="false" down_thread="false"/>
      <FRAG frag_size="8192"
      down_thread="false" up_thread="false"/>
      <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
      shun="true" print_local_addr="true"/>
      <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>


      <!-- Alternate TCP stack: customize it for your environment, change bind_addr and initial_hosts -->
      <!--

      <TCP bind_addr="thishost" start_port="7810" loopback="true"/>
      <TCPPING initial_hosts="thishost[7810],otherhost[7810]" port_range="3" timeout="3500"
      num_initial_members="3" up_thread="true" down_thread="true"/>
      <MERGE2 min_interval="5000" max_interval="10000"/>
      <FD shun="true" timeout="2500" max_tries="5" up_thread="true" down_thread="true" />
      <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false" />
      <pbcast.NAKACK down_thread="true" up_thread="true" gc_lag="100"
      retransmit_timeout="3000"/>
      <pbcast.STABLE desired_avg_gossip="20000" down_thread="false" up_thread="false" />
      <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="false"
      print_local_addr="true" down_thread="true" up_thread="true"/>
      <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>

      -->



      <!-- Max number of milliseconds to wait for a lock acquisition -->
      15000






        • 1. Re: doubts regarding clustering in jboss
          Jerry Gauthier Apprentice

          1. If you're running copies of the "all" configuration on the same network, the copies will be clustered (along with "all" if you're using it). The software and configuration files included in the "all" configuration are cluster enabled by default. You don't need to do anything to "enable" the cluster.

          2. To test session load balancing, open sessions on the Apache url. One simple test is to just access the JBoss JMX Console from a new browser session. If you've configured mod_jk for round robin balancing, the console should alternate from one node to the other.

          3. In general, the service should work. If you deploy an ear to the farm directory in node1, it should be copied to the farm directory in node 2. However there are some unresolved problems with farming so it may not be working in your situation.

          4. You shouldn't need to change the multicast address and port for your JBoss clusters. If you do change them, you need to make the same changes on all nodes in the cluster. Note that the JBoss "all" configuration provides two distinct cluster configurations - one is defined in cluster-service.xml and provides core clustering services. The other is defined in tc5-cluster-service.xml and provides session replication. These clusters are independent and require separate multicast addresses and ports.

          Jerry

          • 2. Re: doubts regarding clustering in jboss
            chaitanya Novice

             

            "JerryGauth" wrote:
            1. If you're running copies of the "all" configuration on the same network, the copies will be clustered (along with "all" if you're using it). The software and configuration files included in the "all" configuration are cluster enabled by default. You don't need to do anything to "enable" the cluster.

            2. To test session load balancing, open sessions on the Apache url. One simple test is to just access the JBoss JMX Console from a new browser session. If you've configured mod_jk for round robin balancing, the console should alternate from one node to the other.

            3. In general, the service should work. If you deploy an ear to the farm directory in node1, it should be copied to the farm directory in node 2. However there are some unresolved problems with farming so it may not be working in your situation.

            4. You shouldn't need to change the multicast address and port for your JBoss clusters. If you do change them, you need to make the same changes on all nodes in the cluster. Note that the JBoss "all" configuration provides two distinct cluster configurations - one is defined in cluster-service.xml and provides core clustering services. The other is defined in tc5-cluster-service.xml and provides session replication. These clusters are independent and require separate multicast addresses and ports.

            Jerry



            i enabled clustering on two nodes;state replication and load balancing is happening correctly;farm deployemnt is also working perfectly;

            i have one doubt;

            in two nodes i deployed two ears;
            now how workers.properties,uriworkermap.properties,mod-jk.conf should look like;