JPPF Forums

JPPF Help => Installation and Configuration => Topic started by: jerome_tan on June 14, 2011, 10:03:46 AM

Title: deployment question on multi server in different network section
Post by: jerome_tan on June 14, 2011, 10:03:46 AM
We are investigating in JPPF framework to build a grid computing, we met a question in deploying multi server in different network section, the server strucuture is:
One client on 192.168.102.145
Two servers: server A --> 192.168.102.145; server B --> 192.168.100.250
Two nodes: node A --> 192.168.102.145; node B --> 192.168.100.250

We connect two servers use driver config:
jppf.peers = server_1 server_2
 
# connection to server_1
jppf.peer.server_1.server.host = 192.168.102.145
class.peer.server_1.server.port = 11111
node.peer.server_1.server.port = 11113
 
# connection to server_2
jppf.peer.server_2.server.host = 192.168.100.250
class.peer.server_2.server.port = 11111
node.peer.server_2.server.port = 11113

and turned "jppf.peer.discovery.enabled = false"

When the two server are live, the system runs properly, but when server B shut down, node B can not find server A automatically.

How can I let node B find server A automatically when server B is down?

Thanks,
Jerome.
Title: Re: deployment question on multi server in different network section
Post by: lolo on June 15, 2011, 10:26:48 AM
Hello Jerome,

Unfortunately, what you want to achieve cannot be done with just a static configuration.
However, there is an approach that will allow you to do it by dynamically modifying the JPPF node configuration when it is disconnected from a driver.
The idea is to implement a node lfe cycle listener (http://www.jppf.org/wiki/index.php?title=Receiving_notifications_of_node_life_cycle_events) which, when receiving a node disconnection event, will change the server connection properties so that the node will connect to another server.
Basically, the goal is to setup a different server connection configuration between the time the node is disconnected and the time when it attempts to recdonnect.
I have implemented a working sample, which you can download here: http://www.jppf.org/private/NodeConnectionListener.zip (http://www.jppf.org/private/NodeConnectionListener.zip)
The file contains a Readme.txt with instructions on how to use it.

Can you give it a try and let us know if this resolves the problem?

Thanks,
-Laurent
Title: Re: deployment question on multi server in different network section
Post by: jerome_tan on June 16, 2011, 09:25:16 AM
Hi lolo,

Thank you very much! It works! :) But there is a little problem, the node should implement a listener/interface to be aware of that a new server joined the server pool. Since JPPF2.5 involve HazelCast in, it is a pretty good distributed memory system in terms of performance and stability without master node, and considering in most production env, it is required that servers and nodes are dynamic pool, are we able to implement the dynamic add/remove server/node by HazelCast?
Title: Re: deployment question on multi server in different network section
Post by: lolo on June 20, 2011, 09:03:37 AM
Hi Jerome,

Thank you for the suggestion. I reworked the sample to make it use Hazelcast for dynamic server discovery, instead of using a static configuration. This should work with any number of JPPF server and nodes.
Basically, I added a server startup class (http://www.jppf.org/wiki/index.php?title=JPPF_startup_classes#Server_startup_classes) that causes each server to store its connection information in a Hazelcast distributed map, and the nodes now listen to this map to find the servers.
I uploaded the new version at http://www.jppf.org/private/NodeConnectionListener.zip (http://www.jppf.org/private/NodeConnectionListener.zip).

Let us know if this works for you.

Sincerely,
-Laurent
Title: Re: deployment question on multi server in different network section
Post by: jerome_tan on June 24, 2011, 10:00:31 AM
It's great, thank you a lot!