[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]
NAP config help  XML
Forum Index -> General
Author Message
denov

journeyman

Joined: 07/15/2008 16:12:03
Messages: 12
Offline

i'm trying to configure a NAP TC cluster. i'm running into 2 different problems. one being a 'SPLIT BRAIN DETECTED' and the other is 'ClusterIDs dont match'. depending on what order i start my TC servers in and if i use or don't use the -n option i'll get one or the other. these problems show up after i start turning on my tomcat nodes. without tomcat running my TC cluster seems to be working. i'm using the same tc-config.xml file on both servers and both tomcat nodes. my config looks like
Code:
 <?xml version="1.0" encoding="UTF-8"?>
 <tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd"
 	xmlns:tc="http://www.terracotta.org/config"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
  <servers>
     <server name="tc1" host="terracotta.autoreturn.com">
       <data>/var/terracotta/tc1-data</data>
       <logs>/var/terracotta/server-logs</logs>
       <statistics>/var/terracotta/server-statistics</statistics>
       <dso-port>9510</dso-port>
       <jmx-port>9520</jmx-port>
       <l2-group-port>9530</l2-group-port>
       <dso>
         <persistence>
           <mode>permanent-store</mode>
         </persistence>
       </dso>
     </server>
     <server name="dev-app1" host="dev-app1.autoreturn.com">
       <data>/var/terracotta/tc2-data</data>
       <logs>/var/terracotta/server-logs</logs>
       <statistics>/var/terracotta/server-statistics</statistics>
       <dso-port>9510</dso-port>
       <jmx-port>9520</jmx-port>
       <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>  
 
     <update-check>
 	<enabled>true</enabled>
     </update-check>
 
   </servers>
   
   <clients>
     <logs>/var/terracotta/client-logs/%(webserver.log.name)</logs>
     <statistics>/var/terracotta/statistics/%(webserver.log.name)</statistics>
   </clients>
 
 
   <application>
     <dso>
       <instrumented-classes>
         <exclude>org.apache.coyote..*</exclude>
         <exclude>org.apache.catalina..*</exclude>
         <exclude>org.apache.jasper..*</exclude>
         <exclude>org.apache.tomcat..*</exclude>
         <include>
           <class-expression>org.acegisecurity..*</class-expression>
         </include>
         <include>
           <class-expression>java.lang.String$CaseInsensitiveComparator</class-expression>
         </include>
         <include>
           <class-expression>com.autoreturn.dispatch.db.UserPreferences</class-expression>
         </include>
         <include>
           <class-expression>com.autoreturn.commons.model.Region</class-expression>
         </include>
         <include>
           <class-expression>org.joda..*</class-expression>
         </include>
         <include>
           <class-expression>org.hibernate..*</class-expression>
         </include>
         <include>
           <class-expression>com.autoreturn..*</class-expression>
         </include>
         <include>
           <class-expression>org.springframework.core.NestedRuntimeException</class-expression>
         </include>
       </instrumented-classes>
       <!--Tell DSO which applications in your web container is using DSO-->
       <web-applications>
         <web-application>ads</web-application>
       </web-applications>
       <!--We declare the field 'service.ProductCatalog.catalog' a root, making it
            available for all instances of our app that runs via DSO-->
       <roots>
         <root>
           <field-name>demo.townsend.service.ProductCatalog.catalog</field-name>
           <root-name>ProductCatalog</root-name>
         </root>
       </roots>
       <additional-boot-jar-classes>
         <include>java.util.Locale</include>
         <include>java.lang.String$CaseInsensitiveComparator</include>
         <include>javax.naming.directory.BasicAttributes</include>
         <include>javax.naming.directory.BasicAttribute</include>
         <include>com.sun.jndi.ldap.LdapAttribute</include>
         <include>javax.naming.CompositeName</include>
         <include>com.sun.jndi.toolkit.ctx.ComponentDirContext</include>
         <include>com.sun.jndi.toolkit.ctx.PartialCompositeDirContext</include>
         <include>com.sun.jndi.toolkit.ctx.AtomicContext</include>
         <include>com.sun.jndi.toolkit.ctx.ComponentContext</include>
         <include>com.sun.jndi.toolkit.ctx.PartialCompositeContext</include>
         <include>com.sun.jndi.ldap.LdapCtx</include>
         <include>javax.naming.ldap.LdapName</include>
         <include>javax.naming.NameImpl</include>
         <include>javax.naming.ldap.Rdn</include>
         <include>javax.naming.ldap.Rdn$RdnEntry</include>
       </additional-boot-jar-classes>
       <transient-fields>
         <field-name>org.acegisecurity.ui.savedrequest.SavedRequest.contextPath</field-name>
         <field-name>org.acegisecurity.ui.savedrequest.SavedRequest.servletPath</field-name>
       </transient-fields>
     </dso>
   </application>
 
 </tc:tc-config>
 


does it matter what order i start my TC servers in? what mode should they start in - PASSIVE-UNINITIALIZED, ACTIVE-COORDINATOR ?

thx
hhuynh

cherubim

Joined: 06/16/2006 11:54:06
Messages: 761
Offline

you should definitely start each server with -n <servername> option. As for the problems you're running into, make sure you don't have extra server processes hanging around. Also, each server should be able to ping the other guy through port 9530. One way only communication is common for the split brain problem.

The first server that started will be the Active.
tgautier

seraphim

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

Just to be sure you should be using Terracotta 2.6.2
[WWW]
denov

journeyman

Joined: 07/15/2008 16:12:03
Messages: 12
Offline

thank for the quick replies.

the problem was a hostname mistake. the hostname on the server got change but /etc/hosts didn't get updated.

what's the -n for? i don't seem see this in the docs. is there any way i can get away without using?
ari

seraphim

Joined: 05/24/2006 14:23:21
Messages: 1665
Location: San Francisco, CA
Offline

All TC Server instances need to know about each other. So they need to see each other as <server> stanzas in the tc-config.xml.

You then tell each node which it is w/ the "-n" option.

Example:

3 servers: a, b, and c

you will have 3 xml config stanzas in each server's config file. In other words, a, b, and c will all exist in the config file.

Then you start the 3 TC instances:
1. start-tc-server.sh -n a -f <some_tc_config_file>
2. start-tc-server.sh -n b -f ...
3. start-tc-server.sh -n c -f ...

--Ari
[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.7 © JForum Team