https://issues.apache.org/bugzilla/show_bug.cgi?id=47308

           Summary: Cannot join in the cluster membership.
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Cluster
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: fujino.keii...@oss.ntt.co.jp


I use Tomcat6.0.20.

The fix of Revision
757582 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=757582 
)(http://svn.apache.org/viewvc?view=rev&revision=757582)
is applied to Tomcat6.0.20. 
This fix means that Tomcat6.0.20 always disabled LoopbackMode.

Therefore, it is not possible to join in the membership 
when the cluster is composed of two or more Tomcat on the same machine. 

I think that options for loopbackMode is better.

I made patch.

McastService's patch.

Index: java/org/apache/catalina/tribes/membership/McastService.java
===================================================================
--- java/org/apache/catalina/tribes/membership/McastService.java    (revision
763870 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=763870 ))
+++ java/org/apache/catalina/tribes/membership/McastService.java    (working
copy)
@@ -230,6 +230,9 @@
         properties.setProperty("recoverySleepTime",
String.valueOf(recoverySleepTime));
     }

+    public void setLocalLoopbackDisabled(boolean localLoopbackDisabled) {
+        properties.setProperty("localLoopbackDisabled",
String.valueOf(localLoopbackDisabled));
+    }

     /**
      * @deprecated use getPort()
@@ -360,7 +363,8 @@
                                    
java.net.InetAddress.getByName(properties.getProperty("mcastAddress")),
                                     ttl,
                                     soTimeout,
-                                    this);
+                                    this,
+                                   
Boolean.valueOf(properties.getProperty("localLoopbackDisabled","true")).booleanValue());
         String value = properties.getProperty("recoveryEnabled","true");
         boolean recEnabled = Boolean.valueOf(value).booleanValue() ;
         impl.setRecoveryEnabled(recEnabled);        



McastServiceImpl's patch.


Index: java/org/apache/catalina/tribes/membership/McastServiceImpl.java
===================================================================
--- java/org/apache/catalina/tribes/membership/McastServiceImpl.java   
(revision 763870 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=763870 ))
+++ java/org/apache/catalina/tribes/membership/McastServiceImpl.java   
(working copy)
@@ -135,7 +135,13 @@
      * Add the ability to turn on/off recovery
      */
     protected boolean recoveryEnabled = true;
+
     /**
+     * disable/enable local loopback message
+     */
+    protected boolean localLoopbackDisabled = true;
+
+    /**
      * Create a new mcast service impl
      * @param member - the local member
      * @param sendFrequency - the time (ms) in between pings sent out
@@ -144,6 +150,7 @@
      * @param bind - the bind address (not sure this is used yet)
      * @param mcastAddress - the mcast address
      * @param service - the callback service
+     * @param disableLoopbackMode - disable loopbackMode
      * @throws IOException
      */
     public McastServiceImpl(
@@ -155,7 +162,8 @@
         InetAddress mcastAddress,
         int ttl,
         int soTimeout,
-        MembershipListener service)
+        MembershipListener service,
+        boolean localLoopbackDisabled)
     throws IOException {
         this.member = member;
         this.address = mcastAddress;
@@ -166,6 +174,7 @@
         this.timeToExpiration = expireTime;
         this.service = service;
         this.sendFrequency = sendFrequency;
+        this.localLoopbackDisabled = localLoopbackDisabled;
         init();
     }

@@ -199,7 +208,7 @@
         } else {
             socket = new MulticastSocket(port);
         }
-        socket.setLoopbackMode(true); //hint that we don't need loop back
messages
+        socket.setLoopbackMode(localLoopbackDisabled); //hint that we don't
need loop back messages
         if (mcastBindAddress != null) {




And the localLoopbackDisabled attribute is specified for < Membership > of
server.xml. 

example.
<Membership className="org.apache.catalina.tribes.membership.McastService"
     --another attribute-- 
     localLoopbackDisabled="false" />

Regards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to