Hello,

Kevin Duffey wrote:

> Hi Orion team (and fellow enthusiasts):

Again, I'd like to point out that the list is meant for the Orion community, not
for the Orion team. It's a rather high volume list and we don't require the team
members to read every mail on the list, so it's not the most efficient way to
reach us. This time you're in luck though :)

>
> I have asked this before and didn't get a chance to follow up on it. I have
> successfully clustered Orion. But I have a few questions that I really need
> answered before I can deploy our site on Orion.
>
> First, while clustering it is unbelievably easy, I would love to have a
> little more detail as to the use of the id in server.xml <cluster id="xxx"
> />..what exactly does this do? Is it really just any random number I enter
> for each server? Or is there some special way I should derive this value?
>

No, just that it has to be unique within the cluster. The cluster needs an
identifier for every participant, but you don't have to supply this id yourself.
If you don't it will be set automatically for you based on the ip-number of the
host. You only need to set it if you do funky stuff.

>
> Second, the orion-web.xml <cluster-config> tag. I see three options.
> host="<some ip address", id="xxx" and port="xxx". I have a general id. But I
> would like a little more detail as to how each is used. I understand that
> the host and port are the cluster communication route, but can I change
> these values to anything? I know the port needs to be a port that ALL orion
> servers in the cluster choose (which means, if I have 10 servers, all 10
> have this host value set to the same value). But, is this value internal to
> the LAN that all servers are on? So, can I set it to say 1, 10, 1000, etc,
> and it works? Or is there a specific range that needs to be considered? I
> realize port 80 is for http, 21 is ftp, etc. The host ip address..is that a
> random ip as well? Our lan range is from 206.xxx.xxx.yyy where yyy is 0 to
> 255 and we own that entire range (lease it I should say). IS the default ok
> to use at all times? Or should I change it for any reason (if so..why?)?

