[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Client Reconnect  XML
Forum Index -> General
Author Message
sesteel

neo

Joined: 01/09/2008 09:00:08
Messages: 3
Offline

Does a terracotta client have the ability to disconnect and reconnect to the terracotta server? Or a new instance of the terracotta server? Thank you.
tgautier

seraphim

Joined: 06/05/2006 12:19:26
Messages: 1781
Offline

The Terracotta client can failover to a passive server when it detects that the connection to the active server has failed.

This behavior is automatic.

There is an additional feature that can allow a Terracotta client to attempt first to reconnect to the active server in case of a failure at the network level, before trying to connect to the passive server.

This behavior is controlled via the reconnect window setting, and is turned off by default. When enabled, it will allow a Terracotta client to reconnect to it's original active server in the case of failure of it's connection to the active server.

Additionally, there is another setting which controls how long the Terracotta Server will wait for a client to failover. If the server reconnect window expires, the cluster will "move forward" (meaning state may change without the client connected) and the client will not be allowed to connect to the cluster (since it's state is not synchronized with the cluster).

So, the client reconnect window which controls the amount of time before a server will not allow a client which is failing over to a new active server is controlled in the tc-config.xml, and the setting is described in the documentation: http://www.terracotta.org/confluence/display/docs1/Configuration+Guide+and+Reference#ConfigurationGuideandReference-clientreconnectwindow

Code:
 <client-reconnect-window>120</client-reconnect-window>
 



The "l1 reconnect" setting is the other setting, which allows a client (L1) to reconect to an active server (before attempting to failover to a passive) and this setting is controlled via the tc.properties. Changing values for tc.properties is described here:

http://www.terracotta.org/confluence/display/devdocs/tc.properties

The settings are:

Code:
 l1.reconnect.enabled = true
 l1.reconnect.timeout.millis = 60000
 


[WWW]
hankli

journeyman

Joined: 11/20/2007 16:03:04
Messages: 17
Offline

For my case, I restart the terracotta server, the client just hang there. Only way to solve it is to restart the client.

tgautier

seraphim

Joined: 06/05/2006 12:19:26
Messages: 1781
Offline

In that case, you need to ensure that the server persistence mode is configured.

This document outlines how to configure a server cluster, in which the first step is to enable persistent mode:

http://www.terracotta.org/confluence/display/docs1/Configuring+a+Terracotta+Server+Cluster

In particular, you need to set the following setting:

Code:
   <servers>
     <server>
       <dso>
         <persistence>
           <mode>permanent-store</mode>
         </persistence>
       </dso>
     </server>
 
[WWW]
kiwu

journeyman

Joined: 05/20/2008 00:59:21
Messages: 18
Offline

Hi,

According to the dev wiki the property names are


l2.l1reconnect.enabled
l2.l1reconnect.timeout.millis 


and not


l1.reconnect.enabled
l1.reconnect.timeout.millis
 


as mentioned in this thread

Chris
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.7 © JForum Team