Author |
Message |
07/24/2008 06:39:55
|
Royan
journeyman
Joined: 07/24/2008 06:36:15
Messages: 10
Offline
|
I'd like to start Terracotta server and two clients on three different boxes. What do i need to write in server/clients tc-config files in order to make all of them work together?
|
|
|
07/24/2008 08:48:00
|
neochu19
journeyman
Joined: 06/05/2008 04:05:59
Messages: 26
Offline
|
Hi,
You just need to specify the TC server IP. So the <servers> section will look like this:
Code:
...
<servers>
<server host="10.10.1.129" name="My Server">
<dso-port>9510</dso-port>
<jmx-port>9520</jmx-port>
...
</server>
</servers>
...
Use the same tc-config to launch your clients too. It'll help them to connect to the TC server.
Chu
|
|
|
07/24/2008 14:00:36
|
Royan
journeyman
Joined: 07/24/2008 06:36:15
Messages: 10
Offline
|
Thanks Chu, but could you possibly tell a little bit more on what exactly do I need to add specifically for clients config? I mean I'll try solution just want to be sure that this is it.
BTW, I thought clients do not parse <server> </server> part of the config. That sounds confusing, if this is not correct then what do you mean by "It'll help them to connect to the TC server"?
|
|
|
07/24/2008 14:08:18
|
colonel
journeyman
Joined: 07/23/2008 03:22:04
Messages: 12
Offline
|
Hi Royan,
afaik they do parse that and use it to discover the TC server. So there's nothing you need to add so they will know each other and be ready to work together.
The rest is just standard config: your shared roots, spring app contexts if any, instrumented classes, locks, ...
hth
- Denis
|
|
|
07/24/2008 15:04:39
|
gkeim
ophanim
Joined: 12/05/2006 10:22:37
Messages: 685
Location: Terracotta, Inc.
Offline
|
Yes, and you can override the servers the client will use by passing it the tc.server system property:
java -Dtc.server=host1:9510,host2:9510 ...
The scripts will use the value of the TC_SERVER environment variable to set this system property.
There is a little document about running the samples on different nodes here: http://www.terracotta.org/confluence/display/howto/Terracotta+DSO+on+Multiple+Nodes
|
Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community |
|
|
07/25/2008 06:41:26
|
Royan
journeyman
Joined: 07/24/2008 06:36:15
Messages: 10
Offline
|
Ok I've got the following in my tc-config.xml now
Code:
<servers>
<server host="10.152.113.128" name="BOX_1">
<dso-port>9510</dso-port>
<jmx-port>9520</jmx-port>
</server>
<update-check>
<enabled>true</enabled>
</update-check>
</servers>
But when I start server it outputs the following:
2008-07-25 09:37:12,878 INFO - JMX Server started. Available at URL[service:jmx:jmxmp://0.0.0.0:9520]
2008-07-25 09:37:13,772 INFO - Terracotta Server has started up as ACTIVE node on 0:0:0:0:0:0:0:0:9510 successfully, and is now ready for work.
Does that mean that config server setting was not loaded
|
|
|
07/25/2008 06:48:17
|
ari
seraphim
Joined: 05/24/2006 14:23:21
Messages: 1665
Location: San Francisco, CA
Offline
|
Are you running start-tc-server.sh with "-f <some_tc_config_file>" and "-n BOX_1"?
--Ari
|
|
|
07/25/2008 12:44:29
|
gkeim
ophanim
Joined: 12/05/2006 10:22:37
Messages: 685
Location: Terracotta, Inc.
Offline
|
The server element has a bind address attribute which defaults to all network interfaces (0.0.0.0). If your server host has multiple network interfaces, you can use the bind address to specify which is used for the connection listener.
So, it's working as expected.
|
Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community |
|
|
07/28/2008 05:51:35
|
Royan
journeyman
Joined: 07/24/2008 06:36:15
Messages: 10
Offline
|
Thanks gkeim! bind attribute has done the trick. One quick question though. As far as I could understand host attribute should always resolve to the IP address that is supplied to bind attribute, is that correct? If it's correct then what happens when host resolves to some other IP address? Perhaps I just not understand what is bind attribute used for...
|
|
|
07/28/2008 12:22:20
|
gkeim
ophanim
Joined: 12/05/2006 10:22:37
Messages: 685
Location: Terracotta, Inc.
Offline
|
Great, although I must admit that I don't know what trick was done. The documentation on the bind attribute is a bit thin so I've entered a JIRA ticket to get that resolved: https://jira.terracotta.org/jira/browse/CDV-820
Suffice it to say, just set your host="%i" and don't worry about bind... just leave it out and don't worry about the log messages that show 0.0.0.0. Everything is OK, your clients will connect to the server just fine. Using the sample config files as a template is a good way to go.
If your production server host has multiple network interfaces, and you want to specify which of those interfaces clients can connect on, you would use the bind attribute. By default, clients can connect to your server on any of the available network interfaces.
|
Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community |
|
|
08/22/2008 08:36:33
|
anupam
journeyman
Joined: 07/31/2008 05:32:53
Messages: 11
Offline
|
Hello All,
I read some of the posts above. My usecase is related to the jpetstore application. I have two application servers where I have deployed the jpetstore war file (Tomcat 6.0) , both application servers are unix
The Terracotta server is my local machine which is XP . I went throught some documentation of Quick start with Tomcat .
Due to some reasons I am not sure whether the clients are correctly configured , I start my admin server console , the number of clients remain always as zero
Here is the snapshot of my tc-config.xml file for the two application servers
---------------------------------------------------------------------------------------
<tc:tc-config xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">
<servers>
<!-- The <update-check> element helps ensure that you're using the latest version of Terracotta DSO.
Out-of-date versions trigger a message to log and standard output. -->
<server host="10.222.144.235" name="TRTP8101">
<dso-port>9510</dso-port>
<jmx-port>9520</jmx-port>
</server>
<update-check>
<enabled>true</enabled>
</update-check>
</servers>
<application>
<dso>
<web-applications>
<web-application>jpetstore</web-application>
</web-applications>
</dso>
</application>
</tc:tc-config>
----------------------------------------------------------------------------------
Can someone please help me how could one see the clients as two on the admin console ??
Best Regards,
Anupam
|
|
|
08/25/2008 01:04:53
|
anupam
journeyman
Joined: 07/31/2008 05:32:53
Messages: 11
Offline
|
Dear all,
Please can you anyone answer my last post , would be really grateful !!
Best Regards,
Anupam
|
|
|
08/25/2008 07:41:58
|
tgautier
seraphim
Joined: 06/05/2006 12:19:26
Messages: 1781
Offline
|
on your xp machine can you check your firewall settings to ensure that ports 9510 and 9520 are open.
|
|
|
08/25/2008 08:08:13
|
anupam
journeyman
Joined: 07/31/2008 05:32:53
Messages: 11
Offline
|
Thanks a lot Taylor!
I checked my firewall settings, infact the firewall is disabled. Another interesting thing I observed was
my two client app servers have addresses 172.17.2.18 & 172.17.2.19
and my local XP machine has address as 10.222.144.235
I am not sure if this can be a problem ?
Do all three machines be in the same subnet ?
Best Regards,
Anupam
|
|
|
08/25/2008 08:19:22
|
tgautier
seraphim
Joined: 06/05/2006 12:19:26
Messages: 1781
Offline
|
Terracotta uses TCP so machines can be wherever you like.
|
|
|
|