Background:
- I have a web app, spring-based.
- locally on a dev machine I have 2 tomcat instances that runs same app - that way I test how web farm nodes communicates to each other
- I use Jelastic cloud for app deployment
- On Jelastic It's not running as a web-farm, but rolling update mechanism is used (while
AppV1
is running atNodeA
and handling user requsts I startAppV2@NodeB
, warm it up and redirect user requests to it. Goal is to letNodeB
copy all sessions fromNodeA
)
Intention
- Current release version is using 3rd server based on NodeJS as a shortcut to MessageBus between nodes. But recently I spotted Ignite and thought it would be great to decrease number of platforms (nodejs) and get just everything in Java.
- So I replaced NodeJS-based messaging with Ignite messaging. Ignite is initialized using Spring XML config and
org.apache.ignite.IgniteSpringBean
- When running my app locally with
TcpDiscoveryMulticastIpFinder
it works perfectly.NodeA
starts even if there is noNodeB
started. When I startNodeB
it smoothly joins cluster and nodes are connected to each other and communicating perfectly. Most important thing here is that I can start and stop nodes any time and I have non-blocking error-free operation using Ignite messaging.
Issue
- But on Jelastic I don't have multicast, so I have to explicitly define list of IP addresses (use
TcpDiscoveryVmIpFinder
), which is ok - I have kind of static host names for each node. BUT now whenNodeA
starts it blocks until it connects toNodeB
. And ifNodeB
is not there whole app crash (failes to deploy).
Question is How to make it work in scenario
TcpDiscoveryVmIpFinder
is usedNodeA
starts (whileNodeB
is not started)- Expectation:
NodeA
operates any amount of time correctly (of course I can't send messages to remotes, because there are no remotes connected - that is ok) - At any time
NodeB
starts - Expectation:
NodeA
andNodeB
find each other and communicate to each other (basically for sessions replication and other messages) NodeA
stopped- Expectation:
NodeB
continues to operate normally serving user requests - Now switch:
NodeA
becomesNodeB
and vice versa; repeat from step 3