title: How to change broadcasted ip in tomcat cluster
body: <p>I set up a tomcat 7 cluster by including the -part in the server.xml.
  In the Docs ( <a href="http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html" rel="nofollow">http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html</a> ) it says:</p>
  
  <blockquote>
    <p>The IP broadcasted is java.net.InetAddress.getLocalHost().getHostAddress() (make sure you don't broadcast 127.0.0.1, this is a common error)</p>
  </blockquote>
  
  <p>Unfortunately getLocalHost().getHostAddress() return 127.0.1.1 for all my virtual machines (Ubuntu run in Virtual Box under Win7) instead of the correct ip that I can reach the vm's with, ie 10.42.29.191.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Is there a way to tell tomcat what ip to send to other members of the cluster via the multicast? Or can I specify (e.g. code) a different way to obtain the ip?</p>
  
  <p><strong>Additional info:</strong></p>
  
  <p>My cluster seems to fail session replication and above "error" could be the cause of it. Glassfish doesn't do session replication either, maybe it's the same error. If you could give information for glassfish configuration regarding this I'd be glad too. The multicast between virtual machines works according to the tool iperf.</p>