Author |
Message |
07/07/2008 02:33:01
|
kiwu
journeyman
Joined: 05/20/2008 00:59:21
Messages: 18
Offline
|
Hi everyone,
I am using the listener classes in the jmx-util project to handle scenarios where the TC client is disconnected from the TC server. One of the listeners, the ClusterBeanRegistrationListener is causing problems when the TC client has been started with a dedicated node name. The ClusterBeanRegistrationListener waits for the cluster bean registration before it registers the actual listener. Here lies the problem. The used object name for the cluster bean is Code:
"org.terracotta:type=Terracotta Cluster,name=Terracotta Cluster Bean"
but when I use a dedicated node name for my client the object name of the cluster bean is something like Code:
"org.terracotta:clients=Clients,node-name=node1,type=Terracotta Cluster,name=Terracotta Cluster Bean"
. The result is that the ClusterBeanRegistrationListener will wait forever.
Perhaps I have overlooked something but for me it appears to be that way.
Cheers
Chris
|
|
|
07/07/2008 09:08:57
|
tgautier
seraphim
Joined: 06/05/2006 12:19:26
Messages: 1781
Offline
|
I see a message that indicates the use of a client node name was never intended to have an effect on the JMX cluster beans, but that it is.
http://www.mail-archive.com/tc-dev@lists.terracotta.org/msg01765.html
My take on this is that this is a bug.
Question: why are you setting a client node name with this property? I presume what you are doing is something like:
java -Dtc.node-name=foo
|
|
|
07/07/2008 09:21:47
|
kiwu
journeyman
Joined: 05/20/2008 00:59:21
Messages: 18
Offline
|
I use the node name just in my local dev environment to prevent conflicts when I am running two tomcats resp. TC clients on the same machine. We won't use node names in production or production like environments.
Chris
|
|
|
07/09/2008 07:19:18
|
kiwu
journeyman
Joined: 05/20/2008 00:59:21
Messages: 18
Offline
|
I figured out how to use a dedicated node name and avoid the problems mentioned before witht he ClusterBeanRegistrationListener. You just have to avoid the use of tc.node-name as JVM property name and use instead a name like "node" to run two tc clients on the same host machine.
In my catalina.sh script I have this line
export CATALINA_OPTS=$CATALINA_OPTS" -Xdebug -Dnode=node1 -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
And in my tc-config.xml I have the following line that uses this property
..
<clients>
<statistics>%(user.home)/terracotta/client-stats/%(node)/</statistics>
<logs>%(user.home)/terracotta/client-logs/%(node)/</logs>
..
Apparently only the JVM property tc.node-name changes the object name of the ClusterBean.
Perhaps it would be good to change the warning message that appears when you run several TC clients on the same machine without setting a JVM property for distinction.
**************************************************************************************
The statistics buffer couldn't be opened at
'/home/cmacher/terracotta/client-stats'.
The CVT system will not be active for this node.
A common reason for this is that you're launching several Terracotta L1
clients on the same machine. The default directory for the statistics buffer
uses the IP address of the machine that it runs on as the identifier.
When several clients are being executed on the same machine, a typical solution
to properly separate these directories is by using a JVM property at startup
that is unique for each client.
For example:
dso-java.sh -Dtc.node-name=node1 your.main.Class
You can then adapt the tc-config.xml file so that this JVM property is picked
up when the statistics directory is configured by using %(tc.node-name) in the
statistics path.
**************************************************************************************
|
|
|
07/09/2008 07:35:05
|
tgautier
seraphim
Joined: 06/05/2006 12:19:26
Messages: 1781
Offline
|
Oh
Now I feel bad - actually there was a thread about this started by Geert some time ago. I think we just dropped it.
Sorry to make you figure it out on your own. Yes, your suggestion is good. Also we should probably eliminate the tc-node name affecting the JMX bean, I don't think that was ever intentional.
Would you mind filing a bug? There might already be one on this topic, but it doesn't hurt to have another.
Thanks and glad you got it working.
|
|
|
07/09/2008 08:12:01
|
kiwu
journeyman
Joined: 05/20/2008 00:59:21
Messages: 18
Offline
|
No problem.
https://jira.terracotta.org/jira/browse/CDV-806
Cheers
Chris
|
|
|
|