8 Replies Latest reply: Feb 28, 2012 3:14 AM by Jean-Frederic Clere RSS

Two separated cluster how ?

Maciej Lad Newbie

Hi,

 

I have that problem:

 

I have a 6 box machine.

 

Like this example case:

 

cluster-1-apache

cluster-1-jboss-1

cluster-1-jboss-2

 

cluster-2-apache

cluster-2-jboss-1

cluster-2-jboss-2

 

Ok.
I have a problems because all jboss are visible on all apache...

 

I used in httpd conf AdvertiseGroup, and staring jboss with -u parametr but not work.

 

Mod cluster 1.2.0 Final, Jboss 7.1. Final

 

All machine are this same network and can;t separate network.

( x.x.x.x/255.255.0.0 )

 

 

Please help hot co set up or some tips...

 

If is posible I want use multicast to register jboss in httpd ( no with options to manual configure proxy machine on jboss ).

Manual path work, but to more work for my production case.

  • 1. Re: Two separated cluster how ?
    Radoslav Husar Master

    So this is AS7 clustering question rather than mod_cluster question I suppose. For clustering, just specify different UDP groups for all nodes in the cluster.

  • 2. Re: Two separated cluster how ?
    welsh Newbie

    Hey,

     

    So as Radoslav mentioned, you have 2 issues.

     

    Issue #1: JBoss clusters are all together and need to be seperated:

     

    You should be able to pass the "-g partionOne" to the startup script of cluster 1 and then "-g partitonTwo" to the startup script of cluster 2 to have them seperated. (I know this works for JBoss AS 5.1 and should hopefully work for AS 7.1 or be similiar to it and can test it later to see)

     

    Issue #2: Only allow Apache 1 to see Cluster 1 and only allow Apache 2 to see Cluster 2:

     

    This is also resolvable as Radoslav mentioned, you can specify one UDP group for cluster-1 and one for cluster-2.

     

    Your other alternative to this is to set "advertise" to false in JBoss and then configure the "proxyList" to the correct Apache instance you want that JBoss to look at.

     

    Hope that helps.

     

    - Welsh

  • 3. Re: Two separated cluster how ?
    Maciej Lad Newbie

    Ok

    I setup like this:

     

    cluster-1-apache

     

    <VirtualHost x.x.x.255:80>

            <Directory />
                    Order deny,allow
                    Allow from all
            </Directory>

            KeepAliveTimeout 60
            MaxKeepAliveRequests 0


           AdvertiseFrequency 30
           AdvertiseGroup   224.0.1.106:23366

           LBstatusRecalTime 30

     

          <Location /mod_cluster-manager>
               SetHandler mod_cluster-manager

               Order deny,allow
               Deny from all
               Allow from all
           </Location>

      ErrorLog logs/cluster-error.log
      CustomLog logs/cluster-access.log combined
      LogLevel debug

      EnableMCPMReceive
      AllowDisplay on

    </VirtualHost>

     

    cluster-1-jboss-1

     

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
            <socket-binding name="ajp" port="8009"/>
            <socket-binding name="http" port="8080"/>
            <socket-binding name="https" port="8443"/>
            <socket-binding name="jgroups-diagnostics" port="0" multicast-address="224.0.75.75" multicast-port="7500"/>
            <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
            <socket-binding name="jgroups-tcp" port="7600"/>
            <socket-binding name="jgroups-tcp-fd" port="57600"/>
            <socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
            <socket-binding name="jgroups-udp-fd" port="54200"/>
            <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
            <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
            <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
           <socket-binding name="modcluster" port="0" multicast-address="224.0.1.106" multicast-port="23366"/>
            <socket-binding name="osgi-http" interface="management" port="8090"/>
            <socket-binding name="remoting" port="4447"/>
            <socket-binding name="txn-recovery-environment" port="4712"/>
            <socket-binding name="txn-status-manager" port="4713"/>
            <outbound-socket-binding name="mail-smtp">
                <remote-destination host="localhost" port="25"/>
            </outbound-socket-binding>
        </socket-binding-group>

    cluster-1-jboss-2

     

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
            <socket-binding name="ajp" port="8009"/>
            <socket-binding name="http" port="8080"/>
            <socket-binding name="https" port="8443"/>
            <socket-binding name="jgroups-diagnostics" port="0" multicast-address="224.0.75.75" multicast-port="7500"/>
            <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
            <socket-binding name="jgroups-tcp" port="7600"/>
            <socket-binding name="jgroups-tcp-fd" port="57600"/>
            <socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
            <socket-binding name="jgroups-udp-fd" port="54200"/>
            <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
            <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
            <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
            <socket-binding name="modcluster" port="0" multicast-address="224.0.1.106" multicast-port="23366"/>
            <socket-binding name="osgi-http" interface="management" port="8090"/>
            <socket-binding name="remoting" port="4447"/>
            <socket-binding name="txn-recovery-environment" port="4712"/>
            <socket-binding name="txn-status-manager" port="4713"/>
            <outbound-socket-binding name="mail-smtp">
                <remote-destination host="localhost" port="25"/>
            </outbound-socket-binding>
        </socket-binding-group>

     

    cluster 2 was in default conf.

    <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>

     

    But in cluster 1 i see jboss from cluster2

  • 4. Re: Two separated cluster how ?
    Jean-Frederic Clere Master

    you have 2 different httpd so you should use 2 different secret AdvertiseSecurityKey / advertiseSecurityKey) the nodes of each cluster will see only one httpd, so you have 2 independant clusters.

  • 5. Re: Two separated cluster how ?
    Maciej Lad Newbie

    Hi,

    I re-setup my httpd. But in this proxy all jboss was re-registered not dedicated.

    Now is:

     

    <VirtualHost x.x.x.255:80>

            <Directory />
                    Order deny,allow
                    Allow from all
            </Directory>

            KeepAliveTimeout 60
            MaxKeepAliveRequests 0

            ServerAdvertise On
            AdvertiseFrequency 30
            AdvertiseGroupAddress   224.0.1.106
            AdvertisePort 23366
            AdvertiseSecurityKey cluster-1
            AdvertiseBindAddress x.x.x.255

            EnableMCPMReceive

           LBstatusRecalTime 30

     

          <Location /mod_cluster-manager>
               SetHandler mod_cluster-manager

               Order deny,allow
               Deny from all
               Allow from all
           </Location>

      ErrorLog logs/cluster-error.log
      CustomLog logs/cluster-access.log combined
      LogLevel debug

      AllowDisplay on

    </VirtualHost>

    but I have some questions:

    1) U setup security hey in httpd, but i don't know how to do it in jboss AS 7.1 - could you give me a tip ?

    2) What is good syntach for AdvertiseGroup*

    like this:

    http://docs.jboss.org/mod_cluster/1.2.0/html/native.config.html#mod_advertise

     

    AdvertiseGroup IP:port: That is the multicast address to use (something like 232.0.0.2:8888 for example). IP should correspond to AdvertiseGroupAddress and port to AdvertisePort in the JBoss AS/JBossWeb/Tomcat configuration. Note that if JBoss AS is used and the -u startup switch is included in the AS startup command, the default AdvertiseGroupAddress is the value passed via the -u. If port is missing the default port will be used: 23364.

    Default: 224.0.1.105:23364.

     

    OR this:

     

    http://docs.jboss.org/mod_cluster/1.2.0/html/java.properties.html

    point 9.1

    advertiseGroupAddress224.0.1.105Apache HTTPD

    UDP address on which to listen for httpd proxy multicast advertisements

    advertisePort23364Apache HTTPD

    UDP port on which to listen for httpd proxy multicast advertisements

    Whitch are good for 1.2.0 ?

  • 6. Re: Two separated cluster how ?
    Jean-Frederic Clere Master

    1) advertise-security-key in AS7.

    2) one is the httpd directive the other the JBoss property to set, they must fit each other.

  • 7. Re: Two separated cluster how ?
    Maciej Lad Newbie

    1) Ok I found but I dont know how to set up from CLI ( meybe by add-value ) ?

    2) Ok thanks

    3) I setup on httpd security key, and advertisegroup, restart httpd and all jboss re-registered.

    Changes was apply _AFTER_ reload a jboss ( one by one ) ( un-registered not allowed machines for this cluster ) this is a bug ?

    Restart httpd is not sufficient for this modification in httpd conf to work and automate unregistered/notaccepted not allowed jboss?

  • 8. Re: Two separated cluster how ?
    Jean-Frederic Clere Master

    1) Something like:

    /subsystem=modcluster/mod-cluster-config=configuration:write-attribute(name=advertise-security-key, value=secret)

     

    3) you need to restart both jbossweb and httpd.