Version 15

    The details of why following commands are done is beyond the scope of this wiki but a good starting point is the wiki http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroupsWiresharkExample. Here are configurations you need to do be able to run two node JBoss AS cluster in fedora box. You need to be root user to run these commands.

     

    Add two IP addresses to the same NIC.

     

      root@localhost bin]# /sbin/ifconfig eth0:1 192.168.148.143
      root@localhost bin]# /sbin/ifconfig eth0:2 192.168.148.144
    

    Add these commands in /etc/rc.local if you want these to survive reboot

    Let all udp messages through

     

    /sbin/iptables -I RH-Firewall-1-INPUT 5 -p udp -d 224.0.0.0/4 -j ACCEPT
    

     

    Enable UDP point to point message

     

    /sbin/iptables -I RH-Firewall-1-INPUT 9 -p udp -s 192.168.148.0/24 -j ACCEPT
    

     

    Enable TCP  message

     

    /sbin/iptables -I RH-Firewall-1-INPUT 10 -p tcp -s 192.168.148.0/24 -j ACCEPT
    

     

    Make sure it survives reboot

     

    /etc/init.d/iptables save
    

     

    You should see a confirmation message:

     

    iptables: Saving firewall rules to /etc/sysconfig/iptables:[OK|  OK  ]

     

     

    Your ip table should look more or less like this

    [root@localhost prabhat]# /sbin/iptables -L -n -v
    Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
     pkts bytes target     prot opt in     out     source               destination        
    47705   34M RH-Firewall-1-INPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0          
    
    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
     pkts bytes target     prot opt in     out     source               destination        
        0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
    
    Chain OUTPUT (policy ACCEPT 48822 packets, 17M bytes)
     pkts bytes target     prot opt in     out     source               destination        
    
    Chain RH-Firewall-1-INPUT (1 references)
     pkts bytes target     prot opt in     out     source               destination        
    10534   11M ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0          
       11   924 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 255
        0     0 ACCEPT     esp  --  *      *       0.0.0.0/0            0.0.0.0/0          
        0     0 ACCEPT     ah   --  *      *       0.0.0.0/0            0.0.0.0/0          
        0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.0/4        
      482 70505 ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.251         udp dpt:5353
      327 65727 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:631
        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:631
        0     0 ACCEPT     udp  --  *      *       192.168.148.0/24     0.0.0.0/0          
        0     0 ACCEPT     tcp  --  *      *       192.168.148.0/24     0.0.0.0/0          
    35669   22M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
      682 85394 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 
    
    

     

    Verify that jgroups work

    • Get jgroups.jar. You can find this jar in JBossAS/server/all/lib as well as many other places.

    • Open a shell (A) and run

    [prabhat@localhost lib]$ java -cp jgroups.jar org.jgroups.tests.McastReceiverTest -bind_addr 192.168.148.143 -mcast_addr 224.10.10.10 -port 5555
    

     

    • open another shell(B) and run

    java -cp jgroups.jar org.jgroups.tests.McastSenderTest -bind_addr 192.168.148.144 -mcast_addr 224.10.10.10 -port 5555
    

     

    At prompt, enter some texts for example: prabhat . You should see the message in shell A. Now you can use your laptop to test

      • session replication

      • fail over

      • apache load balancing etc

     

     

     

    Many thanks go to Richard Achmatowicz !!