Issue:
When creating an object, e.g., an organization, using rest_v2 ehcache does not get updated across the cluster.
Resolution:
First IP Multicast must be enabled on each server in the cluster. The configuration is different for the two main Linux flavors.
Ubuntu:
Add or uncomment the following lines in /etc/sysctl.conf.
net.ipv4.icmp_echo_ignore_broadcasts=false net.ipv4.ip_forward=1
Lookup the network device used for the multicast traffic by typing ifconfig.
You’ll get a list of devices with their names on the left. Typically eth[0-9], e.g., eth0. Remember the name of the device you’ll want to use it in the next step.
Add this line to /etc/network/interfaces.
up route add -net 224.0.0.0/4 mask 240.0.0.0 dev eth[0-9]
Reboot the servers.
Fedora:
Add or uncomment the following lines in /etc/sysctl.conf.
net.ipv4.icmp_echo_ignore_broadcasts=0 net.ipv4.ip_forward=1
Lookup the network device used for the multicast traffic by typing ifconfig.
You’ll get a list of devices with their names on the left. Typically eth[0-9], e.g., eth0. Remember the name of the device, you’ll use it in the next step.
Create or edit the file /etc/sysconfig/network-scripts/route-eth[0-9] on each server and add the following lines.
GATEWAY0=0.0.0.0 NETMASK0=240.0.0.0 ADDRESS0=224.0.0.0
If there is already a "0" appended to the configuration as above then append "1" to the elements.
Reboot the servers.
To test the network settings:
Type "cat /proc/sys/net/ipv4/ip_forward." This must return 1.
Type "cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts." This should return 0.
Type "ping 224.0.0.1 | grep <IP address of other server in cluster>". You should see the IP address.
Modify ehcache configuration files:
Add the "hostname" property to the cacheManagerPeerProviderFactory and cacheManagerPeerListenerFactory beans in the following files:
- WEB-INF/ehcache.xml
- WEB-INF/ehcache_hibernate.xml
- WEB-INF/classes/ehcache_hibernate.xml
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" properties="hostName=172.17.10.124,peerDiscovery=automatic, multicastGroupAddress=228.0.0.1, multicastGroupPort=4446, timeToLive=1"/> <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="hostName=172.17.10.124,port=40011,remoteObjectPort=40012,socketTimeoutMillis=120000"/>
http://172.17.10.125:8080/jasperserver-pro-561/rest_v2/organizations/testorg1/roles
Recommended Comments
There are no comments to display.