You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@river.apache.org by Sergio Aguilera Cazorla <sa...@gmail.com> on 2012/04/17 12:11:44 UTC

Several Lookup Servers on same Host

Hello everybody,

I suspect the answer for my main question is "no", but I would like to
confirm with you before discarding the idea.

I have been developing an application that uses Jini / Apache River
architecture, and now it's time for deployment. I would like to run several
Lookup Services on the same machine so clients could see them as "separate"
servers. In fact, each one of the LUS is attached to a different discovery
group, and my programs sets the differences among discovered services based
on the group which they belong to. If I try this on separate physical
hosts, my program works OK.

However, I would like to run all the Lookup Servers on the same host. In
the default Sun implementation, when the first LUS is fired, it is assigned
an address like "jini://myHost:4160", so you can discover it by performing
multicast on the default port 4160. As you fire more LUS, they are assigned
different and random ports, so discovery in that way does not work...

So, my questions are:

*1 *- Is there a way to launch more than one LUS in the same host, both
working under the default jini port 4160? --> I suspect "no"...

*2 *- If not, is there a way (from the client side) to perform multicast
discovery and get a response from ALL Lookup Servers, despite the port they
are attached to? Take into account that clients don't know anything about
random ports assigned by the 2nd, 3rd... execution af Reggie. At this
moment, I am performing discovery via the LookupDiscovery class.

*3 *- Am I misunderstanding something about ports? I mean, am I mixing
concepts about multicast discovery / unicast response ports?

Thank you very much!

-- 
*Sergio Aguilera*

Re: Several Lookup Servers on same Host

Posted by Sergio Aguilera Cazorla <sa...@gmail.com>.
Hello,

Your help  is very much appreciated because you're totally right! I've been
doing some testing from the moment I sent last mail. As you point out, if I
start 4-5 instances of Reggie, each one of them with a different port
number, my program will be unable to locate them via Unicast discovery. But
all of them respond to a Multicast request!

Your second advice has made me change the way I was focusing the problem. I
don't know why I was stuck in thinking that "1 reggie instance = 1
multicast group". Firing a single instance of Reggie belonging to several
groups is just the solution I was needing for my project. Just in case
someone has the same problem: that can be achieved by means of reggie's
configuration file (look at the specification in
http://river.apache.org/doc/api/com/sun/jini/reggie/package-summary.html).

Thank you very much!


2012/4/17 Christopher Dolan <ch...@avid.com>

> I think the answer might actually be yes for both multicast and unicast
> cases. I'm sure about unicast, but my memory is more fuzzy about multicast.
>
> The scenario I've specifically tested is a LUS on 4160 for one djinn and
> another LUS on 4161 for a special-purpose djinn. I'm sure that it works if
> you have unicast locators for the 4160 and 4161 ports, but I can't recall
> if multicast found both LUS instances. In principle I think it should work
> because the LUS' multicast announcement contains the locator back to 4160
> or 4161.
>
> Note that Reggie *can* support multiple groups with a single instance! In
> particular, I've done this with a client-side filter to remove the lookup
> results that match the wrong group. I needed that for cases where clients
> have an out-of-date unicast locator pointing to a LUS that's now serving an
> unrelated djinn.
>
> Chris
>
> -----Original Message-----
> From: Sergio Aguilera Cazorla [mailto:sagucaz@gmail.com]
> Sent: Tuesday, April 17, 2012 5:12 AM
> To: user@river.apache.org
> Subject: Several Lookup Servers on same Host
>
> Hello everybody,
>
> I suspect the answer for my main question is "no", but I would like to
> confirm with you before discarding the idea.
>
> I have been developing an application that uses Jini / Apache River
> architecture, and now it's time for deployment. I would like to run several
> Lookup Services on the same machine so clients could see them as "separate"
> servers. In fact, each one of the LUS is attached to a different discovery
> group, and my programs sets the differences among discovered services based
> on the group which they belong to. If I try this on separate physical
> hosts, my program works OK.
>
> However, I would like to run all the Lookup Servers on the same host. In
> the default Sun implementation, when the first LUS is fired, it is assigned
> an address like "jini://myHost:4160", so you can discover it by performing
> multicast on the default port 4160. As you fire more LUS, they are assigned
> different and random ports, so discovery in that way does not work...
>
> So, my questions are:
>
> *1 *- Is there a way to launch more than one LUS in the same host, both
> working under the default jini port 4160? --> I suspect "no"...
>
> *2 *- If not, is there a way (from the client side) to perform multicast
> discovery and get a response from ALL Lookup Servers, despite the port they
> are attached to? Take into account that clients don't know anything about
> random ports assigned by the 2nd, 3rd... execution af Reggie. At this
> moment, I am performing discovery via the LookupDiscovery class.
>
> *3 *- Am I misunderstanding something about ports? I mean, am I mixing
> concepts about multicast discovery / unicast response ports?
>
> Thank you very much!
>
> --
> *Sergio Aguilera*
>



-- 
*Sergio Aguilera*

RE: Several Lookup Servers on same Host

Posted by Christopher Dolan <ch...@avid.com>.
I think the answer might actually be yes for both multicast and unicast cases. I'm sure about unicast, but my memory is more fuzzy about multicast.

The scenario I've specifically tested is a LUS on 4160 for one djinn and another LUS on 4161 for a special-purpose djinn. I'm sure that it works if you have unicast locators for the 4160 and 4161 ports, but I can't recall if multicast found both LUS instances. In principle I think it should work because the LUS' multicast announcement contains the locator back to 4160 or 4161.

Note that Reggie *can* support multiple groups with a single instance! In particular, I've done this with a client-side filter to remove the lookup results that match the wrong group. I needed that for cases where clients have an out-of-date unicast locator pointing to a LUS that's now serving an unrelated djinn.

Chris

-----Original Message-----
From: Sergio Aguilera Cazorla [mailto:sagucaz@gmail.com] 
Sent: Tuesday, April 17, 2012 5:12 AM
To: user@river.apache.org
Subject: Several Lookup Servers on same Host

Hello everybody,

I suspect the answer for my main question is "no", but I would like to
confirm with you before discarding the idea.

I have been developing an application that uses Jini / Apache River
architecture, and now it's time for deployment. I would like to run several
Lookup Services on the same machine so clients could see them as "separate"
servers. In fact, each one of the LUS is attached to a different discovery
group, and my programs sets the differences among discovered services based
on the group which they belong to. If I try this on separate physical
hosts, my program works OK.

However, I would like to run all the Lookup Servers on the same host. In
the default Sun implementation, when the first LUS is fired, it is assigned
an address like "jini://myHost:4160", so you can discover it by performing
multicast on the default port 4160. As you fire more LUS, they are assigned
different and random ports, so discovery in that way does not work...

So, my questions are:

*1 *- Is there a way to launch more than one LUS in the same host, both
working under the default jini port 4160? --> I suspect "no"...

*2 *- If not, is there a way (from the client side) to perform multicast
discovery and get a response from ALL Lookup Servers, despite the port they
are attached to? Take into account that clients don't know anything about
random ports assigned by the 2nd, 3rd... execution af Reggie. At this
moment, I am performing discovery via the LookupDiscovery class.

*3 *- Am I misunderstanding something about ports? I mean, am I mixing
concepts about multicast discovery / unicast response ports?

Thank you very much!

-- 
*Sergio Aguilera*