You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by "viola.lu" <vi...@gmail.com> on 2010/06/02 07:58:03 UTC
Multipoint URI
As we know, we can access ejb members with multicast URI:
multicast://239.255.3.2:6142?group=cluster1
Now i have serveral multipoint members: NODE1, NODE2, Node3,
if i want to acess ejb members with multipoint URI, this URI format is?
Thanks a lot!
--
View this message in context: http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2239616.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: Multipoint URI
Posted by Ivan <xh...@gmail.com>.
I think in the doc, we should also reminder the user to configure
openejb.client.requestretry property with true, or in the failover process,
users will get an IOException in the first time call, as the bad connection
is cached in the pool, and it seems that we have no way to know it until
trying to read something from it.
2010/6/11 David Blevins <da...@visi.com>
>
> On Jun 9, 2010, at 2:59 AM, viola.lu wrote:
>
> > The doc is clear for end-users to understand. thanks. But I have one
> > question about multipoint failover.
> > There are three servers:server 1. server 2, server 3, now i add server 2
> as
> > server 1 initial multipoint servers, server 3 as server 2 inital
> multipoint
> > servers, an openejb client call server 1 using:
> > failover:ejbd://[server 1]:4201( here i don't need add all servers to
> > openejb client provider url, right?)
> > then i shutdown server 1, openejb client should still work coz server 1
> will
> > failover to server 2, and if i shutdown server 2, then server 2 will
> > failover to server 3. This is the specific multipoint failover scenario,
> am
> > i right?
>
> If I understand correctly, then right on all points.
>
> To recap for possible doc benefit, sounds like this is the setup.
>
> client -> server1 -> server2 -> server3
>
> That should definitely work, but the start order would have to be the exact
> opposite:
>
> server3, server2, server1, client
>
> And the overall outcome would be:
>
> server3 starts
> server2 starts
> - static: connect to server3
> server1 starts
> - static: connect to server2
> - dynamic: connect to server3
>
> At this point all nodes are connected.
>
> And then when the client comes online and connects to server1, it will be
> sent the following dynamic list [server1, server2, server3]. That list is
> versioned and will be dynamically updated in future responses from the
> server if other servers join/leave the network.
>
> Once the dynamic list is obtained, the original
> "failover:ejbd://server1:4201" URL initially used by the client is no longer
> consulted and the dynamically obtained list is preferred for all failover
> situations. This is built right into the ejbd protocol and is the same for
> multipoint(TCP) or multicast(UDP).
>
> Any method of connecting to a server will work -- "ejbd://server1:4201",
> "failover:ejbd://server1:4201,ejbd://server2:4201", or "multicast://
> 239.255.2.3:6142". Upon first connect, the dynamic list is exchanged and
> that original URL is ignored. Note for that reason using
> "failover:ejbd://server1:4201" and "ejbd://server1:4201" is essentially the
> same thing.
>
> Should a situation arise where the client cannot connect to any of the
> servers in the dynamic list, then the original URL is used one more time
> before failing the request. Here is where the benefit of the "failover:"
> URL lies in that multiple servers can be listed resulting in more than one
> fallback.
>
> Should that fail as well, the request will finally fail and the remote bean
> method invocation will result in an exception. The entire process is
> repeated should the application code attempt another remote bean invocation.
> It is not necessary to construct a new InitialContext.
>
>
> Going to put this into the doc as well. Good questions! It's very helpful
> in flushing out the documentation -- or lack there of :)
>
> Keep them coming! It's a good way to fill out anything that isn't
> completely clear.
>
> Thanks, Viola!
>
> -David
>
>
--
Ivan
Re: Multipoint URI
Posted by "viola.lu" <vi...@gmail.com>.
Thanks all, just one reminder as described in ivan's comment
set openejb.client.requestretry property to true
otherwise, failover won't work.
--
View this message in context: http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2263778.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: Multipoint URI
Posted by David Blevins <da...@visi.com>.
On Jun 16, 2010, at 9:45 AM, Kevan Miller wrote:
>
> On Jun 10, 2010, at 10:43 PM, David Blevins wrote:
>
>> If I understand correctly, then right on all points.
>>
>> To recap for possible doc benefit, sounds like this is the setup.
>>
>> client -> server1 -> server2 -> server3
>>
>> That should definitely work, but the start order would have to be the exact opposite:
>>
>> server3, server2, server1, client
>
> The start order would not need to be "exactly" that strict, correct? servers 1, 2, and 3 could be started in any order. And even if client was already connected to server1, client could eventually learn of all potential servers...
The connection attempt is only made once when the server starts, so if that server is not running they will never be linked... at least not without some extra help.
If you started them in "front" order using the exact described setup with server1 listing server2, server2 listing server1 and server3 listing nothing:
1. server1 starts; first it will attempt to connect to server2, which is not running. So server1 will sit there isolated.
2. server2 starts; it will attempt to connect to server3, which is not running. So server2 will sit there isolated.
3. server3 starts; it has no initialServers list so attempts no connects. So server3 will sit there isolated.
The described setup is weaker than it needs to be as listing just one server means the listed server is a potential point of weakness. As a matter of trivia, it is interesting to point out that you could bring a fourth server online temporarily that lists all three servers. Once it makes the introductions and all servers learn of each other, you could shut it down again.
The above setup is easily fixable via better configuration. If server3 listed both server1 and server2 in its initialServers list, rather than listing nothing at all, then all servers would fully discover each other regardless of startup order; assuming all three servers did eventually start.
THREE SERVERS OR LESS
In a three sever scenario, I recommend simply having all three servers list all three servers.
server1/conf/multipoint.properties
initialServers = server1, server2, server3
server2/conf/multipoint.properties
initialServers = server1, server2, server3
server3/conf/multipoint.properties
initialServers = server1, server2, server3
There's no harm to listing yourself, it gives you one clean list to maintain and it will work even if you decide not to start one of the three servers.
FOUR OR MORE
In a scenario of four or more, I recommend picking at least to servers and focus on always keeping at least one of them running. Lets refer to them as "root" servers for simplicity sake. Root server1 would list root server2 so they would always be linked to each other regardless of start order or if one of them went down. All other servers would simply list the root servers (server1, server2) in their initialServers list. As long as at least one root server (server1 or server2) was running, you can bring other servers on and offline at will and always have a fully connected graph.
Of course all servers once running and connected will have a full list of all other servers in the network, so if at any time the "root" servers weren't around to make initial introductions to new servers wanting to join the network it would be no trouble. At that point you can simply pick any other server to do the introductions for the new servers joining. So these "root" servers are no real point of failure in function, but only of convenience.
-David
Re: Multipoint URI
Posted by Kevan Miller <ke...@gmail.com>.
On Jun 10, 2010, at 10:43 PM, David Blevins wrote:
> If I understand correctly, then right on all points.
>
> To recap for possible doc benefit, sounds like this is the setup.
>
> client -> server1 -> server2 -> server3
>
> That should definitely work, but the start order would have to be the exact opposite:
>
> server3, server2, server1, client
The start order would not need to be "exactly" that strict, correct? servers 1, 2, and 3 could be started in any order. And even if client was already connected to server1, client could eventually learn of all potential servers...
--kevan
Re: Multipoint URI
Posted by David Blevins <da...@visi.com>.
On Jun 9, 2010, at 2:59 AM, viola.lu wrote:
> The doc is clear for end-users to understand. thanks. But I have one
> question about multipoint failover.
> There are three servers:server 1. server 2, server 3, now i add server 2 as
> server 1 initial multipoint servers, server 3 as server 2 inital multipoint
> servers, an openejb client call server 1 using:
> failover:ejbd://[server 1]:4201( here i don't need add all servers to
> openejb client provider url, right?)
> then i shutdown server 1, openejb client should still work coz server 1 will
> failover to server 2, and if i shutdown server 2, then server 2 will
> failover to server 3. This is the specific multipoint failover scenario, am
> i right?
If I understand correctly, then right on all points.
To recap for possible doc benefit, sounds like this is the setup.
client -> server1 -> server2 -> server3
That should definitely work, but the start order would have to be the exact opposite:
server3, server2, server1, client
And the overall outcome would be:
server3 starts
server2 starts
- static: connect to server3
server1 starts
- static: connect to server2
- dynamic: connect to server3
At this point all nodes are connected.
And then when the client comes online and connects to server1, it will be sent the following dynamic list [server1, server2, server3]. That list is versioned and will be dynamically updated in future responses from the server if other servers join/leave the network.
Once the dynamic list is obtained, the original "failover:ejbd://server1:4201" URL initially used by the client is no longer consulted and the dynamically obtained list is preferred for all failover situations. This is built right into the ejbd protocol and is the same for multipoint(TCP) or multicast(UDP).
Any method of connecting to a server will work -- "ejbd://server1:4201", "failover:ejbd://server1:4201,ejbd://server2:4201", or "multicast://239.255.2.3:6142". Upon first connect, the dynamic list is exchanged and that original URL is ignored. Note for that reason using "failover:ejbd://server1:4201" and "ejbd://server1:4201" is essentially the same thing.
Should a situation arise where the client cannot connect to any of the servers in the dynamic list, then the original URL is used one more time before failing the request. Here is where the benefit of the "failover:" URL lies in that multiple servers can be listed resulting in more than one fallback.
Should that fail as well, the request will finally fail and the remote bean method invocation will result in an exception. The entire process is repeated should the application code attempt another remote bean invocation. It is not necessary to construct a new InitialContext.
Going to put this into the doc as well. Good questions! It's very helpful in flushing out the documentation -- or lack there of :)
Keep them coming! It's a good way to fill out anything that isn't completely clear.
Thanks, Viola!
-David
Re: Multipoint URI
Posted by "viola.lu" <vi...@gmail.com>.
Hi, david:
The doc is clear for end-users to understand. thanks. But I have one
question about multipoint failover.
There are three servers:server 1. server 2, server 3, now i add server 2 as
server 1 initial multipoint servers, server 3 as server 2 inital multipoint
servers, an openejb client call server 1 using:
failover:ejbd://[server 1]:4201( here i don't need add all servers to
openejb client provider url, right?)
then i shutdown server 1, openejb client should still work coz server 1 will
failover to server 2, and if i shutdown server 2, then server 2 will
failover to server 3. This is the specific multipoint failover scenario, am
i right?
Thanks in advance!
--
View this message in context: http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2248577.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: Multipoint URI
Posted by David Blevins <da...@visi.com>.
On Jun 8, 2010, at 8:36 AM, David Blevins wrote:
>
> On Jun 6, 2010, at 7:42 PM, viola.lu wrote:
>
>> Thanks so much. Got it.
>
> You're welcome! Mailing list questions are the primary source of documentation. So it's actually very helpful.
Ok, here is the updated documentation with that answer text in the summary of the "Multipoint (TCP)" section. Can you give a look over that section and let me know if it is as clear as the email?
https://cwiki.apache.org/OPENEJBx30/failover.html
Any other comments/feedback welcome too.
Thanks, Viola!
-David
Re: Multipoint URI
Posted by David Blevins <da...@visi.com>.
On Jun 6, 2010, at 7:42 PM, viola.lu wrote:
> Thanks so much. Got it.
You're welcome! Mailing list questions are the primary source of documentation. So it's actually very helpful.
Thanks!
-David
Re: Multipoint URI
Posted by "viola.lu" <vi...@gmail.com>.
Thanks so much. Got it.
--
View this message in context: http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2245422.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: Multipoint URI
Posted by David Blevins <da...@visi.com>.
Hi Viola!
On Jun 2, 2010, at 12:31 AM, viola.lu wrote:
>
> Thanks.
>
> I know failover:sticky:ejbd://9.123.237.141:4201,ejbd://9.186.10.68:4201 can
> work, but
> in multicast , client can access with:
>
> p.setProperty(Context.PROVIDER_URL,"multicast://
> 239.255.3.2:6142?group=cluster1");
>
> is there any thing like:
> p.setProperty(Context.PROVIDER_URL,"multipoint://*****"); ?
Nope. The multipoint stuff is entirely TCP based, so no real broadcast functionality to speak of. Communication of who is in the network is achieved by each server having a physical connection to each other server in the network. To join the network, you have to know the address of at least one server in the network and connect to it. When you do it will tell you the full list of all the other servers it knows about. The new server will then connect to each of those servers and they will in turn give their lists. The end result is that everyone has a connection to everyone 100% of the time, hence the made-up term "multipoint" to describe this situation of each server having multiple point-to-point connections which create a fully connected graph.
On the client side things are similar. It needs to know the address of at least one server in the network and be able to connect to it. When it does it will get the full (and dynamically maintained) list of every server in the network. The client doesn't connect to each of those servers immediately, but rather consults the list in the event of a failover, using it to decide who to connect to next.
So the initial list is essentially to help bootstrap that whole process and is required of every server and every client in the multipoint network. You really only need one valid server in the list and after the first valid contact with a running server, that bootstrap list becomes unused.
Essentially the art of using a statically maintained list to bootstrap getting the more valuable dynamically maintained list.
Hope this helps!
-David
>
>
>
> On Wed, Jun 2, 2010 at 3:23 PM, David Blevins [via OpenEJB] <
> ml-node+2239675-1857712463-173499@n4.nabble.com<ml...@n4.nabble.com>
>> wrote:
>
>>
>> On Jun 1, 2010, at 10:58 PM, viola.lu wrote:
>>
>>>
>>> As we know, we can access ejb members with multicast URI:
>>> multicast://239.255.3.2:6142?group=cluster1
>>>
>>> Now i have serveral multipoint members: NODE1, NODE2, Node3,
>>> if i want to acess ejb members with multipoint URI, this URI format is?
>>
>> Added that support just last week. Check out this JIRA:
>>
>> https://issues.apache.org/jira/browse/OPENEJB-1281
>>
>> Still need to get it documented, but it's basically
>> "failover:URL1,URL2,URL3"
>>
>>
>> -David
>>
>>
>>
>> ------------------------------
>> View message @
>> http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2239675.html
>> To unsubscribe from Multipoint URI, click here< (link removed) ==>.
>>
>>
>>
>
>
> --
> viola
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2239683.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: Multipoint URI
Posted by "viola.lu" <vi...@gmail.com>.
Thanks.
I know failover:sticky:ejbd://9.123.237.141:4201,ejbd://9.186.10.68:4201 can
work, but
in multicast , client can access with:
p.setProperty(Context.PROVIDER_URL,"multicast://
239.255.3.2:6142?group=cluster1");
is there any thing like:
p.setProperty(Context.PROVIDER_URL,"multipoint://*****"); ?
On Wed, Jun 2, 2010 at 3:23 PM, David Blevins [via OpenEJB] <
ml-node+2239675-1857712463-173499@n4.nabble.com<ml...@n4.nabble.com>
> wrote:
>
> On Jun 1, 2010, at 10:58 PM, viola.lu wrote:
>
> >
> > As we know, we can access ejb members with multicast URI:
> > multicast://239.255.3.2:6142?group=cluster1
> >
> > Now i have serveral multipoint members: NODE1, NODE2, Node3,
> > if i want to acess ejb members with multipoint URI, this URI format is?
>
> Added that support just last week. Check out this JIRA:
>
> https://issues.apache.org/jira/browse/OPENEJB-1281
>
> Still need to get it documented, but it's basically
> "failover:URL1,URL2,URL3"
>
>
> -David
>
>
>
> ------------------------------
> View message @
> http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2239675.html
> To unsubscribe from Multipoint URI, click here< (link removed) ==>.
>
>
>
--
viola
--
View this message in context: http://openejb.979440.n4.nabble.com/Multipoint-URI-tp2239616p2239683.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: Multipoint URI
Posted by David Blevins <da...@visi.com>.
On Jun 1, 2010, at 10:58 PM, viola.lu wrote:
>
> As we know, we can access ejb members with multicast URI:
> multicast://239.255.3.2:6142?group=cluster1
>
> Now i have serveral multipoint members: NODE1, NODE2, Node3,
> if i want to acess ejb members with multipoint URI, this URI format is?
Added that support just last week. Check out this JIRA:
https://issues.apache.org/jira/browse/OPENEJB-1281
Still need to get it documented, but it's basically "failover:URL1,URL2,URL3"
-David