Author |
Message |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 19:41:53
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
Hi ,
I run two terracotta servers(192.168.0.5 and 192.168.0.12) on two CentOS,and run two terracotta clients(192.168.0.12 ,192.168.0.13 ) on three CentOS ,while another terracotte client(192.168.0.52) run on windows xp.Here is my tc-config-jetty.xml :
Code:
<servers>
<server host="192.168.0.5" name="gz-samba">
<dso-port>9510</dso-port>
<jmx-port>9520</jmx-port>
<data>/var/data/terracotta/jetty/gz-samba </data>
<logs>/var/log/terracotta/jetty/gz-samba</logs>
<l2-group-port>9530</l2-group-port>
<dso>
<persistence>
<mode>permanent-store</mode>
</persistence>
</dso>
</server>
<server host="192.168.0.12" name="dev02">
<dso-port>9510</dso-port>
<jmx-port>9520</jmx-port>
<data>/var/data/terracotta/jetty/dev02</data>
<logs>/var/log/terracotta/jetty/dev02</logs>
<l2-group-port>9530</l2-group-port>
<dso>
<persistence>
<mode>permanent-store</mode>
</persistence>
</dso>
</server>
<ha>
<mode>networked-active-passive</mode>
<networked-active-passive>
<election-time>5</election-time>
</networked-active-passive>
</ha>
</servers>
<clients>
<logs>%(user.home)/terracotta/client-logs</logs>
<modules>
<module name="clustered-jetty-6.1" version="1.0.0"/>
<module name="clustered-apache-struts-1.1" version="1.1.0"/>
</modules>
</clients>
<web-applications>
<web-application>Cart</web-application>
</web-applications>
then I run my tc_server(192.168.0.12) with this command:
Code:
#!/bin/sh
rm -rf /var/data/terracotta/jetty/*
/usr/local/terracotta/bin/start-tc-server.sh -f /usr/local/terracotta/conf/tc-config-jetty.xml -n dev02
and I run my tc_client(192.168.0.13) with this command,the same as the 192.168.0.12
Code:
#!/bin/sh
TERRACOTTA_HOME="/usr/local/terracotta"
JETTY_HOME="/usr/local/jetty"
export TERRACOTTA_HOME JETTY_HOME
java -Xbootclasspath/p:$TERRACOTTA_HOME/lib/dso-boot/dso-boot-hotspot_linux_150_11.jar -Dtc.install-root=$TERRACOTTA_HOME -Dtc.config=192.168.0.12:9510 -jar $JETTY_HOME/start.jar $JETTY_HOME/etc/jetty.xml
and then I run another tc_client who run on windows xp(192.168.0.52) with this command:
Code:
java -Xbootclasspath/p:"D:\caizhe\software\terracotta-2.4.0\bin\..\lib\dso-boot\dso-boot-hotspot_win32_150_11.jar" -Dtc.install-root="D:\caizhe\software\terracotta-2.4.0\bin\.." -Dtc.config="192.168.0.5:9510" -jar start.jar contrib/terracotta/src/main/resources/jetty.xml
Here is my problem:if I access this URL(http://192.168.0.52:9081/Cart),the terracotta server works well,that is my client who run on 192.168.0.52 whose operator system is windows xp can connect to the terracotta server and the server can shared this client's session data.while I access another URL(http://192.168.0.13:8080/Cart),althought I can access this URL and can success to connect to the same terracotta server which 192.168.0.52 connected,the terracotta server could not shared 192.168.0.13's sessions data.
please help me.
thank in advance.
Joy
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 20:07:25
|
kbhasin
consul
Joined: 12/04/2006 13:08:21
Messages: 340
Offline
|
Something is not right with your active-passive configuration. I see that one of the clients is fetching the configuration from -Dtc.config=192.168.0.12:9510 while the other is fetching the configuration from -Dtc.config="192.168.0.5:9510". Are you sure you are using the same configuration on both Terracotta Servers. One should say started as ACTIVE while the other should not. Also, as a best practice, you should provide a comma separated list of Terracotta Servers like: -Dtc.config=192.168.0.12:9510,192.168.0.5:9510 if you plan to deploy more than one instances of the Terracotta Server.
|
Regards,
Kunal Bhasin,
Terracotta, Inc.
Be a part of the Terracotta community: Join now! |
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 21:05:56
|
tgautier
seraphim
Joined: 06/05/2006 12:19:26
Messages: 1781
Offline
|
After you resolve the problem Kunal points out, you will need to have a load balancer to see shared sessions, otherwise your browser will think it is accessing different hosts, and, according to the cookie spec, not send the same cookie to the second host, and thus the second server will generate a new session rather than link to the existing session.
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 23:08:23
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
Hi kbhasin,
I'm sorry that I have make a mistake to show my command that use to run my terracotta client,this is the correct command for the 192.168.0.52:
Code:
java -Xbootclasspath/p:"D:\caizhe\software\terracotta-2.4.0\bin\..\lib\dso-boot\dso-boot-hotspot_win32_150_11.jar" -Dtc.install-root="D:\caizhe\software\terracotta-2.4.0\bin\.." -Dtc.config="192.168.0.12:9510" -jar start.jar contrib/terracotta/src/main/resources/jetty.xml
btw,thanks for give me the example to specify two terracotta server like this
-Dtc.config =192.168.0.12:9510,192.168.0.5:9510
thanks.
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 23:11:18
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
Hi tgautier,
thanks for your advise,we will do this while we solve this problem and build up our environment.
Joy.
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 23:16:10
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
Hi,
Now the example Cart can work well between my three terracotta clients.
but my application of art.war doesn't work.It means that I put my application into two clients of 192.168.0.52 and 192.168.0.13 and they works well,while it doesn't works that means can't shared the session data when it run on 192.168.0.12 on which the terracotta server run.
would you mind give me some advise or something else?
thanks .
Joy.
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 23:25:31
|
kbhasin
consul
Joined: 12/04/2006 13:08:21
Messages: 340
Offline
|
Make sure that all three (52,12 and 13) are pointing to the same Terracotta Server (look in the admin console to make sure you see three clients) and also, as Taylor has suggested, make sure that the load balancer is configured to distribute load between all three clients.
|
Regards,
Kunal Bhasin,
Terracotta, Inc.
Be a part of the Terracotta community: Join now! |
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 23:47:10
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
Hi kbhasin,
all the three (52,12 and 13) are pointing to 192.168.0.12 Terracotta Server.
make sure that the load balancer is configured to distribute load between all three clients.
how to do that?
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 23:51:23
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
May I input any image in this forum??If can,I want to show you the terracotta server's admin console .below is the output of the server's console:
Code:
2007-08-03 14:20:25,335 [TCComm Selector Thread 1 (listen 0:0:0:0:0:0:0:0:9510)] INFO com.tc.net.protocol.transport.ServerMessageTransport - ConnectionID(0.c5c4efb1f7da4d708ba1cabb09d90de5): Attaching new connection: com.tc.net.core.TCConnectionJDK14@4926325: connected: true, closed: false local=192.168.0.12:9510 remote=192.168.0.13:58387 connect=[Fri Aug 03 14:20:25 HKT 2007] idle=72ms
2007-08-03 14:20:25,375 [WorkerThread(jmxremote_tunnel_stage,0)] INFO com.tc.management.remote.protocol.terracotta.ClientTunnelingEventHandler - L1[ChannelID=[0]] notified us that their JMX server is now available
2007-08-03 14:20:25,399 [WorkerThread(client_handshake_stage,0)] INFO com.tc.objectserver.handshakemanager.ServerClientHandshakeManager - Client connected ChannelID=[0]
2007-08-03 14:22:43,763 [TCComm Selector Thread 1 (listen 0:0:0:0:0:0:0:0:9510)] INFO com.tc.net.protocol.transport.ServerMessageTransport - ConnectionID(1.c5c4efb1f7da4d708ba1cabb09d90de5): Attaching new connection: com.tc.net.core.TCConnectionJDK14@17243666: connected: true, closed: false local=192.168.0.12:9510 remote=192.168.0.12:38579 connect=[Fri Aug 03 14:22:43 HKT 2007] idle=50ms
2007-08-03 14:22:43,775 [WorkerThread(jmxremote_tunnel_stage,0)] INFO com.tc.management.remote.protocol.terracotta.ClientTunnelingEventHandler - L1[ChannelID=[1]] notified us that their JMX server is now available
2007-08-03 14:22:43,812 [WorkerThread(client_handshake_stage,0)] INFO com.tc.objectserver.handshakemanager.ServerClientHandshakeManager - Client connected ChannelID=[1]
2007-08-03 14:47:14,772 [TCComm Selector Thread 1 (listen 0:0:0:0:0:0:0:0:9510)] INFO com.tc.net.protocol.transport.ServerMessageTransport - ConnectionID(2.c5c4efb1f7da4d708ba1cabb09d90de5): Attaching new connection: com.tc.net.core.TCConnectionJDK14@4621250: connected: true, closed: false local=192.168.0.12:9510 remote=192.168.0.52:4978 connect=[Fri Aug 03 14:47:14 HKT 2007] idle=49ms
2007-08-03 14:47:14,786 [WorkerThread(jmxremote_tunnel_stage,0)] INFO com.tc.management.remote.protocol.terracotta.ClientTunnelingEventHandler - L1[ChannelID=[2]] notified us that their JMX server is now available
2007-08-03 14:47:14,804 [WorkerThread(client_handshake_stage,0)] INFO com.tc.objectserver.handshakemanager.ServerClientHandshakeManager - Client connected ChannelID=[2]
thanks.
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/02/2007 23:57:17
|
kbhasin
consul
Joined: 12/04/2006 13:08:21
Messages: 340
Offline
|
Joy.Cai wrote:
Hi kbhasin,
all the three (52,12 and 13) are pointing to 192.168.0.12 Terracotta Server.
make sure that the load balancer is configured to distribute load between all three clients.
how to do that?
You will have to consult your load balancer's manual/documentation for that. For testing purposes only, you can try a simple and lightweight load balancer like balance (http://www.linux.com/articles/46735).
By the way, I am curious: how did you identify that the sessions are being clustered between 52 and 13 but not 12?
|
Regards,
Kunal Bhasin,
Terracotta, Inc.
Be a part of the Terracotta community: Join now! |
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/03/2007 00:04:57
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
By the way, I am curious: how did you identify that the sessions are being clustered between 52 and 13 but not 12?
first,I run my terracotta server(192.168.0.12) and clients(12,52,13),at first the session data is null .then I access http://192.168.0.12:8080/art and I can success to access it can also can success to connect to the servers(192.168.0.12),but the sessions data is null still.
second ,I shutdown the client of 192.168.0.12,then access http://192.168.0.13:8080/art,the servers can success to shared the session data,the same as another client of 192.168.0.52.
Is this way has something wrong?
|
|
 |
![[Post New]](../../templates/default/images/icon_minipost_new.gif) 08/03/2007 00:16:49
|
Joy.Cai
journeyman
Joined: 07/19/2007 19:14:55
Messages: 40
Offline
|
Hi kbhasin,
it is very exciting that my problem is solved now,because I add this file art.xml file into %JETTY_HOME%/contexts ,and it works now.
thanks for your help.
Joy.
|
|
 |
|