Ok, the keyword about the cluster tag is "multicast". If you look in the docs on
the meaning of host, you will note that it says the "multicast host/ip". This
means that it's not a normal TCP/IP host but a specific multicast channel.
Messages sent on the multicast IP:s are broadcasted to the network rather than
sent to a specific computer. Check out the API docs for java.net.MulticastSocket
to learn more about multicast ip:s
(http://java.sun.com/j2se/1.3/docs/api/java/net/MulticastSocket.html), it's
pretty nice reading if you don't know how multicast works.

The valid multicast IP:s range from 224.0.0.0 (this one should not be used
though, reserved) to 239.255.255.255, inclusive. These have nothing to do with
the IP numbers your LAN is using since they are multicast-specific.

The only thing is of course to make sure that there aren't any other apps using
the same host:port to multicast on your LAN. If they are you'll have to change
them. A common scenario where you will need to use multiple mulcast channels is
when you set up "islands" of "hot" clusters that state is replicated fully over.
I'll clarify:

Say you want to cluster 9 computers running Orion. It can then be overkill to
replicate state to every node, but you want to replicate the state so it isn't
lost when a server goes down. You can then set up 3 "hot" clusters or islands,
(I use the term "hot" to mean that full state synchronization is done.) The
three islands consists of 3 computers each and within those islands state is
sent to a certain multicast ip/port. However, no syncroization is doen between
the islands. In front of this you set up a cookie-aware load balancer.

Now a customer visits the site. He connects to the load balancer (which is also
clustered, but that's another story). Since he doesn't have a session yet he can
be sent to any of the 9 servers. He now gets a session set up, that's only valid
within one of the 3 islands, but every island still consists of 3 servers.

On his next request the load-balancer will see his cookie and know which island
to send him off to, however he can choose any of the 3 servers within the island
that are alive (yeah, the load balancer pings the back-end servers to know which
ones are alive.)

This is a pretty good clustered environment, but currently requires third party
software for the load balancer.

We are working on compiling a list of "certified" load balancers that integrate
well with Orion and we might write something ourselves that is provided with
Orion. However, right now it can be complex to set this up unless you know a
fair deal about clustering-software, and this is what we will write about in the
clustering document. As you can see it's a rather complex story, and that's why
it's taking some time to produce it.

However, I'm just preparing a shorter text for how to set up simple clustering
and it will hopefully be ready no later than monday.

>
> Lastly, the id. Is this the same id that the server.xml <config id="xxx" />
> is set to? Or is there another use for this?

>
> Third, I want to work with two tiers. One for servlets, one for EJB. Each is
> a clustered tier. If I want to cluster EJB separate from Servlets (which I
> assume is the way to do it), can I just change the port setting on one tier
> (so ejb tier has each server pointing to say 9128, where as the servlet tier
> is 9127), and the host and id is default value..and it works? Or is their
> special considerations to getting two separate tiers clustered, but still
> able for the servlet tier to get ejb homes and stuff?

I'll get back on this later.

>
> Fourth, I have not tested the cluster with a load-balance, but I have two
> servers running, clustered. Each has their own ip address. I hit one ip
> address and see the site show up. In the console app of BOTH servers in the
> cluster, I see the same session id show up under the app (if anyone reading
> this doesn't know what I mean by console app..run orion with java -jar
> orion.jar console2.

I assume you mean java -jar orion.jar -console or java -jar orionconsole.jar

> You'll see a swing app show up, and you can expand the
> http tree to see web-apps that are deployed. You can then expand each
> web-app and a sessions tree shows up. Click on that and you'll see the
> sessions that exist under that app, and their data for each session (when
> you click on a session on the right pane)). The problem is, if I click on
> the "other" machines session, it has the same session key name, but the
> session data is something lke @bab20 instead of the actual session data
> names. What exactly does this mean? I thought that when two or more servers
> were clustered, the same session keys AND data were duplicated on all
> machines.

Yes, that is right.

> That way, if the server that created the session data, and it
> died, the other server would retain it so that when the next request came
> in...the user would still be "active" on the site. Is this not the case?

That is the case.

>
> Fifth, tied to the above, if two or more servers are clustered and I have a
> session alive (shows up on both), then I shut down one servers Orion, the
> other one should remain active..right?

Yes

> I still see the session data on the
> other one. What I am confused about, and maybe this is because I am not
> using a load-balancer yet, is if I hit ip xxx.xxx.xxx.1, and the session
> data is created there and replicated to xxx.xxx.xxx.2 server. Then I shut
> down the .1 server, and I go hit the .2 server (www access), the session
> does not exist for me

That's because session _cookies_ are just valid for 1 host. The session exist on
both hosts, but your browser will (for obvious reasons) not go about and send
your cookies away to just any host on the net. This has no effect on real
clustering of course, since the host will be seen as one. (like www.foo.bar,
even if there are many servers behind that name).


> ..it creates a new session over there. So what I am
> wondering is, if I shut down one server, when the client hits the ip
> (load-balancer) does that client still have an active session? Is the data
> saved on both servers?

Yes, that's the whole point of the session state replication.

> Also, when the server that is down starts up again
> (or you add a new server to the cluster), does the data on the existing
> server get replicated to the other server that just got added? Or does this
> not happen automatically?

I'll get back on this later.

> I thought that if for example one server went
> down, the client doesn't lose their session information, and that you can
> bring up the server that went down (or add one or more boxes to the cluster)
> and they all get automatically replicated to. So if someone can explain
> exactly how this works that would be great. Do I need a load-balancer in
> order to test this? Is there any way, say using DNS round-robbing or
> something, that I can test this?

Yes, just set up your DNS to round-robin between your two hosts and you can see
how it works. Of course however, if you do nothing more than a simple round
robin DNS, every 2nd request will go to a broken server if one of your 2 servers
is down, this is why you want a smarter front-end.

> Is there a way to set up one server that
> will "ping" two or more clustered servers, and alternate between them
> sending them requests, and if one is down it sends all requests to the one
> server that is up..so that I can test the fail-over of Orion?

Yes, the document that's hopefully due on monday will show how to do this using
free software.

Regards,
Karl Avedal


Reply via email to