0

I have a maven project with the following in the pom:

<build>
    <plugins>
        <plugin>
            <groupId>org.terracotta.maven.plugins</groupId>
            <artifactId>tc-maven-plugin</artifactId>
            <version>1.6.1</version>

            <dependencies>
                <dependency>
                    <groupId>org.terracotta</groupId>
                    <artifactId>terracotta-toolkit-1.3-runtime</artifactId>
                    <version>3.4.0</version>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>
    </plugins>
</build>

When I try and start the terracotta instance It seems to start up fine and I can see the cluster in the developer console. i.e. using:

mvn tc:start

I then run my application, which has an ehcache configuration. The terracotta URL is set (property is getting replaced correctly):

<terracottaConfig url="${org.quartz.terracotta.tcConfigUrl}"/>

But on the console I get the following:

2013-08-01 12:47:40,781 INFO  net.sf.ehcache.terracotta.TerracottaClient        : Thread [main] [cacheManager: no name]: Creating new ClusteredInstanceFactory
2013-08-01 12:47:41,471 INFO - Terracotta 3.5.4, as of 20111212-111224 (Revision 19290 by cruise@rh5vmo100 from 3.5.4)
2013-08-01 12:47:42,043 INFO - Successfully loaded base configuration from server at 'localhost:9510'.
2013-08-01 12:47:42,135 INFO - Successfully loaded base configuration from file at '/var/folders/1k/kmzsymfj63b9jptfh4ywvplw6__lz7/T/tc-config3047796204629623347.xml'.
2013-08-01 12:47:42,164 INFO - Log file: '/Users/james.mchugh/terracotta/client-logs/terracotta-client.log'.
2013-08-01 12:47:42,184 WARN - Can't connect to server[10.194.194.133:9510:Tc-Group-0].Retrying... 

And in the logs it just sits there trying to reconnect and printing the following each time:

2013-08-01 12:47:44,189 [main] INFO com.terracottatech.dso - Trying to get Groupname ID Map from http://10.194.194.133:9510/groupidmap
2013-08-01 12:47:44,192 [main] WARN com.terracottatech.dso - Can't connect to [10.194.194.133:9510:Tc-Group-0].

Does anyone have any idea why this would happen, I can ping/telnet into the terracotta server just fine but I don't know why it won't connect. I'm not overly familiar with terracotta either so try and keep this in mind when answering.

Cheers.

messivanio
  • 2,263
  • 18
  • 24
James
  • 1,237
  • 4
  • 22
  • 43

1 Answers1

1

There is an IP inconsistency issue between "localhost" and your LAN IP 10.194.194.133 (from your logs) Make sure to use the same IP for both the client (whatever ${org.quartz.terracotta.tcConfigUrl} resolves to - what did you use?) and the server (port 9510 might be only bound to IP 10.194.194.133) Run "netstat -na" and check that 9510 is listening on that IP...might be listening only on localhost, or your LAN IP, or maybe another IP (if you have 2 NICs on your dev/server box)

Long story: if 9510 is only bound to IP 10.194.194.133, make sure to have ${org.quartz.terracotta.tcConfigUrl} = 10.194.194.133.

Alternatively, you can also build you own tc-config.xml that can be loaded by the maven plugin (check http://forge.terracotta.org/releases/projects/tc-maven-plugin/configuration.html)...that way you can fine-grain set the net interfaces on which terracotta will work.

Hope that helps.

lanimall
  • 451
  • 2
  • 7
  • I tried using the same IP for client (i.e. change localhost to 10.194...) but I still get the same behaviour. Checked nestat and its set to listen to *.9510 from *.* so it should accept either really. I'll try creating manual config like you suggested but in the meantime do you have any other ideas? The weird thing is the developer console for terracotta connects to the cluster fine using localhost:9510 so I don't see what is preventing my client. Thanks so far. – James Aug 02 '13 at 08:44